Skip to content

Commit

Permalink
CI - parallel deploy fix attempt #2
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismclarke committed Jun 6, 2020
1 parent 5e91679 commit 0139882
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ before_script:
###############################################################################################################
# create a default script to be triggered from jobs
# see https://docs.travis-ci.com/user/build-matrix/#job-uniqueness-and-duplicate-jobs
defaults: &defaults
_test_defaults: &test_defaults
script:
- echo "group=$CI_GROUP browser=$CI_BROWSER"
- export TZ=UTC
# A bit ugly to look at, but this starts the platform server with ci environment variables,
# A bit ugly to look into, but this starts the platform server with ci environment variables,
# waits until it's fully responsive, and then executes cypress tests for a given browser and parallel node
# see https://docs.cypress.io/guides/guides/parallelization.html
- npm run test ci
Expand All @@ -58,37 +58,40 @@ jobs:
- CI_GROUP=2x-chrome
- CI_BROWSER=chrome
- CI_NODE=0
<<: *defaults
<<: *test_defaults
- env:
- CI_GROUP=2x-chrome
- CI_BROWSER=chrome
- CI_NODE=1
<<: *defaults
<<: *test_defaults
- env:
- CI_GROUP=2x-firefox
- CI_BROWSER=firefox
- CI_NODE=0
<<: *defaults
<<: *test_defaults
- env:
- CI_GROUP=2x-firefox
- CI_BROWSER=firefox
- CI_NODE=1
<<: *defaults
<<: *test_defaults
# Note, Travis jobs combined with regular stage scripts below
# Before Deploy - install firebase cli and set firebase project ci token from environment
- stage: before_deploy
# Create common predeploy script which can be included as part of other deploy scripts (data not persisted between jobs otherwise)
- &predeploy_install
stage: install deploy dependencies
script:
- npm run build
- npm install -g firebase-tools
- export FIREBASE_TOKEN=$(if [ "$TRAVIS_BRANCH" == "production" ]; then echo "$FIREBASE_PRODUCTION_TOKEN"; else echo "$FIREBASE_STAGING_TOKEN"; fi)
# Deploy - Firebase deployment to dev/prod depending on branch
- stage: deploy
- <<: *predeploy_install
stage: deploy
provider: script
script: bash scripts/deploy.dev.sh
skip_cleanup: true
on:
branch: master
- stage: deploy
- <<: *predeploy_install
stage: deploy
provider: script
script: bash scripts/deploy.prod.sh
skip_cleanup: true
Expand Down

0 comments on commit 0139882

Please sign in to comment.