.gitlab-ci.yml 893 Bytes
Newer Older
1 2 3
make-targets:
  stage: .pre
  image: alpine:3.11
Louis Gesbert's avatar
Louis Gesbert committed
4
  script:
5 6 7
    - 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(".")'
8
        | tail -n +3
9
        > versions
Louis Gesbert's avatar
Fix  
Louis Gesbert committed
10 11
    - |
      { for v in $(cat versions); do
Louis Gesbert's avatar
Louis Gesbert committed
12 13 14 15 16
          echo "ocaml-image-$v:";
          echo "  extends: .ocaml-image";
          echo "  variables:";
          echo "    OCAML_VERSION: $v";
          echo;
Louis Gesbert's avatar
Fix  
Louis Gesbert committed
17 18 19 20
        done;
        echo "variables:"
        echo "  LATEST_OCAML_VERSION: $(tail -n1 versions)";
      } > ocaml-images.yml
21 22
  artifacts:
    paths:
Louis Gesbert's avatar
Fix  
Louis Gesbert committed
23
      - ocaml-images.yml
24 25 26

build-images:
  stage: build
Louis Gesbert's avatar
Louis Gesbert committed
27
  variables:
28 29
  trigger:
    include:
Louis Gesbert's avatar
Louis Gesbert committed
30
      - local: ocaml-images-gen.yml
31 32 33
      - artifact: ocaml-images.yml
        job: make-targets
    strategy: depend
Louis Gesbert's avatar
Louis Gesbert committed
34 35
  only:
    - master