From cc36ba5207d001015986381e6f0f084d817abc99 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Fri, 26 Apr 2019 12:54:09 +0200 Subject: [PATCH] Safer docker login and fails on any command in travis --- .dockerignore | 6 ++---- .travis.yml | 7 ++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.dockerignore b/.dockerignore index 991b0a28..d424e1ed 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,4 @@ .git -.travis.yml readme -tun.sh -docker-compose.yml -README.md \ No newline at end of file +*.yml +*.md \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index e78358f3..ad8dbad0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,9 +16,10 @@ env: BASE_IMAGE=arm64v8/alpine TARGET_IMAGE=${DOCKER_BUILD}:${ARCH} script: - - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" + - set -e + - echo "$DOCKER_PASSWORD" | docker login -u qmcgaw --password-stdin - docker run --rm --privileged multiarch/qemu-user-static:register --reset - docker build -t ${TARGET_IMAGE} --build-arg BASE_IMAGE=${BASE_IMAGE} --build-arg VCF=${TRAVIS_COMMIT} --build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" . - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && docker push ${DOCKER_BUILD} || false' -after_script: - - "curl -X POST https://hooks.microbadger.com/images/${DOCKER_BUILD}/${MICROBADGER_CODE}" \ No newline at end of file + - "curl -X POST https://hooks.microbadger.com/images/${DOCKER_BUILD}/${MICROBADGER_CODE}" + \ No newline at end of file