fix: add docker login and push tag

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias 2018-12-31 18:59:49 +00:00
parent 3c321bf9de
commit cebb1de2af

View File

@ -20,6 +20,7 @@ debugInfo () {
}
dockerLogin () {
if [ "$CI" == "true" ]; then
gpg --batch --gen-key <<-EOF
%echo Generating a standard key
Key-Type: DSA
@ -42,6 +43,9 @@ EOF
fi
echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin
else
docker login
fi
}
dockerPushLatest () {
@ -51,6 +55,17 @@ dockerPushLatest () {
docker logout
}
dockerPushTag () {
dockerLogin
for tag in `echo $(docker images filebrowser/filebrowser* | awk -F ' ' '{print $1 ":" $2}') | cut -d ' ' -f2-`; do
if [ "$tag" = "REPOSITORY:TAG" ]; then break; fi
docker push $tag
done
docker logout
}
installRice () {
if ! [ -x "$(command -v rice)" ]; then
go get github.com/GeertJohan/go.rice/rice