Manual job for dynamic environments

4 views
Skip to first unread message

Michael Remiš

unread,
Jun 14, 2017, 9:06:50 AM6/14/17
to GitLab
Hi there,

we have several version of our application which we would like to automatically deploy to dynamic environment using Giltlab CI. But in some case we would like to run deployment "manually". The idea is that gitlab will run some jobs immediately so new environment is created. Manual job are run by user when the environment is needed and before that, environment is still listed in Pipelines/Enviromentpage but not deployed.

Scenario

1) 
 - build application in stage eg. build
 - this job produces several EARs

2) 
 - automatic job is triggered and deploys to enviroment 1

3)
 - manual job is not triggered but linked enviromnet 2 is listed in Pipelines/Enviroment
 - this job is configured as "when: manual"

But after that

A) 
  - user manually runs job from step 3, application is deployed to enviromnet 2
  - branch is merged and deleted and all "stop" jobs are triggered and all environments are stopped
  - everything works like charm

B)
  - user never run manual job
  - enviroment 2 is listed as "No deployments yet" in Pipelines/Enviroment
  - branch is merged and deleted
  - BUT stop job of manual environment is not triggered and environment 2 is still listed in Pipelines/Enviroment (the problem is that environment is not moved from Avaiable environments to Stopped in Pipelines/Enviroment page)



Any idea how to automatically clear enviroments which were never deployed?

Thanks all
Reply all
Reply to author
Forward
0 new messages