Commit 2790d300 authored by Louis Gesbert's avatar Louis Gesbert
Browse files

Add target to push to Docker Hub

parent 5980b18a
Pipeline #12269 failed with stage
in 56 seconds
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
image: image:
name: gcr.io/kaniko-project/executor:debug name: gcr.io/kaniko-project/executor:debug
entrypoint: [""] entrypoint: [""]
variables:
DOCKERHUB_IMAGE: hub.docker.com/ocamlpro/ocaml
script: script:
- | - |
echo "{ echo "{
...@@ -47,7 +49,11 @@ ...@@ -47,7 +49,11 @@
\"$CI_REGISTRY\": { \"$CI_REGISTRY\": {
\"username\":\"$CI_REGISTRY_USER\", \"username\":\"$CI_REGISTRY_USER\",
\"password\":\"$CI_REGISTRY_PASSWORD\" \"password\":\"$CI_REGISTRY_PASSWORD\"
}}} },
\"hub.docker.com\": {
\"auth\":\"$DOCKERHUB_AUTH\"
}
}}
" > /kaniko/.docker/config.json " > /kaniko/.docker/config.json
- /kaniko/executor --cache=true - /kaniko/executor --cache=true
--context=$CI_PROJECT_DIR --context=$CI_PROJECT_DIR
...@@ -55,10 +61,14 @@ ...@@ -55,10 +61,14 @@
--build-arg=OCAML_VERSION=$OCAML_VERSION --build-arg=OCAML_VERSION=$OCAML_VERSION
--build-arg=LAST_REPO_UPDATE=$(date +%s) --build-arg=LAST_REPO_UPDATE=$(date +%s)
--destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION} --destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION}
--destination=$DOCKERHUB_IMAGE:${OCAML_VERSION}
--destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION%.*} --destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION%.*}
--destination=$DOCKERHUB_IMAGE:${OCAML_VERSION%.*}
--destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION%.*}-$(date +%F) --destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION%.*}-$(date +%F)
--destination=$DOCKERHUB_IMAGE:${OCAML_VERSION%.*}-$(date +%F)
$(if [ "$OCAML_VERSION" = "$LATEST_OCAML_VERSION" ]; then $(if [ "$OCAML_VERSION" = "$LATEST_OCAML_VERSION" ]; then
echo "--destination=$CI_REGISTRY_IMAGE:latest"; echo "--destination=$CI_REGISTRY_IMAGE:latest";
echo "--destination=$DOCKERHUB_IMAGE:latest";
fi) fi)
only: only:
- master - master
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment