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.

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