forked from goodrain/rainbond-ui
-
Notifications
You must be signed in to change notification settings - Fork 2
/
release.sh
executable file
·34 lines (29 loc) · 1.38 KB
/
release.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
#!/bin/bash
if [ -z "$VERSION" ]; then
if [ -z "$TRAVIS_TAG" ]; then
VERSION=$TRAVIS_BRANCH-dev
else
VERSION=$TRAVIS_TAG
fi
fi
IMAGE_DOMAIN=${IMAGE_DOMAIN:-docker.io}
IMAGE_NAMESPACE=${IMAGE_NAMESPACE:-rainbond}
IMAGE_NAME="${IMAGE_DOMAIN}/${IMAGE_NAMESPACE}/rainbond-ui:$VERSION"
BUILD_RBD_APP_UI=${BUILD_RBD_APP_UI:-true}
DOMESTIC_BASE_NAME=${DOMESTIC_BASE_NAME:-'registry.cn-hangzhou.aliyuncs.com'}
DOMESTIC_NAMESPACE=${DOMESTIC_NAMESPACE:-'goodrain'}
BASE_VERSION=V5.3
echo "$DOCKER_PASSWORD" | docker login ${IMAGE_DOMAIN} -u "$DOCKER_USERNAME" --password-stdin
docker build --build-arg VERSION="${BASE_VERSION}" --build-arg IMAGE_DOMAIN="${IMAGE_DOMAIN}" --build-arg IMAGE_NAMESPACE="${IMAGE_NAMESPACE}" -t ${IMAGE_NAME} .
docker push ${IMAGE_NAME}
if [ ${BUILD_RBD_APP_UI} == "true" ]; then
mv dist build/dist
docker build --build-arg VERSION="${VERSION}" --build-arg IMAGE_DOMAIN="${IMAGE_DOMAIN}" --build-arg IMAGE_NAMESPACE="${IMAGE_NAMESPACE}" -t "${IMAGE_DOMAIN}/${IMAGE_NAMESPACE}/rbd-app-ui:$VERSION" ./build
docker push "${IMAGE_DOMAIN}/${IMAGE_NAMESPACE}/rbd-app-ui:$VERSION"
if [ ${DOMESTIC_BASE_NAME} ]; then
newTag="${DOMESTIC_BASE_NAME}/${DOMESTIC_NAMESPACE}/rbd-app-ui:${VERSION}"
docker tag "rainbond/rbd-app-ui:$VERSION" "${newTag}"
docker login -u "$DOMESTIC_DOCKER_USERNAME" -p "$DOMESTIC_DOCKER_PASSWORD" ${DOMESTIC_BASE_NAME}
docker push "${newTag}"
fi
fi