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

Update .gitlab-ci.yml with new deployment jobs

parent 0388b071
Branches
Tags
1 merge request!11Refactor deployment
include:
- project: '${HELPERS_PATH}'
file: svdh-cicd.yml
variables: variables:
HELPERS_FILE: docker-build.yml RUNNER_AMD: amd64-docker
APP_HELM_NAME: cache APP_HELM_NAME: cache
DOCKER_FILE: deployment/ci/Dockerfile DOCKER_FILE: ./deployment/ci/Dockerfile
GO_VERSION: 1.22.3
stages: stages:
- compile
- test - test
- build - build
- manifest - trigger-deploy
- deploy
include:
- project: "${HELPERS_PATH}"
file: "${HELPERS_FILE}"
- template: "Workflows/Branch-Pipelines.gitlab-ci.yml"
lint: lint:
image: golangci/golangci-lint:v1.50.1 image: golangci/golangci-lint:v1.50.1
stage: test stage: test
...@@ -28,7 +25,7 @@ lint: ...@@ -28,7 +25,7 @@ lint:
- cd /go/src/gitlab.com/${CI_PROJECT_PATH} - cd /go/src/gitlab.com/${CI_PROJECT_PATH}
unit tests: unit tests:
image: golang:1.19.4 image: golang:${GO_VERSION}
extends: .gotest extends: .gotest
stage: test stage: test
tags: tags:
...@@ -37,7 +34,7 @@ unit tests: ...@@ -37,7 +34,7 @@ unit tests:
coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/' coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/'
govulncheck: govulncheck:
image: golang:1.19.4 image: golang:${GO_VERSION}
stage: test stage: test
tags: tags:
- amd64-docker - amd64-docker
...@@ -48,21 +45,35 @@ govulncheck: ...@@ -48,21 +45,35 @@ govulncheck:
- go version - go version
- go install golang.org/x/vuln/cmd/govulncheck@latest - go install golang.org/x/vuln/cmd/govulncheck@latest
- govulncheck ./... - govulncheck ./...
amd64: build-dev:
extends: .docker-build extends: .docker-build-dev
stage: build stage: build
tags: tags:
- amd64-docker - $RUNNER_AMD
rules:
- if: '$CI_COMMIT_BRANCH != "main" && $CI_PIPELINE_SOURCE != "merge_request_event"'
manifest: build-stg:
extends: .manifest-amd64 extends: .docker-build-dev
stage: manifest stage: build
tags:
- $RUNNER_AMD
rules:
- if: '$CI_COMMIT_TAG'
cloud: deploy-dev:
extends: .manifest-cloud extends: .deploy-dev
stage: manifest stage: trigger-deploy
needs:
- job: build-dev
rules:
- if: '$CI_COMMIT_BRANCH != "main" && $CI_PIPELINE_SOURCE != "merge_request_event"'
release: deploy-stg:
extends: .manifest-release extends: .deploy-stg
stage: manifest stage: trigger-deploy
needs:
- job: build-stg
rules:
- if: '$CI_COMMIT_TAG'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment