You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.7 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. ---
  2. stages:
  3. - build
  4. - test
  5. - deploy-part1
  6. - deploy-extended
  7. variables:
  8. KUBESPRAY_VERSION: v2.26.0
  9. FAILFASTCI_NAMESPACE: 'kargo-ci'
  10. GITLAB_REPOSITORY: 'kargo-ci/kubernetes-sigs-kubespray'
  11. ANSIBLE_FORCE_COLOR: "true"
  12. MAGIC: "ci check this"
  13. TEST_ID: "$CI_PIPELINE_ID-$CI_JOB_ID"
  14. CI_TEST_VARS: "./tests/files/${CI_JOB_NAME}.yml"
  15. CI_TEST_REGISTRY_MIRROR: "./tests/common/_docker_hub_registry_mirror.yml"
  16. CI_TEST_SETTING: "./tests/common/_kubespray_test_settings.yml"
  17. GS_ACCESS_KEY_ID: $GS_KEY
  18. GS_SECRET_ACCESS_KEY: $GS_SECRET
  19. CONTAINER_ENGINE: docker
  20. SSH_USER: root
  21. GCE_PREEMPTIBLE: "false"
  22. ANSIBLE_KEEP_REMOTE_FILES: "1"
  23. ANSIBLE_CONFIG: ./tests/ansible.cfg
  24. ANSIBLE_INVENTORY: ./inventory/sample/${CI_JOB_NAME}-${BUILD_NUMBER}.ini
  25. IDEMPOT_CHECK: "false"
  26. RESET_CHECK: "false"
  27. REMOVE_NODE_CHECK: "false"
  28. UPGRADE_TEST: "false"
  29. MITOGEN_ENABLE: "false"
  30. ANSIBLE_LOG_LEVEL: "-vv"
  31. RECOVER_CONTROL_PLANE_TEST: "false"
  32. RECOVER_CONTROL_PLANE_TEST_GROUPS: "etcd[2:]:kube_control_plane[1:]"
  33. TERRAFORM_VERSION: 1.3.7
  34. PIPELINE_IMAGE: "$CI_REGISTRY_IMAGE/pipeline:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
  35. before_script:
  36. - ./tests/scripts/rebase.sh
  37. - mkdir -p /.ssh
  38. .job: &job
  39. tags:
  40. - ffci
  41. image: $PIPELINE_IMAGE
  42. artifacts:
  43. when: always
  44. paths:
  45. - cluster-dump/
  46. needs:
  47. - pipeline-image
  48. .job-moderated:
  49. extends: .job
  50. needs:
  51. - pipeline-image
  52. - ci-not-authorized
  53. - check-galaxy-version # lint
  54. - pre-commit # lint
  55. - vagrant-validate # lint
  56. .testcases: &testcases
  57. extends: .job-moderated
  58. retry: 1
  59. interruptible: true
  60. before_script:
  61. - update-alternatives --install /usr/bin/python python /usr/bin/python3 1
  62. - ./tests/scripts/rebase.sh
  63. - ./tests/scripts/testcases_prepare.sh
  64. script:
  65. - ./tests/scripts/testcases_run.sh
  66. after_script:
  67. - ./tests/scripts/testcases_cleanup.sh
  68. # For failfast, at least 1 job must be defined in .gitlab-ci.yml
  69. # Premoderated with manual actions
  70. ci-not-authorized:
  71. stage: build
  72. before_script: []
  73. after_script: []
  74. rules:
  75. # LGTM or ok-to-test labels
  76. - if: $PR_LABELS =~ /.*,(lgtm|approved|ok-to-test).*|^(lgtm|approved|ok-to-test).*/i
  77. variables:
  78. CI_OK_TO_TEST: '0'
  79. when: always
  80. - if: $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "trigger"
  81. variables:
  82. CI_OK_TO_TEST: '0'
  83. - if: $CI_COMMIT_BRANCH == "master"
  84. variables:
  85. CI_OK_TO_TEST: '0'
  86. - when: always
  87. variables:
  88. CI_OK_TO_TEST: '1'
  89. script:
  90. - exit $CI_OK_TO_TEST
  91. tags:
  92. - ffci
  93. needs: []
  94. include:
  95. - .gitlab-ci/build.yml
  96. - .gitlab-ci/lint.yml
  97. - .gitlab-ci/terraform.yml
  98. - .gitlab-ci/packet.yml
  99. - .gitlab-ci/vagrant.yml
  100. - .gitlab-ci/molecule.yml