-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from using GOV.UK Jenkins to Travis
This project isn't owned by GOV.UK Publishing anymore so it needs to stop using Jenkins to publish changes. Ideally I'd use a deploy key for this, but it turns out that you can't attach the same deploy key to more than one repo. This means that we're going to use a GitHub token attached to the govuk-ci user - this should be moved to a different user in the future. To make that happen: - Add the personal access token as a secure Heroku env var - Change the Git URLs to push over HTTPS, not SSH The gem_publisher gem expects there to be a file at `.gem/credentials`. I've encrypted that file for Travis and added that file to the Travis worker. Same deal for the `npm publish` command. It turns out you can only encrypt one file at a time which means that we need to create a tar archive and then move things around afterwards which is a little bit horrible. In order to do this I made a secrets directory and added 2 files: gem_credentials: ``` --- :rubygems_api_key: redacted ``` npmrc: ``` _auth = redacted email = [email protected] ``` And then ran: ``` tar cvf secrets.tar secrets/npmrc secrets/gem_credentials ``` And encrypted that file.
1 parent
2a645b8
commit 9db368c
Showing
8 changed files
with
25 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
language: ruby | ||
sudo: false | ||
env: | ||
global: | ||
- secure: "gxjwgl9l9ZP/1t86odZyMzWyiVBkG1oFzeL+Kb6z9Dtfu954l9RbytlenTTcnRw1KtaDBZVBs0ix3K45b8T2S6JFzLQ88Z/36DmXGIN6vxctfnVD9sqbbyOuP++RhibK+qUqbPRHo6a3wBsMQ87DMj5S6pJe3dxbCKRXa8zcMd0=" | ||
before_install: | ||
- openssl aes-256-cbc -K $encrypted_df4ab1bff570_key -iv $encrypted_df4ab1bff570_iv -in .travis/secrets.tar.enc -out .travis/secrets.tar -d | ||
- tar xvf .travis/secrets.tar | ||
- mkdir -p ~/.gem/ | ||
- mv secrets/gem_credentials ~/.gem/credentials | ||
- mv secrets/npmrc ~/.npmrc | ||
- git config --global user.name "Travis CI" | ||
- git config --global user.email "[email protected]" | ||
- rm -f Gemfile.lock | ||
- git clean -fdx | ||
install: | ||
# Ensure that Travis install is a no-op because `jenkins.sh` | ||
# installs dependencies. | ||
- echo "Not running Travis installation" | ||
- bundle install | ||
script: | ||
- ./jenkins.sh | ||
- bundle exec rake spec integration_tests | ||
deploy: | ||
- provider: script | ||
script: 'bundle exec rake build:and_release_if_updated' | ||
on: | ||
branch: master | ||
notifications: | ||
email: | ||
on_success: never | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.