.gitlab-ci.yml 727 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
image: docker:19.03.1

stages:
- build
- test

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:
  - mkdir out
  - docker run --name examscan --rm -v $(pwd):$(pwd) -w $(pwd) ${CI_REGISTRY_IMAGE}:latest watermark.py --i pdfs --o out
  artifacts:
    paths:
    - out/