Merge pull request #216 from kiwix/correct_decrypt_key

[TRAVIS] Correctly decrypt the ssh key
This commit is contained in:
Matthieu Gautier 2018-07-11 17:15:15 +02:00 committed by GitHub
commit e577efd612
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 11 deletions

View File

@ -13,6 +13,10 @@ if: type != push OR tag IS present
before_install: before_install:
- PATH=$PATH:${HOME}/bin - PATH=$PATH:${HOME}/bin
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=$PATH:$(brew --prefix)/opt/gettext/bin; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=$PATH:$(brew --prefix)/opt/gettext/bin; fi
- '[ -n "$encrypted_eba2f7543984_iv" ] && openssl aes-256-cbc
-K $encrypted_eba2f7543984_key -iv $encrypted_eba2f7543984_iv
-in travis/travisci_builder_id_key.enc -out travis/travisci_builder_id_key -d'
- chmod 600 travis/travisci_builder_id_key
before_cache: before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/ - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
@ -34,10 +38,6 @@ script:
travis/compile_all.py travis/compile_all.py
fi fi
after_failure: travis/upload_all_log.sh after_failure: travis/upload_all_log.sh
before_deploy:
- openssl aes-256-cbc -K $encrypted_eba2f7543984_key -iv $encrypted_eba2f7543984_iv
-in travis/travisci_builder_id_key.enc -out travis/travisci_builder_id_key -d
- chmod 600 travis/travisci_builder_id_key
deploy: deploy:
- provider: script - provider: script
skip_cleanup: true skip_cleanup: true

View File

@ -32,7 +32,10 @@ NIGHTLY_ZIM_ARCHIVES_DIR = HOME/'NIGHTLY_ZIM_ARCHIVES'/NIGHTLY_DATE
RELEASE_ZIM_ARCHIVES_DIR = HOME/'RELEASE_ZIM_ARCHIVES' RELEASE_ZIM_ARCHIVES_DIR = HOME/'RELEASE_ZIM_ARCHIVES'
DIST_KIWIX_ARCHIVES_DIR = HOME/'DIST_KIWIX_ARCHIVES' DIST_KIWIX_ARCHIVES_DIR = HOME/'DIST_KIWIX_ARCHIVES'
DIST_ZIM_ARCHIVES_DIR = HOME/'DIST_ZIM_ARCHIVES' DIST_ZIM_ARCHIVES_DIR = HOME/'DIST_ZIM_ARCHIVES'
SSH_KEY = environ.get('TRAVISCI_SSH_KEY', Path(environ['TRAVIS_BUILD_DIR'])/'travis'/'travisci_builder_id_key') if 'TRAVISCI_SSH_KEY' in environ:
SSH_KEY = Path(environ['TRAVISCI_SSH_KEY'])
else:
SSH_KEY = Path(environ['TRAVIS_BUILD_DIR'])/'travis'/'travisci_builder_id_key'
# We have build everything. Now create archives for public deployement. # We have build everything. Now create archives for public deployement.
BINARIES = { BINARIES = {
@ -225,14 +228,13 @@ try:
except URLError: except URLError:
print_message("Cannot get archive. Build dependencies") print_message("Cannot get archive. Build dependencies")
run_kiwix_build('alldependencies', platform=PLATFORM) run_kiwix_build('alldependencies', platform=PLATFORM)
if SSH_KEY.exists():
archive = make_deps_archive('alldependencies', full=True) archive = make_deps_archive('alldependencies', full=True)
destination = 'nightlybot@download.kiwix.org:/var/www/tmp.kiwix.org/ci/{}' destination = 'nightlybot@download.kiwix.org:/var/www/tmp.kiwix.org/ci/{}'
destination = destination.format(base_dep_archive_name) destination = destination.format(base_dep_archive_name)
scp(archive, destination) scp(archive, destination)
# A basic compilation to be sure everything is working (for a PR) # A basic compilation to be sure everything is working (for a PR)
if environ['TRAVIS_EVENT_TYPE'] != 'cron' and not make_release: if environ['TRAVIS_EVENT_TYPE'] != 'cron' and not make_release:
if PLATFORM.startswith('android'): if PLATFORM.startswith('android'):