.gitlab-ci.yml 1.37 KB
Newer Older
1
2
image: python:3.7

3
include:
4
  - project: "open-source/gitlab-ci-templates"
5
    ref: "branch/default"
6
7
    file:                                          # the stages are:
      - "templates/no-duplicated-ci-pipelines.yml" # no stage
Nicolas Chauvat's avatar
Nicolas Chauvat committed
8
9
10
11
12
13
      - "templates/lint/black.yml"                 # lint
      - "templates/lint/check-manifest.yml"        # lint
      - "templates/lint/flake8.yml"                # lint
      - "templates/lint/mypy.yml"                  # lint
      - "templates/lint/yamllint.yml"              # lint
      - "templates/tests/py3.yml"                  # test
14
15
16
      - "templates/build-docker-image.yml"         # test and publish
      - "templates/create-release-on-heptapod.yml" # release
      - "templates/upload-to-pypi.yml"             # release
17

18
stages:
Nicolas Chauvat's avatar
Nicolas Chauvat committed
19
20
  - lint
  - tests
21
  - release
22
  - publish
Viet-Hung Nhu's avatar
Viet-Hung Nhu committed
23
  - deploy
24

25
deploy:
Viet-Hung Nhu's avatar
Viet-Hung Nhu committed
26
  image:
Nicolas Chauvat's avatar
Nicolas Chauvat committed
27
    name: registry.logilab.fr/logilab/infra/dockerfiles/kubectl
Viet-Hung Nhu's avatar
Viet-Hung Nhu committed
28
  stage: deploy
29
30
  rules:
    - if: '$CI_COMMIT_REF_NAME == "branch/default"'
Viet-Hung Nhu's avatar
Viet-Hung Nhu committed
31
32
  script:
    - kubectl version
Simon Chabot's avatar
Simon Chabot committed
33
    - sed "s@r.intra.logilab.fr/intranet/fresh@$CI_REGISTRY_IMAGE:latest@" deploy/deployment.yaml | kubectl -n intranet apply -f -
Viet-Hung Nhu's avatar
Viet-Hung Nhu committed
34
35
36
    - kubectl -n intranet rollout restart deployment/fresh deployment/fresh-scheduler
    - kubectl -n intranet rollout status --timeout=180s deployment/fresh
    - kubectl -n intranet rollout status --timeout=180s deployment/fresh-scheduler