-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.sh
More file actions
99 lines (77 loc) · 1.69 KB
/
sync.sh
File metadata and controls
99 lines (77 loc) · 1.69 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
declare -a gbulid=("ffmpeg-snapshot-alpine" "node-pm2-alpine" "novnc-ubuntu" "icecast-alpine" "php-alpine" "php-v8-alpine")
whatuse="all"
tabel_point="ffmpeg-snapshot-alpine,node-pm2-alpine,novnc-ubuntu,icecast-alpine,php-alpine"
echo "Let's build :)"
gonline="no"
cekif(){
if [[ "all" == *"$whatuse"* ]]; then
whatuse=$tabel_point
fi
}
bulid()
{
cekif
echo "Start build..."
for i in "${gbulid[@]}";
do
if [[ $whatuse == *"$i"* ]]; then
echo "$i...."
cd "$i" || exit;
docker build -t "repo.volcanoyt.com/base_$i" -f Dockerfile .
cd ..
if [[ $gonline == *"yes"* ]]; then
echo "Start push to our server"
docker push repo.volcanoyt.com/base_"$i"
fi
else
echo "Skip $i"
fi
done
}
tes()
{
echo "Start Tes Mode..."
for i in "${gbulid[@]}";
do
if [[ $whatuse == *"$i"* ]]; then
bulid
if [[ $whatuse == *"novnc-alpine"* ]]; then
docker run --rm -it -p 5901:5901/tcp -p 6080:6080/tcp repo.volcanoyt.com/base_novnc-alpine:latest
fi
if [[ $whatuse == *"novnc-ubuntu"* ]]; then
docker run --rm -it -p 5901:5901/tcp -p 6080:6080/tcp repo.volcanoyt.com/base_novnc-ubuntu:latest
fi
else
echo "Skip $i"
fi
done
}
push()
{
cekif
echo "Start push..."
for i in "${gbulid[@]}";
do
if [[ $whatuse == *"$i"* ]]; then
echo "$i...."
docker push repo.volcanoyt.com/base_"$i"
else
echo "Skip $i"
fi
done
}
if [ $# -eq 0 ]; then
echo "Type build like bash run.sh bulid etc,etc,etc"
else
tmpuse="$2"
if [ -n "$tmpuse" ]
then
whatuse="$tmpuse"
fi
gonline="$3"
case $1 in bulid|push|tes)
$1
;;
esac
fi