Skip to content

Trigger the Pipeline

Our pipeline will only trigger when we git push changes to *.go files. Let's give this a try.

The Change

We don't want to change any code at this point in time, especially given we don't have any tests yet, but we can make the same change to our application as we did the Terraform: add a simple comment and then remove it again.

  1. Open up the main.go file for editing
  2. At the top simply add a comment: // testing pipeline
  3. Now use git commit -m 'triggering pipeline' main.go to add the changes to the repository
  4. Use git push to send the changes to the GitLab repository (the remote)

Now we'll see under CI/CD -> Pipelines in the GitLab UI that the pipeline has executed because it's seen a change to a *.go file.

Exercises

  • Undo the change we just made to the main.go file and push them to the remote repository

Next

Now that we're built our infrastructure and application package, we can build and run our Ansible pipeline to push the application to the AWS infrastructure and make it go live.