DEV Community

Mohammad Faisal
Mohammad Faisal

Posted on

1 1

GitLab - skip pipeline on push

If you have configured a GitLab CI/CD pipeline well then on each push to the repository result in execution of the pipeline. Sometimes it is not desirable to launch the pipeline immediately on the push or you may want to execute the pipeline using a schedule, in such case you can pass additional push option to instruct GitLab to skip the pipeline execution. To do so, the command would be:

git push -o ci.skip
Enter fullscreen mode Exit fullscreen mode

But if you are using any GUI client for git then you will not be able to pass this additional argument to the push command. In that case, you can configure the push.pushOption instead as:

git config --local --add push.pushOption ci.skip
Enter fullscreen mode Exit fullscreen mode

* Make sure to remove this configuration when you no longer want to skip the pipeline on push. To do so, use the --unset option:

git config --local --unset push.pushOption
Enter fullscreen mode Exit fullscreen mode

If you prefer git CLI over GUI then you can create alias for such case:

git config --local --add alias.skipPipeline "push -o ci.skip"
Enter fullscreen mode Exit fullscreen mode

Now you have choice:

  • to skip pipeline use command: git skipPipeline
  • normal push with pipeline execution: git push

I hope you may find this information useful. Feel free to leave your feedback/opinion in comments.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (1)

Collapse
 
faisal6621 profile image
Mohammad Faisal

There are other push options available in gitlab: docs.gitlab.com/ee/user/project/pu...

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay