Browse Source

Add website analytics back (#5699)

* add website analytics to build

* add segment analytics env var check
pull/5715/head
Alvin Huang 6 years ago committed by GitHub
parent
commit
05946afa0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      .circleci/config.yml
  2. 6
      website/scripts/deploy.sh

15
.circleci/config.yml

@ -195,9 +195,24 @@ jobs:
steps: steps:
- checkout: - checkout:
path: ~/project path: ~/project
# attach website build directory # attach website build directory
- attach_workspace: - attach_workspace:
at: ~/project/website at: ~/project/website
# restores gem cache
- restore_cache:
key: *RUBYGEM_CACHE_KEY
# rerun build with 'ENV=production' to add analytics
- run:
name: install gems
command: bundle check || bundle install --path vendor/bundle --retry=3
# rerun build with 'ENV=production' to add analytics
- run:
name: middleman build
command: bundle exec middleman build
- run: - run:
name: website deploy name: website deploy
command: ./scripts/deploy.sh command: ./scripts/deploy.sh

6
website/scripts/deploy.sh

@ -30,6 +30,12 @@ if ! command -v "s3cmd" >/dev/null 2>&1; then
exit 1 exit 1
fi fi
# Ensure the proper analytics Segment ID is set
if [ "$ENV" != "production" ]; then
echo "ENV is not set to production for Segment Analytics!"
exit 1
fi
# Get the parent directory of where this script is and cd there # Get the parent directory of where this script is and cd there
DIR="$(cd "$(dirname "$(readlink -f "$0")")/.." && pwd)" DIR="$(cd "$(dirname "$(readlink -f "$0")")/.." && pwd)"

Loading…
Cancel
Save