diff options
author | Marco Trevisan <mail@3v1n0.net> | 2017-02-23 19:42:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-23 19:42:17 +0300 |
commit | c1d1b7b61e25547f0e7604603b71d80753e582da (patch) | |
tree | b988ba206f8ac96e737b6bc125a67301a1a18e07 /scripts | |
parent | a9514faf164f4d0f39e9ee2cdaf4003a5f0f1608 (diff) |
snap: optionally push all the built snaps on PRs to transfer.sh (#1126)
Snaps generated on PRs will be temporary uploaded
to transfer.sh, so that it will be easier to test the binaries.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/travis-build.sh | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh index a7b76837b..289873e0d 100755 --- a/scripts/travis-build.sh +++ b/scripts/travis-build.sh @@ -74,7 +74,7 @@ elif [ "$BUILD_TYPE" == "snap" ]; then docker run --name $DOCKER_BUILDER_NAME -v $PWD:$PWD -w $PWD -td $DOCKER_IMAGE elif [ "$TRAVIS_BUILD_STEP" == "install" ]; then docker_exec apt-get update -q - docker_exec apt-get install cmake git-core snapcraft -y + docker_exec apt-get install -y cmake git-core snapcraft elif [ "$TRAVIS_BUILD_STEP" == "script" ]; then git clean -f mkdir $BUILD_FOLDER @@ -87,12 +87,21 @@ elif [ "$BUILD_TYPE" == "snap" ]; then docker_exec make $make_target -C $BUILD_FOLDER elif [ "$TRAVIS_BUILD_STEP" == "after_success" ]; then - sudo mkdir -p $BUILD_FOLDER/snap/.snapcraft -m 777 set +x - openssl aes-256-cbc -K $SNAPCRAFT_CONFIG_KEY \ - -iv $SNAPCRAFT_CONFIG_IV \ - -in snap/.snapcraft/travis_snapcraft.cfg \ - -out $BUILD_FOLDER/snap/.snapcraft/snapcraft.cfg -d + if [ -n "$SNAPCRAFT_CONFIG_KEY" ] && [ -n "$SNAPCRAFT_CONFIG_IV" ]; then + sudo mkdir -p $BUILD_FOLDER/snap/.snapcraft -m 777 + openssl aes-256-cbc -K $SNAPCRAFT_CONFIG_KEY \ + -iv $SNAPCRAFT_CONFIG_IV \ + -in snap/.snapcraft/travis_snapcraft.cfg \ + -out $BUILD_FOLDER/snap/.snapcraft/snapcraft.cfg -d + fi + set -x + + if [ "$TRAVIS_PULL_REQUEST" != "false" ] && + [ "$SNAP_TRANSFER_SH_UPLOAD_ON_PULL_REQUEST" == "true" ]; then + docker_exec apt-get install -y curl + docker_exec make snap-push-transfer.sh -C $BUILD_FOLDER + fi elif [ "$TRAVIS_BUILD_STEP" == "deploy-unstable" ]; then docker_exec make snap-push-$SNAP_UNSTABLE_CHANNEL -C $BUILD_FOLDER elif [ "$TRAVIS_BUILD_STEP" == "deploy-release" ]; then |