Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perform Travis deployment setup only when deploying #385

Merged
merged 1 commit into from
Feb 24, 2017

Conversation

dsingleton
Copy link
Contributor

@dsingleton dsingleton commented Feb 24, 2017

⚠️ Opening this as a fork, to simulate the situation in #383. I tested with the original implementation and the build failed in the same way

Steps in before_install are run for all builds, not just deploys.

For branches/PRs from forks of this repo the install step fails as the user will not have access to the ENV vars used to decrypt files, like encrypted_909ac1036a94_key. This was caught in #383, where a forked PR build consistently fails on the openssl step.

Steps specified in before_deploy are only run if a deployment is triggered [1], which will only happen on master, which can't be triggered by a forked user.

Also adds a couple of inline comments to help explain the steps, which are a little obtuse at first glance.

[1] Travis before_deploy documentation

Steps in `before_install` are run for all builds, not just deploys.

For branches/PRs from forks of this repo the install step fails as the
user will not have access to the ENV vars used to decrypt files, like
`encrypted_909ac1036a94_key`. This was caught in alphagov#383, where a forked
PR build consistently fails on the `openssl` step.

Steps specified in `before_deploy` are only run if a deployment is
triggered [^before_deploy], which will only happen on `master`, which
can't be triggered by a forked user.

Also adds a couple of inline comments to help explain the steps, which
are a little obtuse at first glance.

[^before_deploy]: [Travis `before_deploy` documentation](https://docs.travis-ci.com/user/deployment/npm/#Running-commands-before-and-after-deploy)
@dsingleton dsingleton changed the title Perform Travis deployment setup only when deploying [do-not-merge] Perform Travis deployment setup only when deploying Feb 24, 2017
@dsingleton dsingleton force-pushed the travis-deployment-config branch from c36133f to 784ce3d Compare February 24, 2017 12:43
@dsingleton dsingleton changed the title [do-not-merge] Perform Travis deployment setup only when deploying Perform Travis deployment setup only when deploying Feb 24, 2017
Copy link
Contributor

@36degrees 36degrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

dsingleton added a commit to alphagov/govuk_elements that referenced this pull request Feb 24, 2017
With other GDS FE repos, see:
alphagov/govuk_frontend_toolkit#385

Steps specified in before_deploy are only run if a deployment is
triggered [1], which will only happen on master, which can't be
done by a user without write perms.

[1] Travis before_deploy documentation
dsingleton added a commit to alphagov/govuk_elements that referenced this pull request Feb 24, 2017
With other GDS FE repos, see:
alphagov/govuk_frontend_toolkit#385

Steps specified in before_deploy are only run if a deployment is
triggered [1], which will only happen on master, which can't be
done by a user without write perms.

[1] [Travis before_deploy documentation](https://docs.travis-ci.com/user/deployment/npm/#Running-commands-before-and-after-deploy)
@dsingleton dsingleton merged commit 194f60e into alphagov:master Feb 24, 2017
@dsingleton dsingleton deleted the travis-deployment-config branch February 24, 2017 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants