Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
task
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaia-X
Trust Services API
task
Commits
f3fa75f3
Commit
f3fa75f3
authored
11 months ago
by
Kalin Daskalov
Browse files
Options
Downloads
Patches
Plain Diff
chore: Update .gitlab-ci.yml and Dockerfile for CI/CD improvements
parent
74a123de
No related branches found
No related tags found
1 merge request
!18
chore: Update .gitlab-ci.yml and Dockerfile for CI/CD improvements
Pipeline
#71734
failed
11 months ago
Stage: test
Stage: build
Stage: trigger-deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+42
-30
42 additions, 30 deletions
.gitlab-ci.yml
deployment/ci/Dockerfile
+2
-2
2 additions, 2 deletions
deployment/ci/Dockerfile
with
44 additions
and
32 deletions
.gitlab-ci.yml
+
42
−
30
View file @
f3fa75f3
include
:
-
project
:
'
${HELPERS_PATH}'
file
:
svdh-cicd.yml
variables
:
variables
:
HELPERS_FILE
:
docker-build.yml
RUNNER_AMD
:
amd64-docker
APP_HELM_NAME
:
task
DOCKER_FILE
:
./deployment/ci/Dockerfile
DOCKER_FILE
:
deployment/ci/Dockerfile
GO_VERSION
:
1.22.4
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
tags
:
tags
:
-
amd64-docker
-
amd64-docker
before_script
:
-
ln -s /builds /go/src/gitlab.com
-
cd /go/src/gitlab.com/${CI_PROJECT_PATH}
script
:
script
:
-
go version
-
golangci-lint --version
-
golangci-lint --version
-
golangci-lint run
-
golangci-lint run
before_script
:
-
ln -s /builds /go/src/gitlab.com
-
cd /go/src/gitlab.com/${CI_PROJECT_PATH}
unit tests
:
unit tests
:
image
:
golang:
1.19.3
image
:
golang:
${GO_VERSION}
extends
:
.gotest
extends
:
.gotest
stage
:
test
stage
:
test
tags
:
tags
:
...
@@ -38,7 +33,7 @@ unit tests:
...
@@ -38,7 +33,7 @@ unit tests:
coverage
:
'
/total:\s+\(statements\)\s+(\d+.\d+\%)/'
coverage
:
'
/total:\s+\(statements\)\s+(\d+.\d+\%)/'
govulncheck
:
govulncheck
:
image
:
golang:
1.19.3
image
:
golang:
${GO_VERSION}
stage
:
test
stage
:
test
tags
:
tags
:
-
amd64-docker
-
amd64-docker
...
@@ -50,20 +45,37 @@ govulncheck:
...
@@ -50,20 +45,37 @@ govulncheck:
-
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
:
# 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'
manifest
:
deploy-dev
:
extends
:
.manifest-amd64
extends
:
.deploy-dev
stage
:
manifest
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'
cloud
:
extends
:
.manifest-cloud
stage
:
manifest
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
This diff is collapsed.
Click to expand it.
deployment/ci/Dockerfile
+
2
−
2
View file @
f3fa75f3
...
@@ -4,11 +4,11 @@ RUN apk add git
...
@@ -4,11 +4,11 @@ RUN apk add git
WORKDIR
/go/src/gitlab.eclipse.org/eclipse/xfsc/tsa/task
WORKDIR
/go/src/gitlab.eclipse.org/eclipse/xfsc/tsa/task
ARG
APP_
REPO_TAG
ARG
APP_
VER
ADD
. .
ADD
. .
RUN
CGO_ENABLED
=
0
GOOS
=
linux go build
-ldflags
=
"-X main.Version=
$APP_
REPO_TAG
"
-mod
=
vendor
-o
/tmp/task ./cmd/task/...
RUN
CGO_ENABLED
=
0
GOOS
=
linux go build
-ldflags
=
"-X main.Version=
$APP_
VER
"
-mod
=
vendor
-o
/tmp/task ./cmd/task/...
FROM
alpine:3.17
as
runner
FROM
alpine:3.17
as
runner
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment