2018-08-26 00:44:08 +02:00
|
|
|
#!/bin/bash
|
|
|
|
##ARGUMENTS: 1. Docker target
|
|
|
|
set -e # fail on any error
|
|
|
|
set -u # treat unset variables as error
|
|
|
|
|
2018-09-12 11:32:05 +02:00
|
|
|
if [ "$CI_COMMIT_REF_NAME" == "master" ];
|
2018-10-02 01:03:58 +02:00
|
|
|
then export DOCKER_BUILD_TAG="latest";
|
|
|
|
else export DOCKER_BUILD_TAG=$CI_COMMIT_REF_NAME;
|
2018-08-26 00:44:08 +02:00
|
|
|
fi
|
|
|
|
docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity
|
|
|
|
|
|
|
|
echo "__________Docker TAG__________"
|
|
|
|
echo $DOCKER_BUILD_TAG
|
|
|
|
|
|
|
|
echo "__________Docker target__________"
|
|
|
|
export DOCKER_TARGET=$1
|
|
|
|
echo $DOCKER_TARGET
|
|
|
|
|
|
|
|
echo "__________Docker build and push__________"
|
2018-10-02 01:03:58 +02:00
|
|
|
docker build --build-arg TARGET=$DOCKER_TARGET --no-cache=true --tag parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG -f scripts/docker/hub/Dockerfile .
|
2018-08-26 00:44:08 +02:00
|
|
|
docker push parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG
|
|
|
|
docker logout
|