Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.48 KiB
Newer Older
  image: registry.ubicast.net/sys/ansible-public

stages:
  - lint
  - docker
  - test-pf-std
  - test-pf-ha
  - test-pgsql

# * * * * * * * * * * * * *

lint:verify:
  stage: lint
  rules:
    # Avoid duplicate CI on merge request commits
    - if: '$CI_MERGE_REQUEST_EVENT_TYPE == "detached"'
      when: never
    # Ignore linting on docker image build
    - if: '$DOCKER_BUILD != "True"'
      when: always
    - when: never
  script:
    - make lint

# * * * * * * * * * * * * *

# Docker image build job
docker:image:
  image: docker:stable
  stage: docker
  rules:
    # Build docker image for schedule pipelines only
    - if: '$DOCKER_BUILD == "True"'
  before_script:
    - apk add bash make
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.ubicast.net
  script:
    - make docker-build
    - make docker-push

# * * * * * * * * * * * * *

.test-template:
  retry: 2
  timeout: 4h
  rules:
    # Run deployment for schedule pipelines
    - if: '$CI_PIPELINE_SOURCE == "schedule" && $PF_DEPLOY_TEST == "True"'
      when: always
    # Run deployment for manual pipelines
    - if: '$CI_PIPELINE_SOURCE == "web"'
      when: always
    - when: never

test:pf-std:
  extends: .test-template
  stage: test-pf-std
  script:
    - echo $CI_PIPELINE_SOURCE
    - make test pf-std=1

test:pf-ha:
  extends: .test-template
  stage: test-pf-ha
  script:
    - make test pf-ha=1

test:pgsql-ha:
  extends: .test-template
  stage: test-pgsql
  script:
    - make test pgsql-ha=1 debug=1

...