.gitlab-ci.yml 942 Bytes
Newer Older
1
image: docker:19.03.1
Christian Rohlfing's avatar
Christian Rohlfing committed
2
3
services:
  - docker:19.03.1-dind
4
5
6
7
8

stages:
- build
- test

Christian Rohlfing's avatar
Christian Rohlfing committed
9
10
11
12
13
variables:
  GIT_SUBMODULE_STRATEGY: recursive
  DOCKER_TLS_CERTDIR: "/certs"
  DOCKER_HOST: tcp://docker:2376 # Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}

build:
  stage: build
  script:
  - docker pull ${CI_REGISTRY_IMAGE}:latest || true
  - docker build --cache-from ${CI_REGISTRY_IMAGE}:latest
                 --tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}
                 --tag ${CI_REGISTRY_IMAGE}:latest .
  - docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}
  - docker push ${CI_REGISTRY_IMAGE}:latest
  only:
  - master

test:
  stage: test
  script:
  - docker run --name examscan --rm -v $(pwd):$(pwd) -w $(pwd) ${CI_REGISTRY_IMAGE}:latest watermark.py --i pdfs --o out
  artifacts:
    paths:
    - out/