From 6a9dc7c1637132c32c47cabd1c8ceb05e4890d67 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Mon, 16 Apr 2018 19:11:00 +0200 Subject: [PATCH] Secure environment variables are not available in PR builds cf. https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions Therefore, only use them in official builds. Signed-off-by: David Wagner --- .travis.yml | 8 +++----- travis-setup-deploy.sh | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100755 travis-setup-deploy.sh diff --git a/.travis.yml b/.travis.yml index c6f1a6f8..8b6c520b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,10 +17,8 @@ matrix: os: linux before_install: - - openssl aes-256-cbc -K $encrypted_dcd2b299f7c9_key -iv $encrypted_dcd2b299f7c9_iv -in deploy_rsa.enc -out /tmp/deploy_rsa -d - - eval "$(ssh-agent -s)" - - chmod 600 /tmp/deploy_rsa - - ssh-add /tmp/deploy_rsa + - if [ "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_REPO_SLUG" = "eclipse/paho.mqtt.c" ]; then export DEPLOY=true; fi + - if [ "$DEPLOY" = "true" ]; then ./travis-setup-deploy.sh; fi - ./travis-install.sh env: @@ -53,4 +51,4 @@ addons: after_success: - ls -l build.paho/*.tar.gz - - scp -o StrictHostKeyChecking=no build.paho/*.tar.gz icraggs@build.eclipse.org:../../../../shared/technology/paho/C/ + - if [ "$DEPLOY" = "true" ]; then scp -o StrictHostKeyChecking=no build.paho/*.tar.gz icraggs@build.eclipse.org:../../../../shared/technology/paho/C/; fi diff --git a/travis-setup-deploy.sh b/travis-setup-deploy.sh new file mode 100755 index 00000000..0708f200 --- /dev/null +++ b/travis-setup-deploy.sh @@ -0,0 +1,4 @@ +openssl aes-256-cbc -K $encrypted_dcd2b299f7c9_key -iv $encrypted_dcd2b299f7c9_iv -in deploy_rsa.enc -out /tmp/deploy_rsa -d +eval "$(ssh-agent -s)" +chmod 600 /tmp/deploy_rsa +ssh-add /tmp/deploy_rsa