ci: Add "--push" argument to run-docker.sh help script

Also there is no need to run docker as root, the user just needs to be
in the "docker" group.
This commit is contained in:
Xavier Claessens 2018-06-22 11:24:24 -04:00
parent 94748af0e1
commit ca2fc30dea

View File

@ -4,8 +4,14 @@ set -e
TAG="registry.gitlab.gnome.org/gnome/glib/master:v4"
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
--file "Dockerfile" .
sudo docker run --rm \
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
--tty --interactive "${TAG}" bash
if [ "$1" = "--push" ]; then
docker login registry.gitlab.gnome.org
docker push $TAG
else
docker run --rm \
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
--tty --interactive "${TAG}" bash
fi