ci-includes-yml/pipelines/golang.yml

84 lines
1.8 KiB
YAML
Raw Normal View History

2023-05-21 08:21:45 -05:00
stages:
- build
- package
2024-05-05 08:37:35 -05:00
- validate
2023-05-21 08:21:45 -05:00
- publish
include:
2024-05-05 09:01:46 -05:00
- template: Security/Secret-Detection.gitlab-ci.yml
2023-05-21 08:21:45 -05:00
- project: 'developerdurp/yml'
ref: 'main'
2023-05-21 08:21:45 -05:00
file:
2023-11-25 08:19:34 -06:00
- 'jobs/octopus.yml'
2023-05-21 08:21:45 -05:00
- 'jobs/version.yml'
- 'jobs/sonarqube.yml'
2023-05-21 08:44:36 -05:00
- 'jobs/golang.yml'
2023-05-21 08:21:45 -05:00
- 'jobs/docker.yml'
2024-05-05 09:00:23 -05:00
secret_detection:
stage: compliance
rules:
- if: $CI_MERGE_REQUEST_IID
allow_failure: false
sonarqube:
extends: .sonarcloud-check
stage: compliance
allow_failure: true
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/' || $CI_MERGE_REQUEST_IID
exists:
- "sonar-project.properties"
golang-lint:
extends: .golang-lint
stage: compliance
rules:
- if: $CI_MERGE_REQUEST_IID
exists:
- "go.mod"
2023-05-21 08:21:45 -05:00
version:
extends: .version
stage: .pre
2023-05-21 11:23:03 -05:00
rules:
2024-05-05 09:00:23 -05:00
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/'
2023-05-21 08:21:45 -05:00
2023-05-21 08:41:53 -05:00
gobuild:
2023-08-19 20:47:53 +00:00
variables:
GOPROXY: https://nexus.durp.info/repository/go/
2024-03-31 10:02:00 -05:00
extends: .golang-build
2023-05-21 08:41:53 -05:00
stage: build
2024-05-05 09:00:23 -05:00
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/'
exists:
- "go.mod"
2023-05-21 08:21:45 -05:00
2024-05-05 08:37:35 -05:00
docker-build:
extends: .docker_build
stage: build
2023-05-21 08:41:53 -05:00
needs:
- job: gobuild
2023-05-21 08:58:44 -05:00
artifacts: true
- job: version
2024-05-05 08:37:35 -05:00
optional: true
2023-05-21 08:58:44 -05:00
artifacts: true
rules:
2024-05-05 09:00:23 -05:00
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/'
exists:
2024-05-05 08:37:35 -05:00
- "Dockerfile"
2023-05-21 08:21:45 -05:00
2024-05-05 08:52:27 -05:00
docker-push:
2024-05-05 08:37:35 -05:00
extends: .docker_push_gitlab
2023-11-25 08:19:34 -06:00
stage: publish
2024-05-05 08:37:35 -05:00
needs:
- job: gobuild
2023-11-25 08:19:34 -06:00
artifacts: true
2024-05-05 08:37:35 -05:00
- job: version
artifacts: true
2023-11-25 08:19:34 -06:00
rules:
2024-05-05 09:00:23 -05:00
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ '/^release/'
2023-11-25 08:19:34 -06:00
exists:
2024-05-05 08:37:35 -05:00
- "Dockerfile"