-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_doc
More file actions
executable file
·71 lines (44 loc) · 1.41 KB
/
deploy_doc
File metadata and controls
executable file
·71 lines (44 loc) · 1.41 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
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
63
64
#!/bin/bash
### every exit != 0 fails the script
set -ue
repo=$(git rev-parse --show-toplevel)
### latest commit
COMMIT=$(git log --pretty=format:'%h' -n 1)
printf "\n"
printf " ================================================== \n"
printf " Deploy latest version of Type 3 Docs on the server \n"
printf " ================================================== \n\n"
printf ">> STEP 1: Update master branch \n\n"
git checkout master
git pull
printf "\n"
printf ">> STEP 2: Update Dockerfile \n\n"
cd $repo/Docker
./update_refreshed_at
printf "\n"
printf ">> STEP 3: Build Docker image \n\n"
./docker-build
docker images | grep -m1 dreg.cloud.sdu.dk/type3-docs/user-guide
printf "\n"
printf ">> STEP 4: Push the image to the Docker registry\n\n"
docker push dreg.cloud.sdu.dk/type3-docs/user-guide:$COMMIT
printf "\n"
printf ">> STEP 5: Commit and push to GitHub repository\n\n"
git commit -a -m "deployed new Type 3 User Guide at stage $COMMIT"
git push > /dev/null 2>&1
printf "\n"
printf ">> STEP 6: Create a new tag \n\n"
git tag doc-$COMMIT
git describe --abbrev=0 --tags
git push --tags > /dev/null 2>&1
printf "\n"
printf ">> STEP 7: Push to deployment branch \n\n"
git checkout deployment
git pull > /dev/null 2>&1
git merge master > /dev/null 2>&1
git push
git checkout master > /dev/null 2>&1
printf "\n"
printf " ===================== \n"
printf " Deployment completed! \n"
printf " ===================== \n\n"