-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
33 lines (23 loc) · 838 Bytes
/
build.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
#!/bin/sh
tag="$(date +%Y%m%d%H%M%S)"
if [[ $1 ]]; then
tag=$1
fi
imageName='xlgg-assets-push'
if [[ $2 ]]; then
echo $2
imageName="$imageName-$2"
fi
echo $imageName
# daocloudImage='daocloud.io/baidao/'${imageName}':'${tag}
aliImage='registry.cn-shanghai.aliyuncs.com/ytx-zq/'${imageName}':'${tag}
aliImage1='registry.cn-shanghai.aliyuncs.com/ytx-zq/'${imageName}':latest'
# docker login -p ${DAOCLOUD_PASSWORD} -u ${DAOCLOUD_USERNAME} -e developer@baidao.com daocloud.io
docker login -p ${ALIYUN_PASSWORD} -u ${ALIYUN_USERNAME} -e developer@baidao.com registry.cn-shanghai.aliyuncs.com
docker build -t ${imageName} .
# docker tag -f ${imageName} ${daocloudImage}
# docker push ${daocloudImage}
docker tag -f ${imageName} ${aliImage}
docker push ${aliImage}
docker tag -f ${imageName} ${aliImage1}
docker push ${aliImage1}