From 3ae6043748bb9c396723f83a8206426908bf5ba7 Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Wed, 22 Apr 2020 13:40:13 +0300 Subject: [PATCH] *: remove snap from travis --- .travis.yml | 17 ----------------- build_snap.sh | 12 ++++++++++-- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 39a7bf28..b2e5a2dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -119,20 +119,3 @@ matrix: - ./build_docker.sh after_script: - docker images - - # Snapcraft build configuration - - if: repo = AdguardTeam/AdGuardHome - - name: snapcraft - # if: type != pull_request AND (branch = master OR tag IS present) AND repo = AdguardTeam/AdGuardHome - if: branch = snapcraft - go: - - 1.14.x - os: - - linux - services: - - docker - script: - - ./build_snap.sh - after_failure: - # replace snap name - - cat adguardhometest_*.txt \ No newline at end of file diff --git a/build_snap.sh b/build_snap.sh index 2d305a52..89da6fbe 100755 --- a/build_snap.sh +++ b/build_snap.sh @@ -16,6 +16,12 @@ else CHANNEL="release" fi +# If bash is interactive, set `-it` parameter for docker run +INTERACTIVE="" +if [ -t 0 ] ; then + INTERACTIVE="-it" +fi + # Launchpad oauth tokens data is necessary to run snapcraft remote-build # # Here's an instruction on how to generate launchpad OAuth tokens: @@ -42,7 +48,8 @@ sed -i.bak 's/dev_version/'"${VERSION}"'/g' ./snapcraft.yaml build_snap() { # Run the build - docker run -it -v $(pwd):/build \ + docker run ${INTERACTIVE} --rm \ + -v $(pwd):/build \ -v $(pwd)/launchpad_credentials:/root/.local/share/snapcraft/provider/launchpad/credentials:ro \ ${BUILDER_IMAGE} \ snapcraft remote-build --build-on=${ARCH} --launchpad-accept-public-upload @@ -57,7 +64,8 @@ publish_snap() { fi # Login and publish the snap - docker run -it -v $(pwd):/build \ + docker run ${INTERACTIVE} --rm \ + -v $(pwd):/build \ ${BUILDER_IMAGE} \ sh -c "snapcraft login --with=/build/snapcraft_login && snapcraft push --release=${CHANNEL} /build/${snapFile}" }