.gitlab-ci.yml 1.13 KB
Newer Older
1 2 3
make-targets:
  stage: .pre
  image: alpine:3.11
4
  script:
5 6 7 8 9
    - 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
10 11 12 13
    - curl https://api.github.com/repos/ocaml/opam/releases
        | jq -r 'map(.tag_name | split(".") | {"maj":.[0:2], "pat":.}) | group_by(.maj) | .[] | max | .pat | join(".")'
        | tail -n 1
        > opam-version
14 15 16 17 18 19 20 21
    - |
      { for v in $(cat versions); do
          echo "ocaml-image-$v:";
          echo "  extends: .ocaml-image";
          echo "  variables:";
          echo "    OCAML_VERSION: $v";
          echo;
        done;
22
        echo "variables:";
23
        echo "  LATEST_OCAML_VERSION: $(tail -n1 versions)";
24
        echo "  OPAM_VERSION: $(cat opam-version)";
25 26 27 28 29 30 31 32 33 34 35 36 37
      } > 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
Louis Gesbert's avatar
Louis Gesbert committed
38 39
  only:
    - master