Commit 71215b1b authored by Louis Gesbert's avatar Louis Gesbert
Browse files

Generate images for all OCaml versions using a child pipeline

parent bea2b2fb
build:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
make-targets:
stage: .pre
image: alpine:3.11
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 --destination $CI_REGISTRY_IMAGE:4.10
- 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(".")'
> versions
- for v in $(cat versions); do
sed "s/%OCAML_VERSION%/$v/g" ocaml-image.yml.in >> ocaml-images.yml;
done
artifacts:
paths:
- ocaml-images.yml
build-images:
stage: build
trigger:
include:
- artifact: ocaml-images.yml
job: make-targets
strategy: depend
only:
- master
ocaml-image-%OCAML_VERSION%:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
variables:
OCAML_VERSION: %OCAML_VERSION%
script:
- |
echo "{
\"auths\": {
\"$CI_REGISTRY\": {
\"username\":\"$CI_REGISTRY_USER\",
\"password\":\"$CI_REGISTRY_PASSWORD\"
}}}
" > /kaniko/.docker/config.json
- /kaniko/executor --cache=true --reproducible
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile
--build-arg OCAML_VERSION=$OCAML_VERSION
--destination $CI_REGISTRY_IMAGE:${OCAML_VERSION%.*}
only:
- 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