ocaml-image.yml.pre 929 Bytes
Newer Older
Louis Gesbert's avatar
Louis Gesbert committed
1 2 3 4 5
.ocaml-image:
  stage: build
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
Louis Gesbert's avatar
Louis Gesbert committed
6 7
  variables:
    LATEST_OCAML_VERSION: %LATEST_OCAML_VERSION%
Louis Gesbert's avatar
Louis Gesbert committed
8
  script:
Louis Gesbert's avatar
Louis Gesbert committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
  - |
    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