-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwaiwai.sh
More file actions
executable file
·22 lines (17 loc) · 839 Bytes
/
waiwai.sh
File metadata and controls
executable file
·22 lines (17 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#/bin/bash -i
set -e
if [ $# -eq 1 ]
then
branch=$1
else
branch=master
fi
#for i in 1 2 3; do ssh isu$i -- "git fetch origin $branch && git checkout $branch && git pull origin $branch"; done
for i in 1 2 3; do ssh isu$i -- "git fetch origin $branch"; done
for i in 1 2 3; do ssh isu$i -- "git checkout $branch 2>/dev/null || git checkout -b $branch"; done
for i in 1 2 3; do ssh isu$i -- "git reset --hard origin/$branch"; done
echo "----------pull $branch complete.----------"
for i in 1 2 3; do echo "- isu$i build..."; ssh isu$i -- "source ~/bashrc2 && cd ~/webapp/go; go build"; done
for i in 1 2 3; do ssh isu$i -- "sudo systemctl stop isucondition.go.service"; done
for i in 1 2 3; do ssh isu$i -- "sudo systemctl start isucondition.go.service"; done
for i in 1 2 3; do ssh isu$i -- "sudo systemctl restart nginx"; done