-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathrelease.sh
22 lines (18 loc) · 902 Bytes
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
IMAGE_DOMAIN=${IMAGE_DOMAIN:-'docker.io'}
IMAGE_NAMESPACE=${IMAGE_NAMESPACE:-'rainbond'}
DOMESTIC_BASE_NAME=${DOMESTIC_BASE_NAME:-'registry.cn-hangzhou.aliyuncs.com'}
DOMESTIC_NAMESPACE=${DOMESTIC_NAMESPACE:-'goodrain'}
ARCH=${BUILD_ARCH:-'amd64'}
imageName=${IMAGE_DOMAIN}/${IMAGE_NAMESPACE}/rainbond-operator:${VERSION}
docker build --build-arg ARCH="${ARCH}" -t "${imageName}" -f Dockerfile .
if [ "$DOCKER_USERNAME" ]; then
echo "$DOCKER_PASSWORD" | docker login ${IMAGE_DOMAIN} -u "$DOCKER_USERNAME" --password-stdin
docker push "${imageName}"
fi
if [ "$DOMESTIC_DOCKER_USERNAME" ]; then
domestcName=${DOMESTIC_BASE_NAME}/${DOMESTIC_NAMESPACE}/rainbond-operator:${VERSION}
docker tag "${imageName}" "${domestcName}"
echo "${DOMESTIC_DOCKER_PASSWORD}"|docker login -u "${DOMESTIC_DOCKER_USERNAME}" "${DOMESTIC_BASE_NAME}" --password-stdin
docker push "${domestcName}"
fi