Building And Deploying Convertigo projects in DevOps CI
DevOps and Continuous integration (CI) are now widely used in Enterprises. This post shows how to build and automate deployments of Convertigo Projects to run-time Convertigo servers for testing or production.
Building a Convertigo .CAR file
Convertigo .CAR files are just a ZIP of a Convertigo project directory. To automate the build a .CAR file:
- Get from your GIT repository the project to build (git clone https://my.git.repo/myproject)
- ZIP the directory (zip myproject)
- Rename the .ZIP file as myproject.car. Be sure to name the .CAR file the same name that the XML file present in the root of the project directory. eg: myproject.car
Deploying .CAR file to Convertigo servers
Once the projects are built, you can deploy them to Convertigo servers. You can automate this by using the cURL script tool:
- First you must login to the admin service:
$ curl 'http://<server:port>/convertigo/admin/services/services/engine.Authenticate' --data 'authUserName=<admin_user_name>&authPassword=<admin_password>&authType=login' -c cookies.txt
- Then deploy the .CAR to the Convertigo Server
$ curl 'http://<server:port>/convertigo/admin/services/projects.Deploy?bAssembleXsl=false' -b cookies.txt -F "file=@./myproject.car;filename=myproject.car"
The Server will respond:
<?xml version="1.0" encoding="UTF-8"?>
<message>The project 'myproject' has been successfully deployed.</message>
The project will be deployed on the server and will be immediately ready for use. You can use these automated commands to deploy .CAR files to multiple Convertigo server instances by varying the <server:port> values
These command lines can be inserted in any CI tools such as Travis, CircleCI or Jenkins or any other tool able to execute bash comands.