Skip to content

Commit

Permalink
Add Dockerfile with changes to travis CI to push from it (#18)
Browse files Browse the repository at this point in the history
Signed-off-by: aswinkarthik <[email protected]>
  • Loading branch information
aswinkarthik committed Nov 7, 2018
1 parent b94cc7e commit 74b2bed
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 4 deletions.
37 changes: 33 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
sudo: required

language: go

go:
- 1.11
- 1.11

env:
global:
- GO111MODULE=on
- GORELEASER_ON=1

script:
- env GO111MODULE=on go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
- go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
- GOOS=linux go build

after_success:
- curl -sL https://codecov.io/bash | bash
- bash -l ./release.sh
- curl -sL https://codecov.io/bash | bash

before_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

deploy:
- provider: script
script: bash -l docker-push.sh
skip_cleanup: true
on:
branch: master
repo: aswinkarthik/csvdiff
tags: true
- provider: script
script: curl -sL https://git.io/goreleaser | bash
skip_cleanup: true
on:
branch: master
tags: true
repo: aswinkarthik/csvdiff
condition: $GORELEASER_ON = 1
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine

COPY csvdiff /csvdiff

CMD /csvdiff
7 changes: 7 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: no # [yes :: must have a base report to post]
require_head: yes # [yes :: must have a head report to post]
branches: null
15 changes: 15 additions & 0 deletions docker-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash -el

set -e

VERSION=${TRAVIS_TAG}
REPO_NAME="csvdiff"
GROUP="aswinkarthik"

docker build -t ${REPO_NAME}:${VERSION} .

docker tag ${REPO_NAME}:${VERSION} ${GROUP}/${REPO_NAME}:latest
docker tag ${REPO_NAME}:${VERSION} ${GROUP}/${REPO_NAME}:${VERSION}

docker push ${GROUP}/${REPO_NAME}:latest
docker push ${GROUP}/${REPO_NAME}:${VERSION}

0 comments on commit 74b2bed

Please sign in to comment.