Skip to content
.gitlab-ci.yml 1.89 KiB
Newer Older
---
ant31's avatar
ant31 committed
stages:
  - unit-tests
Antoine Legrand's avatar
Antoine Legrand committed
  - deploy-part1
Antoine Legrand's avatar
Antoine Legrand committed
  - deploy-part2
Antoine Legrand's avatar
Antoine Legrand committed
  - deploy-special
ant31's avatar
ant31 committed

variables:
  FAILFASTCI_NAMESPACE: 'kargo-ci'
  GITLAB_REPOSITORY: 'kargo-ci/kubernetes-sigs-kubespray'
  # DOCKER_HOST: tcp://localhost:2375
  ANSIBLE_FORCE_COLOR: "true"
  MAGIC: "ci check this"
  TEST_ID: "$CI_PIPELINE_ID-$CI_BUILD_ID"
  CI_TEST_VARS: "./tests/files/${CI_JOB_NAME}.yml"
  GS_ACCESS_KEY_ID: $GS_KEY
  GS_SECRET_ACCESS_KEY: $GS_SECRET
  CONTAINER_ENGINE: docker
  SSH_USER: root
  GCE_PREEMPTIBLE: "false"
  ANSIBLE_KEEP_REMOTE_FILES: "1"
  ANSIBLE_CONFIG: ./tests/ansible.cfg
  ANSIBLE_INVENTORY: ./inventory/sample/${CI_JOB_NAME}-${BUILD_NUMBER}.ini
  IDEMPOT_CHECK: "false"
  RESET_CHECK: "false"
  UPGRADE_TEST: "false"
Antoine Legrand's avatar
Antoine Legrand committed
  LOG_LEVEL: "-vv"
  RECOVER_CONTROL_PLANE_TEST: "false"
  RECOVER_CONTROL_PLANE_TEST_GROUPS: "etcd[2:],kube-master[1:]"
ant31's avatar
ant31 committed

before_script:
  - ./tests/scripts/rebase.sh
  - update-alternatives --install /usr/bin/python python /usr/bin/python3 1
  - python -m pip install -r tests/requirements.txt
  - mkdir -p /.ssh
ant31's avatar
ant31 committed

.job: &job
  tags:
    KUBESPRAY_VERSION: v2.12.5
  image: quay.io/kubespray/kubespray:$KUBESPRAY_VERSION
ant31's avatar
ant31 committed

.testcases: &testcases
ant31's avatar
ant31 committed
  <<: *job
  services:
    - docker:dind
  before_script:
    - update-alternatives --install /usr/bin/python python /usr/bin/python3 1
    - ./tests/scripts/rebase.sh
    - ./tests/scripts/testcases_prepare.sh
ant31's avatar
ant31 committed
  script:
    - ./tests/scripts/testcases_run.sh
  after_script:
    - ./tests/scripts/testcases_cleanup.sh
# For failfast, at least 1 job must be defined in .gitlab-ci.yml
Antoine Legrand's avatar
Antoine Legrand committed
# Premoderated with manual actions
ci-authorized:
Antoine Legrand's avatar
Antoine Legrand committed
  stage: moderator
  script:
    - /bin/sh scripts/premoderator.sh
  except: ['triggers', 'master']
Maxime Guyot's avatar
Maxime Guyot committed
  # Disable ci moderator
  only: []
include:
  - .gitlab-ci/lint.yml
Maxime Guyot's avatar
Maxime Guyot committed
  - .gitlab-ci/shellcheck.yml
  - .gitlab-ci/terraform.yml