.gitlab-ci.yml 1.32 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
  DOCKER_HOST: tcp://docker:2375
  DOCKER_DRIVER: overlay2

Ben Gamari's avatar
Ben Gamari committed
11
.build:
Matthew Pickering's avatar
Matthew Pickering committed
12
  stage: build
13
  tags:
Ben Gamari's avatar
Ben Gamari committed
14
    - docker
Matthew Pickering's avatar
Matthew Pickering committed
15
  script:
Ben Gamari's avatar
Ben Gamari committed
16
    - |
Ben Gamari's avatar
Ben Gamari committed
17
      CONTAINER_IMAGE="$CONTAINER_IMAGE_BASE/$IMAGE"
Ben Gamari's avatar
Ben Gamari committed
18
      docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.haskell.org
Ben Gamari's avatar
Ben Gamari committed
19 20 21 22 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
      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
58

Ben Gamari's avatar
Ben Gamari committed
59 60 61 62
build-x86_64-linux-fedora27:
  extends: .build
  variables:
    IMAGE: x86_64-linux-fedora27