2019-05-31 13:27:00 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e # fail on any error
|
|
|
|
|
|
|
|
VERSION=$(cat ./tools/VERSION)
|
2019-06-14 13:00:57 +02:00
|
|
|
TRACK=$(cat ./tools/TRACK)
|
2020-03-25 17:16:51 +01:00
|
|
|
echo "OpenEthereum version = ${VERSION}"
|
|
|
|
echo "OpenEthereum track = ${TRACK}"
|
2019-05-31 13:27:00 +02:00
|
|
|
|
2020-03-25 17:16:51 +01:00
|
|
|
test "$Docker_Hub_User_OpenEthereum" -a "$Docker_Hub_Pass_OpenEthereum" \
|
2019-05-31 13:27:00 +02:00
|
|
|
|| ( echo "no docker credentials provided"; exit 1 )
|
2020-03-25 17:16:51 +01:00
|
|
|
docker login -u "$Docker_Hub_User_OpenEthereum" -p "$Docker_Hub_Pass_OpenEthereum"
|
2019-05-31 13:27:00 +02:00
|
|
|
echo "__________Docker info__________"
|
|
|
|
docker info
|
|
|
|
|
|
|
|
# we stopped pushing nightlies to dockerhub, will push to own registry prb.
|
|
|
|
case "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" in
|
|
|
|
"$SCHEDULE_TAG")
|
2020-03-25 17:16:51 +01:00
|
|
|
echo "Docker TAG - 'openethereum/openethereum:${SCHEDULE_TAG}'";
|
2019-05-31 13:27:00 +02:00
|
|
|
docker build --no-cache \
|
|
|
|
--build-arg VCS_REF="${CI_COMMIT_SHA}" \
|
|
|
|
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \
|
2020-03-25 17:16:51 +01:00
|
|
|
--tag "openethereum/openethereum:${SCHEDULE_TAG}" \
|
2019-05-31 13:27:00 +02:00
|
|
|
--file tools/Dockerfile .;
|
2020-03-25 17:16:51 +01:00
|
|
|
docker push "openethereum/openethereum:${SCHEDULE_TAG}";;
|
2019-05-31 13:27:00 +02:00
|
|
|
"stable")
|
2020-03-25 17:16:51 +01:00
|
|
|
echo "Docker TAGs - 'openethereum/openethereum:${VERSION}-${CI_COMMIT_REF_NAME}', 'openethereum/openethereum:stable'";
|
2019-05-31 13:27:00 +02:00
|
|
|
docker build --no-cache \
|
|
|
|
--build-arg VCS_REF="${CI_COMMIT_SHA}" \
|
|
|
|
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \
|
2020-03-25 17:16:51 +01:00
|
|
|
--tag "openethereum/openethereum:${VERSION}-${CI_COMMIT_REF_NAME}" \
|
|
|
|
--tag "openethereum/openethereum:latest" \
|
|
|
|
--tag "openethereum/openethereum:stable" \
|
2019-05-31 13:27:00 +02:00
|
|
|
--file tools/Dockerfile .;
|
2020-03-25 17:16:51 +01:00
|
|
|
docker push "openethereum/openethereum:${VERSION}-${CI_COMMIT_REF_NAME}";
|
|
|
|
docker push "openethereum/openethereum:stable";
|
|
|
|
docker push "openethereum/openethereum:latest";;
|
2019-06-14 13:00:57 +02:00
|
|
|
v[0-9]*.[0-9]*)
|
2020-03-25 17:16:51 +01:00
|
|
|
echo "Docker TAG - 'openethereum/openethereum:${VERSION}-${TRACK}'"
|
2019-06-14 13:00:57 +02:00
|
|
|
docker build --no-cache \
|
|
|
|
--build-arg VCS_REF="${CI_COMMIT_SHA}" \
|
|
|
|
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \
|
2020-03-25 17:16:51 +01:00
|
|
|
--tag "openethereum/openethereum:${VERSION}-${TRACK}" \
|
2019-06-14 13:00:57 +02:00
|
|
|
--file tools/Dockerfile .;
|
2020-03-25 17:16:51 +01:00
|
|
|
docker push "openethereum/openethereum:${VERSION}-${TRACK}";;
|
2019-05-31 13:27:00 +02:00
|
|
|
*)
|
2020-03-25 17:16:51 +01:00
|
|
|
echo "Docker TAG - 'openethereum/openethereum:${VERSION}-${CI_COMMIT_REF_NAME}'"
|
2019-05-31 13:27:00 +02:00
|
|
|
docker build --no-cache \
|
|
|
|
--build-arg VCS_REF="${CI_COMMIT_SHA}" \
|
|
|
|
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \
|
2020-03-25 17:16:51 +01:00
|
|
|
--tag "openethereum/openethereum:${VERSION}-${CI_COMMIT_REF_NAME}" \
|
2019-05-31 13:27:00 +02:00
|
|
|
--file tools/Dockerfile .;
|
2020-03-25 17:16:51 +01:00
|
|
|
docker push "openethereum/openethereum:${VERSION}-${CI_COMMIT_REF_NAME}";;
|
2019-05-31 13:27:00 +02:00
|
|
|
esac
|
|
|
|
|
|
|
|
docker logout
|