From f5e4fb52423c12f840b157a697556f7d52ca4149 Mon Sep 17 00:00:00 2001 From: Jaskaran Sarkaria Date: Sun, 21 Jun 2020 21:10:01 +0100 Subject: [PATCH] Feature/add travis ci3 (#7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 🤖 run test * chore: 🤖 swtich travis lang to bash * chore: 🤖 rename to .travis.yml * chore: 🤖 switch lang to go * chore: 🤖 test stage * fix: 🐛 yaml * fix: 🐛 fix yaml * chore: 🤖 build docker * fix: 🐛 yaml * chore: 🤖 add git tag to docker build * chore: 🤖 fix syntax * chore: 🤖 add if tag * chore: 🤖 fix stage name * fix: 🐛 indent --- .travis.yml | 22 ++++++++++++++++++++++ travis.yml | 9 --------- 2 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 .travis.yml delete mode 100644 travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..881a14b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +language: go +go: + - 1.14.2 + +services: + - docker + +jobs: + include: + - stage: "Tests and Linting" + name: "Linting" + script: go vet ./... + name: "Unit Tests" + script: go test -v ./... + - stage: "Build and Push Image" + name: "Build docker image" + script: docker build -t jaskaransarkaria/timer-server:"${TRAVIS_TAG}" . + +stages: + - Tests and Linting + - name: "Build and Push Image" + if: tag IS present diff --git a/travis.yml b/travis.yml deleted file mode 100644 index fa65f44..0000000 --- a/travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: go -go: - - 1.14.2 -# env: -# - "PATH=/home/travis/gopath/bin:$PATH" - -before_script: - - go vet ./... -