forked from telerik/winforms-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
62 lines (48 loc) · 2.4 KB
/
deploy.sh
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# Get latest documentation from github
#git pull --rebase || { echo 'Getting latest documentation from github.com failed.'; exit 1; }
# Install latest Ruby gems (if any)
#bundle install --without development || { echo 'Installing Ruby gems failed.'; exit 1; }
# Build the documentation
#jekyll build || { echo 'Building the documentation with Jekyll failed.'; exit 1; }
# Copy the _site directory to \\telerik.com\resources\AppDirector\Drops\DataAccess\DataAccess.Docs
#robocopy _site //telerik.com/resources/AppDirector/Drops/Winforms/Winforms.Docs -purge -s
# Copy the api reference folder
#robocopy R:/Winforms/ApiReference //telerik.com/resources/AppDirector/Drops/Winforms/Winforms.Docs/api -purge -s
# zip -r //telerik.com/resources/AppDirector/Drops/Winforms/Winforms.Zip/Winforms.Docs/Winforms.Docs.zip //telerik.com/resources/AppDirector/Drops/Winforms/Winforms.Docs/*
VERSION="`date +%Y-%m-%d-%H-%M-%S`";
PAYLOAD="{ \"Folder\": \"//telerik.com/resources/AppDirector/Drops/Winforms/Winforms.Zip\",
\"Version\": \"$VERSION\",
\"Environment\": \"Test\",
\"RepositoryName\": \"Local\",
\"Workspace\": \"Documentation\",
\"ClientId\": \"uri:platform.cp.builds\",
\"ClientSecret\": \"3edd5acdb61db37f3ab2bd735b058911\",
\"SkipRegisterPackage\": false,
\"OverwritePackage\": false,
\"SkipDateChange\": true,
\"SkipDeployment\": false,
\"DeploymentApiUrl\": \"http://deploy.telerik.com/api/deployment/v1\",
\"RepositoryUrl\": \"http://deploy.telerik.com/api/repository/v1\",
\"TokenEndpoint\": \"https://identity.telerik.com/v2/oauth/telerik/token\",
\"PackageNameFormat\": \"package-{0}-{1}.zip\" }";
echo "posting $PAYLOAD";
curl -X POST -d "$PAYLOAD" -H "Accept: application/json" -H "Content-Type: application/json" http://deploy.telerik.com/api/deployment/v1/packages
RESULT=''
while [ "$RESULT" != "success" ]
do
if [ "$RESULT" = 'fail' ]
then
echo 'Deployment failed :(';
exit 1;
elif [ "$RESULT" = 'unknown' ]
then
echo 'Deployment failed :(';
exit 1;
else
RESULT=$(curl -s http://deploy.telerik.com/api/deployment/v1/workspaces/Documentation/stacks/WinForms.Docs/environments/Test/status)
echo "Deployment in progress, current status: $RESULT"
sleep 2
fi
done
echo 'Deployment passed :)'