Less docker/qloud in release.sh

This commit is contained in:
Ivan Blinkov 2020-02-14 13:28:19 +03:00
parent 5dc6483807
commit bcb1ff68bb

View File

@ -4,7 +4,6 @@ set -ex
BASE_DIR=$(dirname $(readlink -f $0)) BASE_DIR=$(dirname $(readlink -f $0))
BUILD_DIR="${BASE_DIR}/../build" BUILD_DIR="${BASE_DIR}/../build"
PUBLISH_DIR="${BASE_DIR}/../publish" PUBLISH_DIR="${BASE_DIR}/../publish"
IMAGE="clickhouse/website"
GIT_TEST_URI="git@github.com:ClickHouse/clickhouse-test.github.io.git" GIT_TEST_URI="git@github.com:ClickHouse/clickhouse-test.github.io.git"
GIT_PROD_URI="git@github.com:ClickHouse/clickhouse.github.io.git" GIT_PROD_URI="git@github.com:ClickHouse/clickhouse.github.io.git"
@ -14,8 +13,6 @@ then
else else
TAG="$1" TAG="$1"
fi fi
FULL_NAME="${IMAGE}:${TAG}"
REMOTE_NAME="registry.yandex.net/${FULL_NAME}"
DOCKER_HASH="$2" DOCKER_HASH="$2"
if [[ -z "$1" ]] if [[ -z "$1" ]]
then then
@ -37,10 +34,7 @@ then
git commit -a -m "add new release at $(date)" git commit -a -m "add new release at $(date)"
git push origin master git push origin master
cd "${BUILD_DIR}" cd "${BUILD_DIR}"
docker build -t "${FULL_NAME}" "${BUILD_DIR}" DOCKER_HASH=$(head -c 16 < /dev/urandom | xxd -p)
docker tag "${FULL_NAME}" "${REMOTE_NAME}"
DOCKER_HASH=$(docker push "${REMOTE_NAME}" | tail -1 | awk '{print $3;}')
docker rmi "${FULL_NAME}"
else else
rm -rf "${BUILD_DIR}" || true rm -rf "${BUILD_DIR}" || true
rm -rf "${PUBLISH_DIR}" || true rm -rf "${PUBLISH_DIR}" || true
@ -67,8 +61,4 @@ then
else else
QLOUD_ENV="${QLOUD_PROJECT}.prod" QLOUD_ENV="${QLOUD_PROJECT}.prod"
fi fi
QLOUD_COMPONENT="${QLOUD_ENV}.nginx"
QLOUD_VERSION=$(curl -v -H "Authorization: OAuth ${QLOUD_TOKEN}" "${QLOUD_ENDPOINT}/environment/status/${QLOUD_ENV}" | python -c "import json; import sys; print json.loads(sys.stdin.read()).get('version')")
curl -v -H "Authorization: OAuth ${QLOUD_TOKEN}" -H "Content-Type: application/json" --data "{\"repository\": \"${REMOTE_NAME}\", \"hash\": \"${DOCKER_HASH}\"}" "${QLOUD_ENDPOINT}/component/${QLOUD_COMPONENT}/${QLOUD_VERSION}/deploy" > /dev/null
echo ">>> Successfully deployed ${TAG} ${DOCKER_HASH} to ${QLOUD_ENV} <<<" echo ">>> Successfully deployed ${TAG} ${DOCKER_HASH} to ${QLOUD_ENV} <<<"