-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·30 lines (23 loc) · 1.24 KB
/
build.sh
File metadata and controls
executable file
·30 lines (23 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
. ./env.sh
echo "### Getting Latest Revision for " $AppID
getLatestRevUrl="${baseUrl}/api/1/apps/${AppID}/branches/trunk"
echo curl -X GET $getLatestRevUrl -H "Mendix-Username: ${mendixUserName}" -H "Mendix-Apikey: ${mendixApiKey}"
echo "Latest Revision Results below "
#curl -X GET $getLatestRevUrl -H "Mendix-Username: ${mendixUserName}" -H "Mendix-Apikey: ${mendixApiKey}"
latestRevNumber=`curl -X GET $getLatestRevUrl -H "Mendix-Username: ${mendixUserName}" -H "Mendix-Apikey: ${mendixApiKey}" | jq -r '.LatestRevisionNumber'`
echo $latestRevNumber
echo "Building " $baseUrl $AppID $latestRevNumber
#Triggers the build and get the package Id
export packageId=`curl -X POST ${baseUrl}/api/1/apps/${AppID}/packages \
-H "Content-Type: application/json" \
-H "Mendix-Username: ${mendixUserName}" \
-H "Mendix-Apikey: ${mendixApiKey}" \
-d '{"Branch": "trunk","Version": "0.0.'${latestRevNumber}'","Revision": "'${latestRevNumber}'", "Description" : "Git Automated build"}' \
| jq -r '.PackageId'`
echo "packageId is " $packageId
echo "Length of packageId is : " ${#packageId}
mkdir output
echo "export packageId=${packageId}" > output/setPackageId.sh
chmod +x output/setPackageId.sh
echo "created artifact output/setPackageId.sh"
cat output/setPackageId.sh