Mendix Deploy API - Retrieve Branch Information

2
Hi all, I am build a Jenkins pipeline for my Mendix application. As part of this pipeline I want to check what is the latest available revision for my app. This information is available by querying the following url https://deploy.mendix.com/api/1/apps/<my-app-name>/branches/trunk The response is: { "LatestTaggedVersion": "XXXXX", "DisplayName": "Main line", "LatestRevisionMendixVersion": "XXXX", "LatestRevisionNumber": 9999, "Name": "trunk" } That is exactly what I need. However, because of reasons, we are not using the main line i.e. trunk. Instead we are using another branch called “development” (dont ask why) When I try to query https://deploy.mendix.com/api/1/apps/<my-app-name>/branches/development the server responds with a 404, not found?? I am a lost. I checked the spelling ten times it is correct. Has anyone else experienced this issue? Any idea what I am doing wrong? -Andrej
asked
2 answers
4

I think your URL is wrong. Try first https://deploy.mendix.com/api/1/apps/{1}/branches/ where {1} is your app ID.

That will give you your branches. Then you can do https://deploy.mendix.com/api/1/apps/{1}/branches/{2}/revisions/ where {1} is again your app ID and {2} is the branchname that you retrieved from the first call. Do not forget to URL encode that name.

Regards,

Ronald

[EDIT] and if you are interested I can give you my module for automatic deployment. It is in Mx6.9.1. Still plan to create an appstore module for it. Only have to find the time to finsih it.

 

answered
3

Thanks Ronald for the great answer:

After I queried my branches at
https://deploy.mendix.com/api/1/apps/<my-app-name>/branches/
It turned out the full name of the branch I was trying to query is “branches\development” instead of simply “development” as one would expect. My best guess is that Mendix adds the prefix “branches\” for some reason. This was the case for all branches except the “trunk”
Anyways after I had the correct branch name I still had to URL encode it as Ronald said. In the end the following URL worked for me

https://deploy.mendix.com/api/1/apps/<my-app-name>/branches/branches%2Fdevelopment

Notice that the seconds slash is encoded as %2F

Cheers Ronald

answered