GitLab CI Starting a job manually (deployment)

Is it possible to mark gitlab ci jobs to run manually?

I need this to deploy the application, but I want to decide whether it will be deployed

+7
gitlab continuous-deployment continuous-delivery gitlab-ci gitlab-ci-runner
source share
2 answers

This has changed since the first answer was posted. Here is a link to the original Gitlab Issue . Now it supports something like

production: stage: deploy script: run-deployment $OMNIBUS_GITLAB_PACKAGE environment: production when: manual 

Note the when: manual attribute. The user interface is updated to provide users with the ability to run tasks.

+7
source share

Manually entered assembly steps are not directly supported by afaik. But it should be possible to achieve similar behavior using ci triggers .

 build_package: stage: build script: - make build upload_package: stage: package script: - if [ -n "${UPLOAD_TO_S3}" ]; then make upload; fi 

You can then invoke the rebuild by executing a POST request and passing the configured variable.

 curl -X POST \ -F token=TOKEN \ -F ref=master \ -F "variables[UPLOAD_TO_S3]=true" \ https://gitlab.example.com/api/v3/projects/9/trigger/builds 

If you have your own gitlab instance, it should be possible to enter a javascript button in every merge request that will cause curl.

+2
source share

All Articles