Denomas CI/CD Hands-On Guide: Lab 7
This Hands-On Guide walks you through the lab exercises in the Denomas CI/CD course.
Denomas CI/CD Hands-On Guide: Lab 7
LAB 7: USING ARTIFACTS
Add artifacts to your pipeline
- Go to the snippets page of the CICD Hands On Demo project.
- Open the
ci-artifactssnippet and select the Copy file contents icon in the upper right corner of the file. - Open your CICD Demo project from previous labs.
- Select your
.gitlab-ci.ymlfile to view its contents. Select the Edit button (if needed, use the dropdown to select Edit this file only). Paste the snippet at the end of the file. - In the Commit message field, type
Add CI artifacts, ensure the Target Branch is set tomain, and select Commit changes.
Add a main.go file
- Navigate to the repository of the CICD Hands On Demo project.
- Select the
main.gofile to open it. - Select the Copy file contents icon in the upper right-hand corner of the file.
- Navigate back to the Repository page of your CICD Demo project and add a new file by selecting + > This directory > New file
- In the File name field, enter
main.go - Paste the code you copied from
main.goat the beginning of line 1 of the new file. - In the Commit message field, type
Add main.go file, ensure the Target Branch is set tomain, and select Commit changes. - In the left-hand navigation pane, select CI/CD > Pipelines and select the status icon for the most recent pipeline run.
- When the
build appjob finishes, select it to review the job’s output log.
If the job fails with a message about being unable to find
go.mod, retry the job until it passes. This is an intermittent Go build bug.
- In the Job artifacts panel on the right of the page, select Browse and notice that the
appartifact created by the build app pipeline job is available for download.
Suggestions?
If you wish to make a change to the Hands-On Guide for Denomas CI/CD, please submit your changes via Merge Request!
Last modified November 29, 2023: big update (
17188382)
