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
e7676512
Commit
e7676512
authored
Nov 26, 2020
by
Louis Gesbert
Browse files
Factorise
parent
d8519652
Pipeline
#11616
failed with stages
in 12 seconds
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
27 deletions
+29
-27
.gitlab-ci.yml
.gitlab-ci.yml
+1
-0
ocaml-image.yml.in
ocaml-image.yml.in
+2
-27
ocaml-image.yml.pre
ocaml-image.yml.pre
+26
-0
No files found.
.gitlab-ci.yml
View file @
e7676512
...
...
@@ -7,6 +7,7 @@ make-targets:
| jq -r 'map(.tag_name | split(".") | {"maj":.[0:2], "pat":.}) | group_by(.maj) | .[] | max | .pat | join(".")'
| tail -n +3
> versions
-
cat ocaml-image.yml.pre > ocaml-images.yml
-
for v in $(cat versions); do
sed "s/%OCAML_VERSION%/$v/g; s/%LATEST_OCAML_VERSION%/$(tail -n1 versions)/g"
ocaml-image.yml.in
...
...
ocaml-image.yml.in
View file @
e7676512
ocaml-image-%OCAML_VERSION%:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
extends: .ocaml-image
variables:
OCAML_VERSION: %OCAML_VERSION%
LATEST_OCAML_VERSION: %LATEST_OCAML_VERSION%
script:
- |
echo "{
\"auths\": {
\"$CI_REGISTRY\": {
\"username\":\"$CI_REGISTRY_USER\",
\"password\":\"$CI_REGISTRY_PASSWORD\"
}}}
" > /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=$CI_REGISTRY_IMAGE:${OCAML_VERSION%.*}
--destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION%.*}-$(date +%F)
$(if [ "$OCAML_VERSION" = "$LATEST_OCAML_VERSION" ]; then
echo "--destination=$CI_REGISTRY_IMAGE:latest";
fi)
only:
- master
ocaml-image.yml.pre
0 → 100644
View file @
e7676512
.ocaml-image:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
- |
echo "{
\"auths\": {
\"$CI_REGISTRY\": {
\"username\":\"$CI_REGISTRY_USER\",
\"password\":\"$CI_REGISTRY_PASSWORD\"
}}}
" > /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=$CI_REGISTRY_IMAGE:${OCAML_VERSION%.*}
--destination=$CI_REGISTRY_IMAGE:${OCAML_VERSION%.*}-$(date +%F)
$(if [ "$OCAML_VERSION" = "$LATEST_OCAML_VERSION" ]; then
echo "--destination=$CI_REGISTRY_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