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.

708 lines
21 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. stages:
  2. - moderator
  3. - unit-tests
  4. - deploy-gce-part1
  5. - deploy-gce-part2
  6. - deploy-gce-special
  7. variables:
  8. FAILFASTCI_NAMESPACE: 'kargo-ci'
  9. # DOCKER_HOST: tcp://localhost:2375
  10. ANSIBLE_FORCE_COLOR: "true"
  11. # asia-east1-a
  12. # asia-northeast1-a
  13. # europe-west1-b
  14. # us-central1-a
  15. # us-east1-b
  16. # us-west1-a
  17. before_script:
  18. - pip install -r tests/requirements.txt
  19. - mkdir -p /.ssh
  20. - cp tests/ansible.cfg .
  21. .job: &job
  22. tags:
  23. - kubernetes
  24. - docker
  25. image: quay.io/ant31/kargo:master
  26. .docker_service: &docker_service
  27. services:
  28. - docker:dind
  29. .create_cluster: &create_cluster
  30. <<: *job
  31. <<: *docker_service
  32. .gce_variables: &gce_variables
  33. GCE_USER: travis
  34. SSH_USER: $GCE_USER
  35. TEST_ID: "$CI_PIPELINE_ID-$CI_BUILD_ID"
  36. CONTAINER_ENGINE: docker
  37. PRIVATE_KEY: $GCE_PRIVATE_KEY
  38. GS_ACCESS_KEY_ID: $GS_KEY
  39. GS_SECRET_ACCESS_KEY: $GS_SECRET
  40. CLOUD_MACHINE_TYPE: "g1-small"
  41. ANSIBLE_KEEP_REMOTE_FILES: "1"
  42. ANSIBLE_CONFIG: ./tests/ansible.cfg
  43. BOOTSTRAP_OS: none
  44. DOWNLOAD_LOCALHOST: "false"
  45. DOWNLOAD_RUN_ONCE: "false"
  46. IDEMPOT_CHECK: "false"
  47. RESET_CHECK: "false"
  48. UPGRADE_TEST: "false"
  49. KUBEADM_ENABLED: "false"
  50. RESOLVCONF_MODE: docker_dns
  51. LOG_LEVEL: "-vv"
  52. ETCD_DEPLOYMENT: "docker"
  53. KUBELET_DEPLOYMENT: "host"
  54. VAULT_DEPLOYMENT: "docker"
  55. WEAVE_CPU_LIMIT: "100m"
  56. AUTHORIZATION_MODES: "{ 'authorization_modes': [] }"
  57. MAGIC: "ci check this"
  58. .gce: &gce
  59. <<: *job
  60. <<: *docker_service
  61. cache:
  62. key: "$CI_BUILD_REF_NAME"
  63. paths:
  64. - downloads/
  65. - $HOME/.cache
  66. before_script:
  67. - docker info
  68. - pip install -r tests/requirements.txt
  69. - mkdir -p /.ssh
  70. - mkdir -p $HOME/.ssh
  71. - echo $PRIVATE_KEY | base64 -d > $HOME/.ssh/id_rsa
  72. - echo $GCE_PEM_FILE | base64 -d > $HOME/.ssh/gce
  73. - echo $GCE_CREDENTIALS > $HOME/.ssh/gce.json
  74. - chmod 400 $HOME/.ssh/id_rsa
  75. - ansible-playbook --version
  76. - export PYPATH=$([ $BOOTSTRAP_OS = none ] && echo /usr/bin/python || echo /opt/bin/python)
  77. script:
  78. - pwd
  79. - ls
  80. - echo ${PWD}
  81. - echo "${STARTUP_SCRIPT}"
  82. - >
  83. ansible-playbook tests/cloud_playbooks/create-gce.yml -i tests/local_inventory/hosts.cfg -c local
  84. ${LOG_LEVEL}
  85. -e cloud_image=${CLOUD_IMAGE}
  86. -e cloud_region=${CLOUD_REGION}
  87. -e gce_credentials_file=${HOME}/.ssh/gce.json
  88. -e gce_project_id=${GCE_PROJECT_ID}
  89. -e gce_service_account_email=${GCE_ACCOUNT}
  90. -e cloud_machine_type=${CLOUD_MACHINE_TYPE}
  91. -e inventory_path=${PWD}/inventory/inventory.ini
  92. -e kube_network_plugin=${KUBE_NETWORK_PLUGIN}
  93. -e mode=${CLUSTER_MODE}
  94. -e test_id=${TEST_ID}
  95. -e startup_script="'${STARTUP_SCRIPT}'"
  96. # Check out latest tag if testing upgrade
  97. # Uncomment when gitlab kargo repo has tags
  98. #- test "${UPGRADE_TEST}" != "false" && git fetch --all && git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
  99. - test "${UPGRADE_TEST}" != "false" && git checkout 72ae7638bcc94c66afa8620dfa4ad9a9249327ea
  100. # Create cluster
  101. - >
  102. ansible-playbook -i inventory/inventory.ini -b --become-user=root --private-key=${HOME}/.ssh/id_rsa -u $SSH_USER
  103. ${SSH_ARGS}
  104. ${LOG_LEVEL}
  105. -e ansible_python_interpreter=${PYPATH}
  106. -e ansible_ssh_user=${SSH_USER}
  107. -e bootstrap_os=${BOOTSTRAP_OS}
  108. -e cloud_provider=gce
  109. -e cert_management=${CERT_MGMT:-script}
  110. -e "{deploy_netchecker: true}"
  111. -e "{download_localhost: ${DOWNLOAD_LOCALHOST}}"
  112. -e "{download_run_once: ${DOWNLOAD_RUN_ONCE}}"
  113. -e etcd_deployment_type=${ETCD_DEPLOYMENT}
  114. -e kube_network_plugin=${KUBE_NETWORK_PLUGIN}
  115. -e kubedns_min_replicas=1
  116. -e kubelet_deployment_type=${KUBELET_DEPLOYMENT}
  117. -e local_release_dir=${PWD}/downloads
  118. -e resolvconf_mode=${RESOLVCONF_MODE}
  119. -e vault_deployment_type=${VAULT_DEPLOYMENT}
  120. -e weave_cpu_requests=${WEAVE_CPU_LIMIT}
  121. -e weave_cpu_limit=${WEAVE_CPU_LIMIT}
  122. -e "{kubeadm_enabled: ${KUBEADM_ENABLED}}"
  123. -e "${AUTHORIZATION_MODES}"
  124. --limit "all:!fake_hosts"
  125. cluster.yml
  126. # Repeat deployment if testing upgrade
  127. - >
  128. if [ "${UPGRADE_TEST}" != "false" ]; then
  129. test "${UPGRADE_TEST}" == "basic" && PLAYBOOK="cluster.yml";
  130. test "${UPGRADE_TEST}" == "graceful" && PLAYBOOK="upgrade-cluster.yml";
  131. git checkout "${CI_BUILD_REF}";
  132. ansible-playbook -i inventory/inventory.ini -b --become-user=root --private-key=${HOME}/.ssh/id_rsa -u $SSH_USER
  133. ${SSH_ARGS}
  134. ${LOG_LEVEL}
  135. -e ansible_python_interpreter=${PYPATH}
  136. -e ansible_ssh_user=${SSH_USER}
  137. -e bootstrap_os=${BOOTSTRAP_OS}
  138. -e cloud_provider=gce
  139. -e "{deploy_netchecker: true}"
  140. -e "{download_localhost: ${DOWNLOAD_LOCALHOST}}"
  141. -e "{download_run_once: ${DOWNLOAD_RUN_ONCE}}"
  142. -e etcd_deployment_type=${ETCD_DEPLOYMENT}
  143. -e kube_network_plugin=${KUBE_NETWORK_PLUGIN}
  144. -e kubedns_min_replicas=1
  145. -e kubelet_deployment_type=${KUBELET_DEPLOYMENT}
  146. -e local_release_dir=${PWD}/downloads
  147. -e resolvconf_mode=${RESOLVCONF_MODE}
  148. -e vault_deployment_type=${VAULT_DEPLOYMENT}
  149. -e weave_cpu_requests=${WEAVE_CPU_LIMIT}
  150. -e weave_cpu_limit=${WEAVE_CPU_LIMIT}
  151. -e "{kubeadm_enabled: ${KUBEADM_ENABLED}}"
  152. -e "${AUTHORIZATION_MODES}"
  153. --limit "all:!fake_hosts"
  154. $PLAYBOOK;
  155. fi
  156. # Tests Cases
  157. ## Test Master API
  158. - >
  159. ansible-playbook -i inventory/inventory.ini -e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root --limit "all:!fake_hosts" tests/testcases/010_check-apiserver.yml $LOG_LEVEL
  160. -e "{kubeadm_enabled: ${KUBEADM_ENABLED}}"
  161. ## Ping the between 2 pod
  162. - ansible-playbook -i inventory/inventory.ini -e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root --limit "all:!fake_hosts" tests/testcases/030_check-network.yml $LOG_LEVEL
  163. ## Advanced DNS checks
  164. - ansible-playbook -i inventory/inventory.ini -e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root --limit "all:!fake_hosts" tests/testcases/040_check-network-adv.yml $LOG_LEVEL
  165. ## Idempotency checks 1/5 (repeat deployment)
  166. - >
  167. if [ "${IDEMPOT_CHECK}" = "true" ]; then
  168. ansible-playbook -i inventory/inventory.ini -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS
  169. -b --become-user=root -e cloud_provider=gce $LOG_LEVEL -e kube_network_plugin=${KUBE_NETWORK_PLUGIN}
  170. --private-key=${HOME}/.ssh/id_rsa
  171. -e bootstrap_os=${BOOTSTRAP_OS}
  172. -e cloud_provider=gce
  173. -e ansible_python_interpreter=${PYPATH}
  174. -e "{deploy_netchecker: true}"
  175. -e "{download_localhost: ${DOWNLOAD_LOCALHOST}}"
  176. -e "{download_run_once: ${DOWNLOAD_RUN_ONCE}}"
  177. -e etcd_deployment_type=${ETCD_DEPLOYMENT}
  178. -e kubedns_min_replicas=1
  179. -e kubelet_deployment_type=${KUBELET_DEPLOYMENT}
  180. -e local_release_dir=${PWD}/downloads
  181. -e resolvconf_mode=${RESOLVCONF_MODE}
  182. -e vault_deployment_type=${VAULT_DEPLOYMENT}
  183. -e "{kubeadm_enabled: ${KUBEADM_ENABLED}}"
  184. -e weave_cpu_requests=${WEAVE_CPU_LIMIT}
  185. -e weave_cpu_limit=${WEAVE_CPU_LIMIT}
  186. -e "${AUTHORIZATION_MODES}"
  187. --limit "all:!fake_hosts"
  188. cluster.yml;
  189. fi
  190. ## Idempotency checks 2/5 (Advanced DNS checks)
  191. - >
  192. if [ "${IDEMPOT_CHECK}" = "true" ]; then
  193. ansible-playbook -i inventory/inventory.ini -e ansible_python_interpreter=${PYPATH}
  194. -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root
  195. --limit "all:!fake_hosts"
  196. tests/testcases/040_check-network-adv.yml $LOG_LEVEL;
  197. fi
  198. ## Idempotency checks 3/5 (reset deployment)
  199. - >
  200. if [ "${IDEMPOT_CHECK}" = "true" AND "${RESET_CHECK}" = "true" ]; then
  201. ansible-playbook -i inventory/inventory.ini -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS
  202. -b --become-user=root -e cloud_provider=gce $LOG_LEVEL -e kube_network_plugin=${KUBE_NETWORK_PLUGIN}
  203. --private-key=${HOME}/.ssh/id_rsa
  204. -e bootstrap_os=${BOOTSTRAP_OS}
  205. -e cloud_provider=gce
  206. -e ansible_python_interpreter=${PYPATH}
  207. -e reset_confirmation=yes
  208. --limit "all:!fake_hosts"
  209. reset.yml;
  210. fi
  211. ## Idempotency checks 4/5 (redeploy after reset)
  212. - >
  213. if [ "${IDEMPOT_CHECK}" = "true" AND "${RESET_CHECK}" = "true" ]; then
  214. ansible-playbook -i inventory/inventory.ini -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS
  215. -b --become-user=root -e cloud_provider=gce $LOG_LEVEL -e kube_network_plugin=${KUBE_NETWORK_PLUGIN}
  216. --private-key=${HOME}/.ssh/id_rsa
  217. -e bootstrap_os=${BOOTSTRAP_OS}
  218. -e cloud_provider=gce
  219. -e ansible_python_interpreter=${PYPATH}
  220. -e "{deploy_netchecker: true}"
  221. -e "{download_localhost: ${DOWNLOAD_LOCALHOST}}"
  222. -e "{download_run_once: ${DOWNLOAD_RUN_ONCE}}"
  223. -e etcd_deployment_type=${ETCD_DEPLOYMENT}
  224. -e kubedns_min_replicas=1
  225. -e kubelet_deployment_type=${KUBELET_DEPLOYMENT}
  226. -e local_release_dir=${PWD}/downloads
  227. -e resolvconf_mode=${RESOLVCONF_MODE}
  228. -e vault_deployment_type=${VAULT_DEPLOYMENT}
  229. -e "{kubeadm_enabled: ${KUBEADM_ENABLED}}"
  230. -e weave_cpu_requests=${WEAVE_CPU_LIMIT}
  231. -e weave_cpu_limit=${WEAVE_CPU_LIMIT}
  232. -e "${AUTHORIZATION_MODES}"
  233. --limit "all:!fake_hosts"
  234. cluster.yml;
  235. fi
  236. ## Idempotency checks 5/5 (Advanced DNS checks)
  237. - >
  238. if [ "${IDEMPOT_CHECK}" = "true" AND "${RESET_CHECK}" = "true" ]; then
  239. ansible-playbook -i inventory/inventory.ini -e ansible_python_interpreter=${PYPATH}
  240. -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root
  241. --limit "all:!fake_hosts"
  242. tests/testcases/040_check-network-adv.yml $LOG_LEVEL;
  243. fi
  244. after_script:
  245. - >
  246. ansible-playbook -i inventory/inventory.ini tests/cloud_playbooks/delete-gce.yml -c local $LOG_LEVEL
  247. -e mode=${CLUSTER_MODE}
  248. -e test_id=${TEST_ID}
  249. -e kube_network_plugin=${KUBE_NETWORK_PLUGIN}
  250. -e gce_project_id=${GCE_PROJECT_ID}
  251. -e gce_service_account_email=${GCE_ACCOUNT}
  252. -e gce_credentials_file=${HOME}/.ssh/gce.json
  253. -e cloud_image=${CLOUD_IMAGE}
  254. -e inventory_path=${PWD}/inventory/inventory.ini
  255. -e cloud_region=${CLOUD_REGION}
  256. # Test matrix. Leave the comments for markup scripts.
  257. .coreos_calico_aio_variables: &coreos_calico_aio_variables
  258. # stage: deploy-gce-part1
  259. AUTHORIZATION_MODES: "{ 'authorization_modes': [ 'RBAC' ] }"
  260. KUBE_NETWORK_PLUGIN: calico
  261. CLOUD_IMAGE: coreos-stable-1465-6-0-v20170817
  262. CLOUD_REGION: us-west1-b
  263. CLOUD_MACHINE_TYPE: "n1-standard-2"
  264. CLUSTER_MODE: aio
  265. BOOTSTRAP_OS: coreos
  266. RESOLVCONF_MODE: host_resolvconf # This is required as long as the CoreOS stable channel uses docker < 1.12
  267. ##User-data to simply turn off coreos upgrades
  268. STARTUP_SCRIPT: 'systemctl disable locksmithd && systemctl stop locksmithd'
  269. .ubuntu_canal_ha_rbac_variables: &ubuntu_canal_ha_rbac_variables
  270. # stage: deploy-gce-part1
  271. KUBE_NETWORK_PLUGIN: canal
  272. AUTHORIZATION_MODES: "{ 'authorization_modes': [ 'RBAC' ] }"
  273. CLOUD_IMAGE: ubuntu-1604-xenial
  274. CLOUD_REGION: europe-west1-b
  275. CLUSTER_MODE: ha
  276. UPGRADE_TEST: "graceful"
  277. STARTUP_SCRIPT: ""
  278. .ubuntu_canal_kubeadm_variables: &ubuntu_canal_kubeadm_variables
  279. # stage: deploy-gce-part1
  280. KUBE_NETWORK_PLUGIN: canal
  281. AUTHORIZATION_MODES: "{ 'authorization_modes': [ 'RBAC' ] }"
  282. CLOUD_IMAGE: ubuntu-1604-xenial
  283. CLOUD_MACHINE_TYPE: "n1-standard-2"
  284. CLOUD_REGION: europe-west1-b
  285. CLUSTER_MODE: ha
  286. KUBEADM_ENABLED: "true"
  287. STARTUP_SCRIPT: ""
  288. .rhel7_weave_variables: &rhel7_weave_variables
  289. # stage: deploy-gce-part1
  290. KUBE_NETWORK_PLUGIN: weave
  291. CLOUD_IMAGE: rhel-7
  292. CLOUD_REGION: europe-west1-b
  293. CLUSTER_MODE: default
  294. STARTUP_SCRIPT: ""
  295. .centos7_flannel_variables: &centos7_flannel_variables
  296. # stage: deploy-gce-part2
  297. KUBE_NETWORK_PLUGIN: flannel
  298. CLOUD_IMAGE: centos-7
  299. CLOUD_REGION: us-west1-a
  300. CLOUD_MACHINE_TYPE: "n1-standard-2"
  301. CLUSTER_MODE: default
  302. STARTUP_SCRIPT: ""
  303. .debian8_calico_variables: &debian8_calico_variables
  304. # stage: deploy-gce-part2
  305. KUBE_NETWORK_PLUGIN: calico
  306. CLOUD_IMAGE: debian-8-kubespray
  307. CLOUD_REGION: us-central1-b
  308. CLUSTER_MODE: default
  309. STARTUP_SCRIPT: ""
  310. .coreos_canal_variables: &coreos_canal_variables
  311. # stage: deploy-gce-part2
  312. KUBE_NETWORK_PLUGIN: canal
  313. CLOUD_IMAGE: coreos-stable-1465-6-0-v20170817
  314. CLOUD_REGION: us-east1-b
  315. CLUSTER_MODE: default
  316. BOOTSTRAP_OS: coreos
  317. IDEMPOT_CHECK: "true"
  318. RESOLVCONF_MODE: host_resolvconf # This is required as long as the CoreOS stable channel uses docker < 1.12
  319. STARTUP_SCRIPT: 'systemctl disable locksmithd && systemctl stop locksmithd'
  320. .rhel7_canal_sep_variables: &rhel7_canal_sep_variables
  321. # stage: deploy-gce-special
  322. KUBE_NETWORK_PLUGIN: canal
  323. CLOUD_IMAGE: rhel-7
  324. CLOUD_REGION: us-east1-b
  325. CLUSTER_MODE: separate
  326. STARTUP_SCRIPT: ""
  327. .ubuntu_weave_sep_variables: &ubuntu_weave_sep_variables
  328. # stage: deploy-gce-special
  329. KUBE_NETWORK_PLUGIN: weave
  330. CLOUD_IMAGE: ubuntu-1604-xenial
  331. CLOUD_REGION: us-central1-b
  332. CLUSTER_MODE: separate
  333. IDEMPOT_CHECK: "false"
  334. STARTUP_SCRIPT: ""
  335. .centos7_calico_ha_variables: &centos7_calico_ha_variables
  336. # stage: deploy-gce-special
  337. KUBE_NETWORK_PLUGIN: calico
  338. DOWNLOAD_LOCALHOST: "true"
  339. DOWNLOAD_RUN_ONCE: "true"
  340. CLOUD_IMAGE: centos-7
  341. CLOUD_REGION: europe-west1-b
  342. CLUSTER_MODE: ha-scale
  343. IDEMPOT_CHECK: "true"
  344. STARTUP_SCRIPT: ""
  345. .coreos_alpha_weave_ha_variables: &coreos_alpha_weave_ha_variables
  346. # stage: deploy-gce-special
  347. KUBE_NETWORK_PLUGIN: weave
  348. CLOUD_IMAGE: coreos-alpha-1506-0-0-v20170817
  349. CLOUD_REGION: us-west1-a
  350. CLUSTER_MODE: ha-scale
  351. BOOTSTRAP_OS: coreos
  352. RESOLVCONF_MODE: host_resolvconf # This is required as long as the CoreOS stable channel uses docker < 1.12
  353. STARTUP_SCRIPT: 'systemctl disable locksmithd && systemctl stop locksmithd'
  354. .ubuntu_rkt_sep_variables: &ubuntu_rkt_sep_variables
  355. # stage: deploy-gce-part1
  356. KUBE_NETWORK_PLUGIN: flannel
  357. CLOUD_IMAGE: ubuntu-1604-xenial
  358. CLOUD_REGION: us-central1-b
  359. CLUSTER_MODE: separate
  360. ETCD_DEPLOYMENT: rkt
  361. KUBELET_DEPLOYMENT: rkt
  362. STARTUP_SCRIPT: ""
  363. .ubuntu_vault_sep_variables: &ubuntu_vault_sep_variables
  364. # stage: deploy-gce-part1
  365. AUTHORIZATION_MODES: "{ 'authorization_modes': [ 'RBAC' ] }"
  366. CLOUD_MACHINE_TYPE: "n1-standard-2"
  367. KUBE_NETWORK_PLUGIN: canal
  368. CERT_MGMT: vault
  369. CLOUD_IMAGE: ubuntu-1604-xenial
  370. CLOUD_REGION: us-central1-b
  371. CLUSTER_MODE: separate
  372. STARTUP_SCRIPT: ""
  373. .ubuntu_flannel_rbac_variables: &ubuntu_flannel_rbac_variables
  374. # stage: deploy-gce-special
  375. AUTHORIZATION_MODES: "{ 'authorization_modes': [ 'RBAC' ] }"
  376. KUBE_NETWORK_PLUGIN: flannel
  377. CLOUD_IMAGE: ubuntu-1604-xenial
  378. CLOUD_REGION: europe-west1-b
  379. CLUSTER_MODE: separate
  380. STARTUP_SCRIPT: ""
  381. # Builds for PRs only (premoderated by unit-tests step) and triggers (auto)
  382. coreos-calico-aio:
  383. stage: deploy-gce-part1
  384. <<: *job
  385. <<: *gce
  386. variables:
  387. <<: *gce_variables
  388. <<: *coreos_calico_aio_variables
  389. when: on_success
  390. except: ['triggers']
  391. only: [/^pr-.*$/]
  392. coreos-calico-sep-triggers:
  393. stage: deploy-gce-part1
  394. <<: *job
  395. <<: *gce
  396. variables:
  397. <<: *gce_variables
  398. <<: *coreos_calico_aio_variables
  399. when: on_success
  400. only: ['triggers']
  401. centos7-flannel:
  402. stage: deploy-gce-part2
  403. <<: *job
  404. <<: *gce
  405. variables:
  406. <<: *gce_variables
  407. <<: *centos7_flannel_variables
  408. when: on_success
  409. except: ['triggers']
  410. only: [/^pr-.*$/]
  411. centos7-flannel-triggers:
  412. stage: deploy-gce-part1
  413. <<: *job
  414. <<: *gce
  415. variables:
  416. <<: *gce_variables
  417. <<: *centos7_flannel_variables
  418. when: on_success
  419. only: ['triggers']
  420. ubuntu-weave-sep:
  421. stage: deploy-gce-special
  422. <<: *job
  423. <<: *gce
  424. variables:
  425. <<: *gce_variables
  426. <<: *ubuntu_weave_sep_variables
  427. when: on_success
  428. except: ['triggers']
  429. only: [/^pr-.*$/]
  430. ubuntu-weave-sep-triggers:
  431. stage: deploy-gce-part1
  432. <<: *job
  433. <<: *gce
  434. variables:
  435. <<: *gce_variables
  436. <<: *ubuntu_weave_sep_variables
  437. when: on_success
  438. only: ['triggers']
  439. # More builds for PRs/merges (manual) and triggers (auto)
  440. ubuntu-canal-ha-rbac:
  441. stage: deploy-gce-part1
  442. <<: *job
  443. <<: *gce
  444. variables:
  445. <<: *gce_variables
  446. <<: *ubuntu_canal_ha_rbac_variables
  447. when: manual
  448. except: ['triggers']
  449. only: ['master', /^pr-.*$/]
  450. ubuntu-canal-ha-rbac-triggers:
  451. stage: deploy-gce-part1
  452. <<: *job
  453. <<: *gce
  454. variables:
  455. <<: *gce_variables
  456. <<: *ubuntu_canal_ha_rbac_variables
  457. when: on_success
  458. only: ['triggers']
  459. ubuntu-canal-kubeadm-rbac:
  460. stage: deploy-gce-part1
  461. <<: *job
  462. <<: *gce
  463. variables:
  464. <<: *gce_variables
  465. <<: *ubuntu_canal_kubeadm_variables
  466. when: manual
  467. except: ['triggers']
  468. only: ['master', /^pr-.*$/]
  469. ubuntu-canal-kubeadm-triggers:
  470. stage: deploy-gce-part1
  471. <<: *job
  472. <<: *gce
  473. variables:
  474. <<: *gce_variables
  475. <<: *ubuntu_canal_kubeadm_variables
  476. when: on_success
  477. only: ['triggers']
  478. rhel7-weave:
  479. stage: deploy-gce-part1
  480. <<: *job
  481. <<: *gce
  482. variables:
  483. <<: *gce_variables
  484. <<: *rhel7_weave_variables
  485. when: manual
  486. except: ['triggers']
  487. only: ['master', /^pr-.*$/]
  488. rhel7-weave-triggers:
  489. stage: deploy-gce-part1
  490. <<: *job
  491. <<: *gce
  492. variables:
  493. <<: *gce_variables
  494. <<: *rhel7_weave_variables
  495. when: on_success
  496. only: ['triggers']
  497. debian8-calico-upgrade:
  498. stage: deploy-gce-part2
  499. <<: *job
  500. <<: *gce
  501. variables:
  502. <<: *gce_variables
  503. <<: *debian8_calico_variables
  504. when: manual
  505. except: ['triggers']
  506. only: ['master', /^pr-.*$/]
  507. debian8-calico-triggers:
  508. stage: deploy-gce-part1
  509. <<: *job
  510. <<: *gce
  511. variables:
  512. <<: *gce_variables
  513. <<: *debian8_calico_variables
  514. when: on_success
  515. only: ['triggers']
  516. coreos-canal:
  517. stage: deploy-gce-part2
  518. <<: *job
  519. <<: *gce
  520. variables:
  521. <<: *gce_variables
  522. <<: *coreos_canal_variables
  523. when: manual
  524. except: ['triggers']
  525. only: ['master', /^pr-.*$/]
  526. coreos-canal-triggers:
  527. stage: deploy-gce-part1
  528. <<: *job
  529. <<: *gce
  530. variables:
  531. <<: *gce_variables
  532. <<: *coreos_canal_variables
  533. when: on_success
  534. only: ['triggers']
  535. rhel7-canal-sep:
  536. stage: deploy-gce-special
  537. <<: *job
  538. <<: *gce
  539. variables:
  540. <<: *gce_variables
  541. <<: *rhel7_canal_sep_variables
  542. when: manual
  543. except: ['triggers']
  544. only: ['master', /^pr-.*$/,]
  545. rhel7-canal-sep-triggers:
  546. stage: deploy-gce-part1
  547. <<: *job
  548. <<: *gce
  549. variables:
  550. <<: *gce_variables
  551. <<: *rhel7_canal_sep_variables
  552. when: on_success
  553. only: ['triggers']
  554. centos7-calico-ha:
  555. stage: deploy-gce-special
  556. <<: *job
  557. <<: *gce
  558. variables:
  559. <<: *gce_variables
  560. <<: *centos7_calico_ha_variables
  561. when: manual
  562. except: ['triggers']
  563. only: ['master', /^pr-.*$/]
  564. centos7-calico-ha-triggers:
  565. stage: deploy-gce-part1
  566. <<: *job
  567. <<: *gce
  568. variables:
  569. <<: *gce_variables
  570. <<: *centos7_calico_ha_variables
  571. when: on_success
  572. only: ['triggers']
  573. # no triggers yet https://github.com/kubernetes-incubator/kargo/issues/613
  574. coreos-alpha-weave-ha:
  575. stage: deploy-gce-special
  576. <<: *job
  577. <<: *gce
  578. variables:
  579. <<: *gce_variables
  580. <<: *coreos_alpha_weave_ha_variables
  581. when: manual
  582. except: ['triggers']
  583. only: ['master', /^pr-.*$/]
  584. ubuntu-rkt-sep:
  585. stage: deploy-gce-part1
  586. <<: *job
  587. <<: *gce
  588. variables:
  589. <<: *gce_variables
  590. <<: *ubuntu_rkt_sep_variables
  591. when: manual
  592. except: ['triggers']
  593. only: ['master', /^pr-.*$/]
  594. ubuntu-vault-sep:
  595. stage: deploy-gce-part1
  596. <<: *job
  597. <<: *gce
  598. variables:
  599. <<: *gce_variables
  600. <<: *ubuntu_vault_sep_variables
  601. when: manual
  602. except: ['triggers']
  603. only: ['master', /^pr-.*$/]
  604. ubuntu-flannel-rbac-sep:
  605. stage: deploy-gce-special
  606. <<: *job
  607. <<: *gce
  608. variables:
  609. <<: *gce_variables
  610. <<: *ubuntu_flannel_rbac_variables
  611. when: manual
  612. except: ['triggers']
  613. only: ['master', /^pr-.*$/]
  614. # Premoderated with manual actions
  615. ci-authorized:
  616. <<: *job
  617. stage: moderator
  618. before_script:
  619. - apt-get -y install jq
  620. script:
  621. - /bin/sh scripts/premoderator.sh
  622. except: ['triggers', 'master']
  623. syntax-check:
  624. <<: *job
  625. stage: unit-tests
  626. script:
  627. - ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root cluster.yml -vvv --syntax-check
  628. - ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root upgrade-cluster.yml -vvv --syntax-check
  629. - ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root reset.yml -vvv --syntax-check
  630. - ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root extra_playbooks/upgrade-only-k8s.yml -vvv --syntax-check
  631. except: ['triggers', 'master']
  632. yamllint:
  633. <<: *job
  634. stage: unit-tests
  635. script:
  636. - yamllint roles
  637. except: ['triggers', 'master']
  638. tox-inventory-builder:
  639. stage: unit-tests
  640. <<: *job
  641. script:
  642. - pip install tox
  643. - cd contrib/inventory_builder && tox
  644. when: manual
  645. except: ['triggers', 'master']