-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbitbucket-pipelines.yml
55 lines (52 loc) · 1.6 KB
/
bitbucket-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
image: golang:1.18-buster
definitions:
steps:
- step: &lint-code
caches:
- gomodcache
name: Lint code
image: golangci/golangci-lint:v1.45.2
script:
- git config --global url."[email protected]:".insteadOf https://bitbucket.org/
- GOPRIVATE=bitbucket.org/phoops golangci-lint run -v
- step: &go-test
caches:
- gomodcache
name: Application test
script:
- git config --global url."[email protected]:".insteadOf https://bitbucket.org/
- go mod download
- go test -v ./...
- step: &docker-image
size: 2x
name: Docker image
script:
- eval $(ssh-agent)
- docker login https://nexus.phoops.it/ --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
- sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
- git config --global url."[email protected]:".insteadOf https://bitbucket.org/
- git status
- go mod download
- go mod tidy
- go mod vendor
- git status
- docker build -f docker/earthquake.dockerfile . -t nexus.phoops.it/phoops/odala-mt-earthquake:${BITBUCKET_TAG}
- docker push nexus.phoops.it/phoops/odala-mt-earthquake:${BITBUCKET_TAG}
services:
- docker
caches:
gomodcache: /go
services:
docker:
memory: 4096
pipelines:
tags:
v*:
- step: *lint-code
- step: *go-test
- step: *docker-image
default:
- parallel:
- step: *lint-code
- step: *go-test