Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
OCamlPro
ocaml-docker-images
Commits
e9adfb0b
Commit
e9adfb0b
authored
Jan 28, 2021
by
Louis Gesbert
Browse files
Remove the explicit hack, move the docker hub code to ocaml-images-gen.yml
This reverts commit
5b1767f0
.
parent
5171558c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
126 deletions
+43
-126
.gitlab-ci.yml
.gitlab-ci.yml
+31
-124
ocaml-images-gen.yml
ocaml-images-gen.yml
+12
-2
No files found.
.gitlab-ci.yml
View file @
e9adfb0b
# make-targets:
# stage: .pre
# image: alpine:3.11
# script:
# - apk add curl jq
# - curl https://api.github.com/repos/ocaml/ocaml/releases
# | jq -r 'map(.tag_name | split(".") | {"maj":.[0:2], "pat":.}) | group_by(.maj) | .[] | max | .pat | join(".")'
# | tail -n +3
# > versions
# - |
# { for v in $(cat versions); do
# echo "ocaml-image-$v:";
# echo " extends: .ocaml-image";
# echo " variables:";
# echo " OCAML_VERSION: $v";
# echo;
# done;
# echo "variables:"
# echo " LATEST_OCAML_VERSION: $(tail -n1 versions)";
# } > ocaml-images.yml
# artifacts:
# paths:
# - ocaml-images.yml
# build-images:
# stage: build
# variables:
# trigger:
# include:
# - local: ocaml-images-gen.yml
# - artifact: ocaml-images.yml
# job: make-targets
# strategy: depend
# only:
# - master
.ocaml-image
:
stage
:
build
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
variables
:
DOCKERHUB_IMAGE
:
ocamlpro/ocaml
make-targets
:
stage
:
.pre
image
:
alpine:3.11
script
:
-
apk add curl jq
-
curl https://api.github.com/repos/ocaml/ocaml/releases
| jq -r 'map(.tag_name | split(".") | {"maj":.[0:2], "pat":.}) | group_by(.maj) | .[] | max | .pat | join(".")'
| tail -n +3
> versions
-
|
echo "{
\"auths\": {
\"$CI_REGISTRY\": {
\"username\":\"$CI_REGISTRY_USER\",
\"password\":\"$CI_REGISTRY_PASSWORD\"
},
\"https://index.docker.io/v1/\": {
\"auth\":\"$DOCKERHUB_AUTH\"
}
}}
" > /kaniko/.docker/config.json
-
/kaniko/executor --cache=true
--context=$CI_PROJECT_DIR
--dockerfile=$CI_PROJECT_DIR/Dockerfile
--build-arg=OCAML_VERSION=$OCAML_VERSION
--build-arg=LAST_REPO_UPDATE=$(date +%s)
--destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION}
--destination=$DOCKERHUB_IMAGE:${OCAML_VERSION}
--destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION%.*}
--destination=$DOCKERHUB_IMAGE:${OCAML_VERSION%.*}
--destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION%.*}-$(date +%F)
--destination=$DOCKERHUB_IMAGE:${OCAML_VERSION%.*}-$(date +%F)
$(if [ "$OCAML_VERSION" = "$LATEST_OCAML_VERSION" ]; then
echo "--destination=$CI_REGISTRY_IMAGE:latest";
echo "--destination=$DOCKERHUB_IMAGE:latest";
fi)
{ for v in $(cat versions); do
echo "ocaml-image-$v:";
echo " extends: .ocaml-image";
echo " variables:";
echo " OCAML_VERSION: $v";
echo;
done;
echo "variables:"
echo " LATEST_OCAML_VERSION: $(tail -n1 versions)";
} > ocaml-images.yml
artifacts
:
paths
:
-
ocaml-images.yml
build-images
:
stage
:
build
trigger
:
include
:
-
local
:
ocaml-images-gen.yml
-
artifact
:
ocaml-images.yml
job
:
make-targets
strategy
:
depend
only
:
-
master
ocaml-image-4.02.3
:
extends
:
.ocaml-image
variables
:
OCAML_VERSION
:
4.02.3
ocaml-image-4.03.0
:
extends
:
.ocaml-image
variables
:
OCAML_VERSION
:
4.03.0
ocaml-image-4.04.2
:
extends
:
.ocaml-image
variables
:
OCAML_VERSION
:
4.04.2
ocaml-image-4.05.0
:
extends
:
.ocaml-image
variables
:
OCAML_VERSION
:
4.05.0
ocaml-image-4.06.1
:
extends
:
.ocaml-image
variables
:
OCAML_VERSION
:
4.06.1
ocaml-image-4.07.1
:
extends
:
.ocaml-image
variables
:
OCAML_VERSION
:
4.07.1
ocaml-image-4.08.1
:
extends
:
.ocaml-image
variables
:
OCAML_VERSION
:
4.08.1
ocaml-image-4.09.1
:
extends
:
.ocaml-image
variables
:
OCAML_VERSION
:
4.09.1
ocaml-image-4.10.1
:
extends
:
.ocaml-image
variables
:
OCAML_VERSION
:
4.10.1
ocaml-image-4.11.1
:
extends
:
.ocaml-image
variables
:
OCAML_VERSION
:
4.11.1
variables
:
LATEST_OCAML_VERSION
:
4.11.1
ocaml-images-gen.yml
View file @
e9adfb0b
...
...
@@ -3,6 +3,8 @@
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
variables
:
DOCKERHUB_IMAGE
:
ocamlpro/ocaml
script
:
-
|
echo "{
...
...
@@ -10,18 +12,26 @@
\"$CI_REGISTRY\": {
\"username\":\"$CI_REGISTRY_USER\",
\"password\":\"$CI_REGISTRY_PASSWORD\"
}}}
" > /kaniko/.docker/config.json
},
\"https://index.docker.io/v1/\": {
\"auth\":\"$DOCKERHUB_AUTH\"
}
}
}" > /kaniko/.docker/config.json
-
/kaniko/executor --cache=true
--context=$CI_PROJECT_DIR
--dockerfile=$CI_PROJECT_DIR/Dockerfile
--build-arg=OCAML_VERSION=$OCAML_VERSION
--build-arg=LAST_REPO_UPDATE=$(date +%s)
--destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION}
--destination=$DOCKERHUB_IMAGE:${OCAML_VERSION}
--destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION%.*}
--destination=$DOCKERHUB_IMAGE:${OCAML_VERSION%.*}
--destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION%.*}-$(date +%F)
--destination=$DOCKERHUB_IMAGE:${OCAML_VERSION%.*}-$(date +%F)
$(if [ "$OCAML_VERSION" = "$LATEST_OCAML_VERSION" ]; then
echo "--destination=$CI_REGISTRY_IMAGE:latest";
echo "--destination=$DOCKERHUB_IMAGE:latest";
fi)
only
:
-
master
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment