Skip to content
Snippets Groups Projects
Commit ced0a4d6 authored by Kalin Daskalov's avatar Kalin Daskalov Committed by Lyuben Penkovski
Browse files

Remove old deployment jobs in ci and pass app version as argument in dockerfile

parent a06778ee
No related branches found
No related tags found
No related merge requests found
---
variables:
HELPERS_FILE: docker-build.yml
HELM_HELPERS_FILE: helm-package.yml
APP_HELM_NAME: policy
DOCKER_FILE: deployment/ci/Dockerfile
stages:
- compile
- test
- build
- manifest
- lint
- package
- deploy
include:
- project: "${HELPERS_PATH}"
file: "${HELPERS_FILE}"
- template: "Workflows/Branch-Pipelines.gitlab-ci.yml"
- project: 'gaiax/tsa/ci-helpers'
file: 'helm-package.yml'
before_script:
- ln -s /builds /go/src/gitlab.eclipse.org
- cd /go/src/gitlab.eclipse.org/${CI_PROJECT_PATH}
lint:
linters:
image: golangci/golangci-lint:latest
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:
- golangci-lint --version
- golangci-lint run
......@@ -37,69 +16,17 @@ lint:
unit tests:
image: golang:1.21.3
extends: .gotest
stage: test
tags:
- amd64-docker
before_script: []
script:
- go version
- go test -race ./... -coverprofile=coverage.out
- go tool cover -func=coverage.out
coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/'
govulncheck:
image: golang:1.21.3
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 ./...
amd64:
extends: .docker-build
stage: build
tags:
- amd64-docker
dockerize sync:
stage: build
tags:
- amd64-docker
script:
- cd ./cmd/sync
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t "${CI_REGISTRY_IMAGE}/sync:${CI_COMMIT_REF_NAME}" .
- docker push "${CI_REGISTRY_IMAGE}/sync:${CI_COMMIT_REF_NAME}"
only:
- main
- tags
- integration
manifest:
extends: .manifest-amd64
stage: manifest
cloud:
extends: .manifest-cloud
stage: manifest
release:
extends: .manifest-release
stage: manifest
helm-lint:
image: ${HELM_IMAGE}
extends: .helm-lint
stage: lint
tags:
- amd64-docker
helm-package:
image: ${HELM_IMAGE}
extends: .helm-package
stage: package
tags:
- amd64-docker
needs: ["helm-lint"]
......@@ -4,9 +4,11 @@ RUN apk add git
WORKDIR /go/src/gitlab.eclipse.org/eclipse/xfsc/tsa/policy
ARG APP_REPO_TAG
ADD . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X main.Version=$(git describe --tags --always)" -mod=vendor -o /tmp/policy ./cmd/policy/...
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X main.Version=$APP_REPO_TAG" -mod=vendor -o /tmp/policy ./cmd/policy/...
FROM alpine:3.17 as runner
......
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