Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
webservice
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DevOps (Lecture FB VI)
webservice
Merge requests
!26
Tut01
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Tut01
s92604/devops-webservice:tut01
into
main
Overview
0
Commits
32
Pipelines
4
Changes
2
Closed
Yana Kernerman
requested to merge
s92604/devops-webservice:tut01
into
main
4 months ago
Overview
0
Commits
32
Pipelines
4
Changes
2
Expand
Merge request reports
Compare
main
version 1
383bd3d7
4 months ago
main (base)
and
latest version
latest version
1cfb24e4
32 commits,
4 months ago
version 1
383bd3d7
36 commits,
4 months ago
2 files
+
74
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
.gitlab-ci.yml
+
49
−
7
Options
workflow
:
rules
:
-
if
:
>-
$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"
when
:
'
always'
-
when
:
'
never'
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push"
when
:
always
-
when
:
never
stages
:
-
test
-
build
-
publish
job_trigger-pipeline
:
trigger
:
project
:
'
fb6-wp11-devops/webservice-build-and-publish'
job_test_the_code
:
stage
:
test
image
:
registry.hub.docker.com/library/golang:1.21
script
:
-
go get -t ./...
-
go test -race -v ./...
rules
:
-
when
:
always
# Dieser Job läuft immer, unabhängig vom Branch oder Event.
job_build_artifact
:
stage
:
build
image
:
registry.hub.docker.com/library/golang:1.21
script
:
-
go get -t ./...
-
go build -o ./artifact.bin ./*.go
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"
when
:
always
# Build-Job läuft nur bei Push auf `main`.
artifacts
:
paths
:
-
./artifact.bin
expire_in
:
1 week
job_publish_artifact
:
stage
:
publish
image
:
curlimages/curl:latest
tags
:
-
docker-privileged
dependencies
:
-
job_build_artifact
script
:
-
echo "Publishing artifact..."
-
env
-
curl --version
-
|
curl \
--header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
--upload-file ./artifact.bin \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/artifacts/1.0.0/webservice"
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"
when
:
always
# Publish-Job läuft nur bei Push auf `main
Loading