Skip to content
Snippets Groups Projects
Commit afc214d4 authored by Kalin Daskalov's avatar Kalin Daskalov
Browse files

refactor ci file

parent 962e3fdf
No related branches found
No related tags found
1 merge request!16Update .gitlab-ci.yml to include svdh-cicd.yml and update Docker file for CI build
Pipeline #71780 passed with stages
in 2 minutes and 18 seconds
include:
- project: '${HELPERS_PATH}'
file: svdh-cicd.yml
ref: main
file: 'cicd-template.yml'
- project: '${HELPERS_PATH}'
ref: main
file: 'go-template.yml'
variables:
RUNNER_AMD: amd64-docker
DOCKER_FILE: ./deployment/ci/Dockerfile
RUNNER_TAG: amd64-docker
GO_VERSION: 1.22.4
GOLANGCI_LINT_VERSION: latest
stages:
- test
- build
- trigger-deploy
lint:
image: golangci/golangci-lint:latest
stage: test
tags:
- amd64-docker
script:
- golangci-lint --version
- golangci-lint run
before_script:
- ln -s /builds /go/src/code.vereign.com
- cd /go/src/code.vereign.com/${CI_PROJECT_PATH}
unit tests:
image: golang:${GO_VERSION}
extends: .gotest
stage: test
tags:
- amd64-docker
before_script: []
coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/'
govulncheck:
image: golang:${GO_VERSION}
stage: test
tags:
- amd64-docker
before_script:
- ln -s /builds /go/src/code.vereign.com
- cd /go/src/code.vereign.com/${CI_PROJECT_PATH}
script:
- go version
- go install golang.org/x/vuln/cmd/govulncheck@latest
- govulncheck ./...
build-dev:
extends: .docker-build-dev
stage: build
tags:
- $RUNNER_AMD
rules:
# Only run if the branch is not main, the pipeline is not triggered by a merge request and the commit is not a tag
- if: '$CI_COMMIT_BRANCH != "main" && $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_TAG == null'
build-stg:
extends: .docker-build-dev
stage: build
tags:
- $RUNNER_AMD
rules:
- if: '$CI_COMMIT_TAG'
deploy-dev:
extends: .deploy-dev
stage: trigger-deploy
needs:
- job: build-dev
rules:
# Only run if the branch is not main, the pipeline is not triggered by a merge request and the commit is not a tag
- if: '$CI_COMMIT_BRANCH != "main" && $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_TAG == null'
deploy-stg:
extends: .deploy-stg
stage: trigger-deploy
needs:
- job: build-stg
rules:
- if: '$CI_COMMIT_TAG'
\ No newline at end of file
- trigger-deploy
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment