Retrieve the status of environment if any deployment is in progress

0
Hi Team, I have  implemented CICD pipeline for Mendix application using groovy script. One requirement to check whether two different deployments are in-progress of same application id or not. If any developer has started the deployment process, so other developer trying to deploy on same environment should not be allowed until 1st deployment job completes. Basically we are trying to avoid parallel execution of one CICD pipeline. Thanks!!  
asked
2 answers
1

You could try looking into the DeployAPI of the Cloud Portal, to see if a combination of calls can do what you are looking for.

Two calls that look promising to your use case are:

  • Retrieve environment – can check the status if it is running (not running could be an indication that another deployment is happening)
  • Get Start status – check whether the environment can be started. A 500 response could indicate that the environment is locked because another deployment is happening.

 

Hope this helps!

answered
0

From Deploy API

  1. Retrieve app with app ID
  2. Retrieve environment with App ID and Mode
  3. Retrieve environment package
    1. you must understand if different packages are deployed
    2. If yes, then you must queue it probably
  4. Check for BackupUp API’s and take a Backup
  5. Then you can use Start API, Start Status etc

 

For detailed approach  read https://docs.mendix.com/howto/integration/implement-cicd-pipeline

answered