-
Notifications
You must be signed in to change notification settings - Fork 3
/
run.sh
executable file
·52 lines (42 loc) · 918 Bytes
/
run.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
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
BASEDIR=`dirname "$0"`
FULLPATH=`cd "$BASEDIR"; pwd`
cd $FULLPATH
function pull() {
docker run --rm \
-v $FULLPATH/root:/root \
-v $FULLPATH:/app \
tagplus5/ubuntu-ppa git pull
}
function checkVersion() {
NEWVERSION=`docker run --rm -v $FULLPATH:/app tagplus5/ubuntu-ppa bash update.sh`
}
function updatePPA() {
docker run --rm \
-v $FULLPATH/root:/root \
-v $FULLPATH:/app \
tagplus5/ubuntu-ppa bash updatePPA.sh
}
function commit() {
docker run --rm \
-v $FULLPATH/root:/root \
-v $FULLPATH:/app \
tagplus5/ubuntu-ppa git add --all
docker run --rm \
-v $FULLPATH/root:/root \
-v $FULLPATH:/app \
tagplus5/ubuntu-ppa git commit -a -m 'update'
}
function push() {
docker run --rm \
-v $FULLPATH/root:/root \
-v $FULLPATH:/app \
tagplus5/ubuntu-ppa git push -q origin master
}
pull
checkVersion
if [ $NEWVERSION = 1 ]; then
updatePPA
commit
push
fi