Skip to content

Commit

Permalink
Fixup ci pipeline for different steps depending on commit or tag
Browse files Browse the repository at this point in the history
  • Loading branch information
kunickiaj committed Jan 14, 2020
1 parent 67ed2d1 commit 95da303
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@ services:

stages:
- build
- release

variables:
GORELEASER_IMAGE: goreleaser/goreleaser:latest
DOCKER_REGISTRY: https://index.docker.io/v1/

build:
image: golang
stage: build
only:
- branches
script:
- go build
- go test ./...

goreleaser:
stage: release
only:
- tags
script:
- docker pull $GORELEASER_IMAGE
- docker run --rm --privileged -v $PWD:/go/src/github.com/kunickiaj/beer -v /var/run/docker.sock:/var/run/docker.sock -w /go/src/github.com/kunickiaj/beer -e GITHUB_TOKEN -e DOCKER_USERNAME -e DOCKER_PASSWORD -e DOCKER_REGISTRY $GORELEASER_IMAGE release --rm-dist

0 comments on commit 95da303

Please sign in to comment.