Skip to content

Commit

Permalink
Merge pull request #1866 from biglotteryfund/build-tweaks
Browse files Browse the repository at this point in the history
Run before_deploy once
  • Loading branch information
davidrapson authored Apr 15, 2019
2 parents fdcd4f8 + 1123bee commit 8e0c0fe
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,22 @@ script:
- npm run build-production
- npm test
- npm run test-integration

# Prepare artefact for deployment
# Store a temporary env var to only run before_deploy once
# (current behaviour is to run before_deploy once _per_ provider)
# https://github.com/travis-ci/travis-ci/issues/2570#issuecomment-171262181
before_deploy:
- npm prune --production > /dev/null 2>&1
- sh deploy/store_deploy_info.sh
- zip -qr latest * -x .\* -x "README.md" -x assets/\* -x "gulpfile.js"
- mkdir -p dpl_cd_upload
- mv latest.zip dpl_cd_upload/build-$TRAVIS_BUILD_NUMBER.zip
- >
if ! [ "$BEFORE_DEPLOY_RUN" ]; then
export BEFORE_DEPLOY_RUN=1;
npm prune --production > /dev/null 2>&1;
sh deploy/store_deploy_info.sh;
zip -qr latest * -x .\* -x "README.md" -x assets/\*;
mkdir -p dpl_cd_upload
mv latest.zip dpl_cd_upload/build-$TRAVIS_BUILD_NUMBER.zip
fi
deploy:
- provider: s3
region: eu-west-1
Expand Down

0 comments on commit 8e0c0fe

Please sign in to comment.