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

  1. Go to the snippets page of the CICD Hands On Demo project.
  2. Open the ci-artifacts snippet and select the Copy file contents icon in the upper right corner of the file.
  3. Open your CICD Demo project from previous labs.
  4. Select your .gitlab-ci.yml file 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.
  5. In the Commit message field, type Add CI artifacts, ensure the Target Branch is set to main, and select Commit changes.

Add a main.go file

  1. Navigate to the repository of the CICD Hands On Demo project.
  2. Select the main.go file to open it.
  3. Select the Copy file contents icon in the upper right-hand corner of the file.
  4. Navigate back to the Repository page of your CICD Demo project and add a new file by selecting + > This directory > New file
  5. In the File name field, enter main.go
  6. Paste the code you copied from main.go at the beginning of line 1 of the new file.
  7. In the Commit message field, type Add main.go file, ensure the Target Branch is set to main, and select Commit changes.
  8. In the left-hand navigation pane, select CI/CD > Pipelines and select the status icon for the most recent pipeline run.
  9. When the build app job 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.

  1. In the Job artifacts panel on the right of the page, select Browse and notice that the app artifact 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)