-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.sh
executable file
·24 lines (16 loc) · 1.08 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
#!/bin/bash
if [ "$TRAVIS_BRANCH" == "master" ]; then
grunt prod
# Delete all the old files
ls prod | xargs -n1 -I % curl -X DELETE -k https://$USER:[email protected]:8000/dsa28/swingclub/%
# Deploy all the new ones to prod/
find prod -type d | xargs -n1 -I % curl -X MKCOL -k https://$USER:[email protected]:8000/dsa28/swingclub/%
find prod -type f | xargs -n1 -I % curl -X PUT -k -T % https://$USER:[email protected]:8000/dsa28/swingclub/%
# 3. Delete prod/
# NOTE: For some reason this leaves a folder called "prod/".
# Find out how to remove that.
curl -X MKCOL -k https://$USER:[email protected]:8000/dsa28/swingclub/test
ls prod -I index.html | xargs -n1 -I % curl -X MKCOL -k https://$USER:[email protected]:8000/dsa28/swingclub/%
ls prod | xargs -n1 -I % curl -X MOVE -k https://$USER:[email protected]:8000/dsa28/swingclub/prod/% --header "Destination: https://$USER:[email protected]:8000/dsa28/swingclub/%" --header "Overwrite: T"
curl -X DELETE -k https://$USER:[email protected]:8000/dsa28/swingclub/prod
fi