harbor/tests/robot-cases/Group0-Util/notary-push-image.sh

27 lines
669 B
Bash
Raw Normal View History

#!/bin/bash
#docker pull $3:$4
set -x
IP=$1
notaryServerEndpoint=$5
tag_src=$6
USER=$7
PASSHRASE=$8
2017-09-18 09:46:40 +02:00
echo $IP
export DOCKER_CONTENT_TRUST=1
export DOCKER_CONTENT_TRUST_SERVER=https://$notaryServerEndpoint
2017-09-18 09:46:40 +02:00
export NOTARY_ROOT_PASSPHRASE=$PASSHRASE
export NOTARY_TARGETS_PASSPHRASE=$PASSHRASE
export NOTARY_SNAPSHOT_PASSPHRASE=$PASSHRASE
export DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE=$PASSHRASE
export DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE=$PASSHRASE
export DOCKER_CONTENT_TRUST_OFFLINE_PASSPHRASE=$PASSHRASE
export DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE=$PASSHRASE
docker login -u $USER -p $PASSHRASE $IP
docker tag $tag_src $IP/$2/$3:$4
docker push $IP/$2/$3:$4