DEV Community

d
d

Posted on

Manual Workflows in GitLab

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.

Image description


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://parkerrobert.medium.com/manual-workflows-in-gitlab-d6addb70d389

Top comments (0)