.gitlab-ci.yml 1.42 KB
Newer Older
Matthew Pickering's avatar
Matthew Pickering committed
1 2 3 4 5 6
image: docker:stable

services:
  - docker:dind

variables:
Ben Gamari's avatar
Ben Gamari committed
7
  CONTAINER_IMAGE_BASE: registry.gitlab.haskell.org/$CI_PROJECT_PATH
Matthew Pickering's avatar
Matthew Pickering committed
8 9 10 11 12 13
  DOCKER_HOST: tcp://docker:2375
  DOCKER_DRIVER: overlay2

before_script:
  - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.haskell.org

Ben Gamari's avatar
Ben Gamari committed
14 15

.build:
Matthew Pickering's avatar
Matthew Pickering committed
16
  stage: build
17
  tags:
Ben Gamari's avatar
Ben Gamari committed
18
    - docker
Matthew Pickering's avatar
Matthew Pickering committed
19
  script:
Ben Gamari's avatar
Ben Gamari committed
20
    - |
Ben Gamari's avatar
Ben Gamari committed
21
      CONTAINER_IMAGE="$CONTAINER_IMAGE_BASE/$IMAGE"
Ben Gamari's avatar
Ben Gamari committed
22
      docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.haskell.org
Ben Gamari's avatar
Ben Gamari committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
      docker pull $CONTAINER_IMAGE:latest || true
      docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:$CI_COMMIT_SHA --tag $CONTAINER_IMAGE:latest linters/
      docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
      docker push $CONTAINER_IMAGE:latest

build-aarch64-linux-deb9:
  extends: .build
  variables:
    IMAGE: aarch64-linux-deb9

build-i386-linux-deb8:
  extends: .build
  variables:
    IMAGE: i386-linux-deb8

build-i386-linux-deb9:
  extends: .build
  variables:
    IMAGE: i386-linux-deb9

build-x86_64-freebsd:
  extends: .build
  variables:
    IMAGE: x86_64-freebsd

build-x86_64-linux-centos7:
  extends: .build
  variables:
    IMAGE: x86_64-linux-centos7

build-x86_64-linux-deb8:
  extends: .build
  variables:
    IMAGE: x86_64-linux-deb8

build-x86_64-linux-deb9:
  extends: .build
  variables:
    IMAGE: x86_64-linux-deb9
Matthew Pickering's avatar
Matthew Pickering committed
62

Ben Gamari's avatar
Ben Gamari committed
63 64 65 66
build-x86_64-linux-fedora27:
  extends: .build
  variables:
    IMAGE: x86_64-linux-fedora27