aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: a63c01f04ae8c5eb48ec2d4c89a93e3378be4c16 (plain)
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
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
62
stages:
  - test
  - build

docker-build-master:
  needs: [ "test" ]
  image: docker:latest
  stage: build
  services:
    - docker:dind
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" .
    - docker push "$CI_REGISTRY_IMAGE"
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
  only:
    - main

docker-build:
  needs: [ "test" ]
  image: docker:latest
  stage: build
  services:
    - docker:dind
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" .
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
  except:
    - main


test:
  image: registry.gitlab.com/gabrielgio/alpine-poetry:latest
  stage: test
  script:
    - poetry export --dev -f requirements.txt --output dev-requirements.txt
    - pip install -r dev-requirements.txt
    - pytest --junitxml=report.xml --cov=importer
  artifacts:
    reports:
      junit: report.xml

pages:
  needs: [ "test" ]
  image:
    name: pandoc/alpine
    entrypoint:
      - ""
  stage: build
  script:
    - mkdir public
    - pandoc -s --include-in-header=docs/bamboo.min.css -s README.md -o public/index.html
  artifacts:
    paths:
      - public
  only:
    - main