forked from telerik/xaml-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy_SL.sh
43 lines (31 loc) · 1.98 KB
/
deploy_SL.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
#!/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 --config _config.yml,_silverlight.yml || { echo 'Building the documentation with Jekyll failed.'; exit 1; }
# Copy the _site directory to \\telerik.com\resources\AppDirector\Drops\DataAccess\DataAccess.Docs
#robocopy _site_SL //telerik.com/resources/AppDirector/Drops/XAML/Silverlight/Silverlight.Docs -purge -s
VERSION="1.0.`date +%s`";
PAYLOAD="{ \"Folder\": \"//telerik.com/resources/AppDirector/Drops/XAML/Silverlight.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/Silverlight.Docs/environments/Test/status)
echo "Deployment in progress, current status: $RESULT"
sleep 2
fi
done
echo 'Deployment passed :)'