-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·43 lines (36 loc) · 854 Bytes
/
update.sh
File metadata and controls
executable file
·43 lines (36 loc) · 854 Bytes
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
#!/bin/bash
cd ~/devops
DEBIAN_FRONTEND=noninteractive
b=$(git branch | grep '^\* ' | cut -d' ' -f2)
if [[ "${b}" != "master" ]]; then
git checkout master
fi
git pull --rebase
if [[ "${b}" != "master" ]]; then
git checkout ${b}
git rebase
fi
if [[ "${1}" == "--with-docker" ]]; then
with_docker="1"
shift
fi
if [[ -n "${with_docker}" ]]; then
sudo apt-mark unhold docker-ce
fi
sudo apt-get -y update
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
sudo apt-get -y autoclean
if [[ -n "${with_docker}" ]]; then
sudo apt-mark hold docker-ce
fi
if [[ -n "$(which pip)" ]]; then
sudo pip install -U pip wheel setuptools
fi
if [[ -n "$(which docker-compose)" ]]; then
sudo pip install -U docker-compose
fi
while ((${#} > 0)); do
ssh -q ${1} ~/devops/update.sh ${with_docker:+--with-docker}
shift
done