Manual Workflows in GitLab

D
1 min readMar 3, 2024

GitLab’s manual workflows offers users the control to decide when the workflow should commence. The workflow is often defined in a gitlab-ci.yml file. The simplest template looks like the following.

stages:
- deploy

git_status:
stage: deploy
script:
- echo "hello"
- ls
- pwd
- git pull origin main
- git status
when: manual
allow_failure: true
  • stages: Defines the stages in our CI/CD pipeline. In this scenario, we have a single stage named “deploy,” signifying the final phase before deployment.
  • git_status: The identifier for our job, customizable to suit our project’s needs.
  • script: Specifies the commands to be executed by GitLab upon job activation
  • when: manual: mandates manual intervention before proceeding
  • allow_failure: true: Provides leniency in the event of job failure

Once the above changes have been committed, head over to the pipelines section. Build > Pipelines and click on the “Play” button adjacent to the job.

play button clicked and pipeline ran

This should run the pipeline.

This can be used to create a release for a project or for any other manual inspecting of the project such as running a lighthouse evaluation on a reactjs project.

This article is also published in: https://dev.to/parkerrobert/manual-workflows-in-gitlab-55db

--

--

D
D

Written by D

An aspiring Robotics Researcher. I am currently in my 4th year of undergraduate studies. I am working on optimising the ROS navigation packages. Follow 4 more!

No responses yet