GitLab CI Hello World

Last update: 10 Nov 2020 [History] [Edit]

As always let’s begin with the well known simplest case..

Hello World

Create a .gitlab-ci.yml in your top-level of your repository from the previous Git and CMake tutorial and add the following

hello world:
  script: echo "Hello World"

stage this file, commit and then push to your repository. It may be worth working in a new branch, good habits!

On your repository page on GitLab you should see something similar to this

The blue symbol on the right shows the pipeline is running, click this for more details about your CI jobs. As stated before, hello world in the YAML here is the name of the job and what follows script is what the GitLab CI runner will try to run.

You can see that the pipeline completed successfully and the job ‘‘hello world’’ was run. If we click the job we can see the terminal output of the test and Hello World was echoed to the screen!

Easy, you have successfully setup and run your first GitLab CI job for your repository!