Skip to content

Add travis deploy script#16

Open
iggyvolz wants to merge 1 commit intonedwill:masterfrom
iggyvolz:travis-build
Open

Add travis deploy script#16
iggyvolz wants to merge 1 commit intonedwill:masterfrom
iggyvolz:travis-build

Conversation

@iggyvolz
Copy link
Contributor

@iggyvolz iggyvolz commented Dec 28, 2016

This script will build Soundhax and commit it to gh-pages - but there's some configuration that needs to be done before this will work:

  1. Create an SSH key (ssh-keygen -t rsa -b 4096 -C "[email protected]" -f deploy_key)
  2. Encrypt the SSH key and send to Travis (install the travis gem with (sudo) gem install travis, then travis encrypt-file deploy_key)
  3. Locate the encryption label (the hash that points to your key in Travis) in the encrypt-file output, which looks like this:
encrypting deploy_key for domenic/travis-encrypt-file-example
storing result as deploy_key.enc
storing secure env variables for decryption

Please add the following to your build script (before_install stage in your .travis.yml, for instance):

    openssl aes-256-cbc -K $encrypted_<ENCRYPTION LABEL HERE>_key -iv $encrypted_<ENCRYPTION LABEL HERE AS WELL>_key -in super_secret.txt.enc -out super_secret.txt -d

Pro Tip: You can add it automatically by running with --add.

Make sure to add deploy_key.enc to the git repository.
Make sure not to add deploy_key to the git repository.
Commit all changes to your .travis.yml.
  1. Put that encryption label into the .travis.yml file (line 45 at the moment) - either comment it and I can commit it, or send a PR to my repo (The encryption key can be public - it can't be used to get your key except within a Travis build that isn't a PR)
  2. Add the ssh public key (located in deploy_key.pub) as a deploy key to the repo - https://github.com/nedwill/soundhax/settings/keys (Make sure it has write access)
  3. Create a gh_pages branch, and create a blank soundhax-master.m4a file along with the deploy_key.enc file
  4. Merge
  5. The latest soundhax will be available at https://nedwill.github.io/soundhax/soundhax-master.m4a

@iggyvolz
Copy link
Contributor Author

iggyvolz commented Dec 28, 2016

@note that the deploy occurs in the after_success block, so it will always be marked as "success" even if the deploy fails. And also it will not build on a PR (your encrypted isn't accessible to PR's as well, so even if someone tried it would fail) - so unfortunately there's no way to be 100% sure it will work without merging it (although it worked fine on my fork).

@iggyvolz iggyvolz changed the title [WIP] Add travis build script Add travis build script Dec 28, 2016
@iggyvolz iggyvolz changed the title Add travis build script Add travis deploy script Dec 28, 2016
@nedwill
Copy link
Owner

nedwill commented Dec 28, 2016

Haha wow this is awesome. I'll probably hold off on setting all this up until we can cover the other FIRMs and I can put a nice frontend on the current release(s). It'd be nice if we could use this to generate all the latest ones for every ((old, new), (usa, eur, jpn, ...)) pair.

@iggyvolz
Copy link
Contributor Author

Yep, that definitely can be done.

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