From dbe5674b1fd0789b66a057f006cbad74b7a6a5c2 Mon Sep 17 00:00:00 2001 From: jaskaran Date: Sun, 21 Jun 2020 21:53:33 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20build=20and=20push=20in?= =?UTF-8?q?=20one=20stage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 75a0712..e16c30f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,16 +13,13 @@ jobs: name: "Unit Tests" script: go test -v ./... - stage: "Build Docker Image" - name: "Build docker image" - script: docker build -t jaskaransarkaria/timer-server:"${TRAVIS_TAG}" . - - stage: - name: "Push Docker Image" + name: "Build and Push docker image" script: | + docker build -t jaskaransarkaria/timer-server:"$TRAVIS_TAG" . echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - docker push jaskaransarkaria/timer-server:"${TRAVIS_TAG}" + docker push jaskaransarkaria/timer-server:"$TRAVIS_TAG" stages: - Tests and Linting - - name: "Build Docker Image" + - name: "Build and Push Docker Image" if: tag IS present - - "Push Docker Image"