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
Commits
551569c2
Commit
551569c2
authored
7 months ago
by
Yana Kernerman
Committed by
Yana Kernerman
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
trigger pipeline
parent
c1cd8fad
No related branches found
No related tags found
1 merge request
!23
Tut01 test exercise
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
Dockerfile
+25
-0
25 additions, 0 deletions
Dockerfile
with
26 additions
and
1 deletion
.gitlab-ci.yml
+
1
−
1
View file @
551569c2
...
@@ -47,7 +47,7 @@ job_build_and_publish_image:
...
@@ -47,7 +47,7 @@ job_build_and_publish_image:
before_script
:
before_script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script
:
script
:
-
echo "Publishing artifact..."
-
echo "Publishing artifact
..."
-
ls -al
-
ls -al
-
docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
-
docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
-
docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
-
docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
0 → 100644
+
25
−
0
View file @
551569c2
## 1. Basisimage auswählen
FROM
golang:1.21
# Set the working directory inside the container
WORKDIR
/app
# Copy go.mod and go.sum files first to cache dependencies
COPY
go.mod go.sum ./
# Copy the rest of the application code
COPY
. .
RUN
go build
-o
artifact.bin ./
*
.go
# Set environment variables
ENV
HOST=0.0.0.0
# Expose the port the application runs on
EXPOSE
8080
CMD
["./artifact.bin"]
RUN
echo
'hello world'
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