52ffdde1ca
Removes the unnecessary docker service from the buildtools image configuration to simplify the CI pipeline setup and reduce resource usage. This change streamlines the CI process without impacting functionality.
84 lines
2.1 KiB
YAML
84 lines
2.1 KiB
YAML
include:
|
|
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
|
|
- project: unboundsoftware/ci-templates
|
|
file: Release.gitlab-ci.yml
|
|
- project: unboundsoftware/ci-templates
|
|
file: Pre-Commit-Go.gitlab-ci.yml
|
|
|
|
stages:
|
|
- build
|
|
- test
|
|
- deploy-prod
|
|
- release
|
|
|
|
variables:
|
|
UNBOUND_RELEASE_TAG_ONLY: true
|
|
|
|
.buildtools:
|
|
image: buildtool/build-tools:${BUILDTOOLS_VERSION}
|
|
|
|
check:
|
|
stage: .pre
|
|
image: golang:1.23.4@sha256:574185e5c6b9d09873f455a7c205ea0514bfd99738c5dc7750196403a44ed4b7
|
|
script:
|
|
- go install mvdan.cc/gofumpt@latest
|
|
- go install golang.org/x/tools/cmd/goimports@latest
|
|
- go generate ./...
|
|
- git diff --stat --exit-code
|
|
|
|
build:
|
|
extends: .buildtools
|
|
stage: build
|
|
script:
|
|
- build
|
|
- curl -Os https://uploader.codecov.io/latest/linux/codecov
|
|
- chmod +x codecov
|
|
- ./codecov -t ${CODECOV_TOKEN} -R $CI_PROJECT_DIR -C $CI_COMMIT_SHA -r $CI_PROJECT_PATH
|
|
- push
|
|
|
|
vulnerabilities:
|
|
stage: build
|
|
image: golang:1.23.4@sha256:574185e5c6b9d09873f455a7c205ea0514bfd99738c5dc7750196403a44ed4b7
|
|
script:
|
|
- go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
- govulncheck ./...
|
|
|
|
deploy-prod:
|
|
extends: .buildtools
|
|
stage: deploy-prod
|
|
before_script:
|
|
- echo Deploy to prod
|
|
script:
|
|
- deploy prod
|
|
rules:
|
|
- if: $CI_COMMIT_BRANCH == "main"
|
|
environment:
|
|
name: prod
|
|
|
|
check_release:
|
|
stage: test
|
|
image:
|
|
name: goreleaser/goreleaser:v2.4.8@sha256:e765952d9ed98e638a4d7755f96b29e5c746c808b54d21f04468e003800af0e3
|
|
entrypoint: [ '' ]
|
|
script: |
|
|
goreleaser check
|
|
goreleaser release --snapshot --clean
|
|
|
|
release:
|
|
stage: release
|
|
needs:
|
|
- unbound_release_prepare_release
|
|
image:
|
|
name: goreleaser/goreleaser:v2.4.8@sha256:e765952d9ed98e638a4d7755f96b29e5c746c808b54d21f04468e003800af0e3
|
|
entrypoint: [ '' ]
|
|
variables:
|
|
# Disable shallow cloning so that goreleaser can diff between tags to
|
|
# generate a changelog.
|
|
GIT_DEPTH: 0
|
|
GITLAB_TOKEN: $GITLAB_CI_TOKEN
|
|
# Only run this release job for tags, not every commit (for example).
|
|
rules:
|
|
- if: $CI_COMMIT_TAG
|
|
script: |
|
|
goreleaser release --clean --release-notes=CHANGES.md
|