.gitlab-ci.yml 1.46 KB
Newer Older
Guillaume Melquiond's avatar
Guillaume Melquiond committed
1 2
stages:
  - docker
Guillaume Melquiond's avatar
Guillaume Melquiond committed
3
  - build
Guillaume Melquiond's avatar
Guillaume Melquiond committed
4
  - test
5
  - deploy
Guillaume Melquiond's avatar
Guillaume Melquiond committed
6 7 8 9 10 11 12 13 14 15 16 17 18

variables:
  BUILD_IMAGE: "$CI_REGISTRY_IMAGE:ci-master-2020-04-03"
  GIT_CLEAN_FLAGS: "-ffdxq"

build-image:
  stage: docker
  script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
    - if docker pull "$BUILD_IMAGE"; then echo "Image already exists!"; exit 1; fi
    - docker build --force-rm -t "$BUILD_IMAGE" - < misc/Dockerfile
    - docker push "$BUILD_IMAGE"
    - docker rmi "$BUILD_IMAGE"
Guillaume Melquiond's avatar
Guillaume Melquiond committed
19 20 21
  only:
    variables:
      - $NEW_BUILD_IMAGE
Guillaume Melquiond's avatar
Guillaume Melquiond committed
22 23 24 25 26 27 28
  tags:
    - shell

.docker_template: &docker_definition
  image: "$BUILD_IMAGE"
  tags:
    - docker
Guillaume Melquiond's avatar
Guillaume Melquiond committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

.build_template: &build_definition
  stage: build
  script:
    - eval `opam env`
    - autoconf
    - ./configure
    - ./remake all check
  <<: *docker_definition

build-minimal:
  before_script:
    - opam switch minimal
  <<: *build_definition

build-latest:
  before_script:
    - opam switch latest
  <<: *build_definition
48

Guillaume Melquiond's avatar
Guillaume Melquiond committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
.opam_template: &opam_definition
  stage: test
  script:
    - opam pin -y -n add coq-flocq .
    - opam install -v coq-flocq
  <<: *docker_definition

opam-minimal:
  before_script:
    - opam switch minimal
  <<: *opam_definition

opam-latest:
  before_script:
    - opam switch latest
  <<: *opam_definition

66 67 68 69 70 71 72 73 74 75 76 77 78 79
pages:
  stage: deploy
  script:
    - opam switch latest
    - eval `opam env`
    - autoconf
    - ./configure
    - ./remake public
  artifacts:
    paths:
    - public
  only:
    - master
  <<: *docker_definition