-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
47 lines (42 loc) · 940 Bytes
/
.gitlab-ci.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
image: "registry.gitlab.com/cyverse/ci-images/golang-linter:latest"
stages:
- format-lint
- test
- release
format:
stage: format-lint
needs: []
script:
- cd $CI_PROJECT_DIR
- gofmt -s -l -d . | tee /tmp/format_output.txt
- test $(cat /tmp/format_output.txt | wc -l) -eq 0
lint:
stage: format-lint
needs: []
script:
- cd $CI_PROJECT_DIR
- golint ./...
- ineffassign .
- misspell -error .
test:
stage: test
needs: [lint]
script:
- cd $CI_PROJECT_DIR
- go test -v -covermode=count
- make install
docker_release:
image: docker:latest
stage: release
tags:
- dind
only:
- main
services:
- docker:dind
variables:
IMAGE_NAME: registry.gitlab.com/cyverse/terraform-provider-openstack-auto-topology
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $IMAGE_NAME .
- docker push $IMAGE_NAME