forked from meolu/walle-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcibot
92 lines (78 loc) · 1.47 KB
/
cibot
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
#!/usr/bin/env bash
#
# 发布镜像脚本
#
version='release-v1.0.0'
# cwd
cwd=$(pwd)
#
# Set Colors
#
bold=$(tput bold)
underline=$(tput sgr 0 1)
reset=$(tput sgr0)
red=$(tput setaf 1)
green=$(tput setaf 76)
white=$(tput setaf 7)
tan=$(tput setaf 202)
blue=$(tput setaf 25)
#
# Headers and Logging
#
info() {
printf "${white}➜ %s${reset}\n" "$@"
}
success() {
printf "${green}✔ %s${reset}\n" "$@"
}
error() {
printf "${red}✖ %s${reset}\n" "$@"
}
warn() {
printf "${tan}➜ %s${reset}\n" "$@"
}
goBack(){
cd ${cwd}
}
buildUi(){
goBack
cd fe
walleUi="walle-ui:${version}"
info "开始构建:${walleUi}"
docker build --tag walle/${walleUi} .
success "开始上传:${walleUi}"
docker push walle/${walleUi}
success "上传成功:${walleUi}"
}
buildApiServer(){
goBack
walleApi="walle-api:${version}"
info "开始构建:${walleApi}"
docker build --tag walle/${walleApi} .
success "开始上传:${walleApi}"
docker push walle/${walleApi}
success "上传成功:${walleApi}"
}
buildGateway(){
goBack
cd gateway
walleGateway="walle-gateway:${version}"
info "开始构建:${walleGateway}"
docker build --tag "walle/${walleGateway}" .
success "开始上传:${walleGateway}"
docker push walle/${walleGateway}
success "上传成功:${walleGateway}"
}
buildImage(){
buildUi
buildApiServer
buildGateway
}
bootstrap(){
info "开始构建"
h1 "请输入仓库密码:"
docker login [email protected]
buildImage
success '构建成功'
}
bootstrap