Scenario
You are trying to automate the deployment process and wish to perform all the deployment steps using REST API calls only, without using the GUI.
Environment
Digital.ai Deploy, REST API
Steps to Follow
1. Prepare initial deployment
As we know, a typical deployment starts with an Initial Deployment in the Digital.ai Deploy GUI.
This is where you drag & drop your package and the environment to where you want to deploy to.
So, the first step will be to make a REST API call to prepare the initial deployment using the Environment & the Application package version:
curl -u admin:<password> -X GET "http://localhost:4516/xldeploy/deployment/prepare/initial?environment=Environments/<environment>&version=Applications/<application>/<package version>" > task.xml
It will produce the file task.xml with the contents similar to the below:
...which is saved to the task.xml file.
We will require this file in the next call.
2. Prepare Deployeds
Now we need to prepare the deployeds for our deployment.
Make the API call using the task.xml file produced in Step 1, as the payload:
curl -u admin:<password> -H "content-type:application/xml" -X POST "http://localhost:4516/deployit/deployment/prepare/deployeds" -d @task.xml > prepare.xml
It will produce the file prepare.xml with the contents similar to the below:
<deployment id="deployment-cb799c52-2567-425d-8ace-0096a9f1f81f" type="INITIAL">
3. Validate the deployment
We will now make the REST API to validate the deployment.
Make the API call using the task.xml file produced in Step 1, as the payload:
curl -u admin:<password> -H "content-type:application/xml" -X POST "http://localhost:4516/deployit/deployment/validate" -d @task.xml
The output from this call will be similar to the payload sent.
4. Initiate the deployment
This step initiates the deployment.
Make the API call using the prepare.xml file produced in Step 2, as the payload:
curl -u admin:<password> -H "content-type:application/xml" -X POST "http://localhost:4516/deployit/deployment" -d @prepare.xml
The call will produce a Deployment ID, as shown in the output below
5560e1e4-9eaf-4131-8fce-bb74f5b86798
5. Start the deployment
This step starts the deployment.
Make the API call using the Deployment ID produced in Step 4:
curl -u admin:<password> -H "content-type:application/xml" -X POST "http://localhost:4516/deployit/task/<deployment id>/start"
6. Archive the deployment
This step archives the deployment.
Make the API call using the Deployment ID produced in Step 4:
curl -u admin:<password> -H "content-type:application/xml" -X POST "http://localhost:4516/deployit/task/<deployment id>/archive"
Comments
Please sign in to leave a comment.