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.

653 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. KUBE_NETWORK_PLUGIN: calico
  241. CLOUD_IMAGE: coreos-stable-1465-6-0-v20170817
  242. CLOUD_REGION: us-west1-b
  243. CLOUD_MACHINE_TYPE: "n1-standard-2"
  244. CLUSTER_MODE: separate
  245. BOOTSTRAP_OS: coreos
  246. RESOLVCONF_MODE: host_resolvconf # This is required as long as the CoreOS stable channel uses docker < 1.12
  247. ##User-data to simply turn off coreos upgrades
  248. STARTUP_SCRIPT: 'systemctl disable locksmithd && systemctl stop locksmithd'
  249. .ubuntu_canal_ha_variables: &ubuntu_canal_ha_variables
  250. # stage: deploy-gce-part1
  251. KUBE_NETWORK_PLUGIN: canal
  252. CLOUD_IMAGE: ubuntu-1604-xenial
  253. CLOUD_REGION: europe-west1-b
  254. CLUSTER_MODE: ha
  255. UPGRADE_TEST: "graceful"
  256. STARTUP_SCRIPT: ""
  257. .rhel7_weave_variables: &rhel7_weave_variables
  258. # stage: deploy-gce-part1
  259. KUBE_NETWORK_PLUGIN: weave
  260. CLOUD_IMAGE: rhel-7
  261. CLOUD_REGION: europe-west1-b
  262. CLUSTER_MODE: default
  263. STARTUP_SCRIPT: ""
  264. .centos7_flannel_variables: &centos7_flannel_variables
  265. # stage: deploy-gce-part2
  266. KUBE_NETWORK_PLUGIN: flannel
  267. CLOUD_IMAGE: centos-7
  268. CLOUD_REGION: us-west1-a
  269. CLOUD_MACHINE_TYPE: "n1-standard-2"
  270. CLUSTER_MODE: default
  271. STARTUP_SCRIPT: ""
  272. .debian8_calico_variables: &debian8_calico_variables
  273. # stage: deploy-gce-part2
  274. KUBE_NETWORK_PLUGIN: calico
  275. CLOUD_IMAGE: debian-8-kubespray
  276. CLOUD_REGION: us-central1-b
  277. CLUSTER_MODE: default
  278. STARTUP_SCRIPT: ""
  279. .coreos_canal_variables: &coreos_canal_variables
  280. # stage: deploy-gce-part2
  281. KUBE_NETWORK_PLUGIN: canal
  282. CLOUD_IMAGE: coreos-stable-1465-6-0-v20170817
  283. CLOUD_REGION: us-east1-b
  284. CLUSTER_MODE: default
  285. BOOTSTRAP_OS: coreos
  286. IDEMPOT_CHECK: "true"
  287. RESOLVCONF_MODE: host_resolvconf # This is required as long as the CoreOS stable channel uses docker < 1.12
  288. STARTUP_SCRIPT: 'systemctl disable locksmithd && systemctl stop locksmithd'
  289. .rhel7_canal_sep_variables: &rhel7_canal_sep_variables
  290. # stage: deploy-gce-special
  291. KUBE_NETWORK_PLUGIN: canal
  292. CLOUD_IMAGE: rhel-7
  293. CLOUD_REGION: us-east1-b
  294. CLUSTER_MODE: separate
  295. STARTUP_SCRIPT: ""
  296. .ubuntu_weave_sep_variables: &ubuntu_weave_sep_variables
  297. # stage: deploy-gce-special
  298. KUBE_NETWORK_PLUGIN: weave
  299. CLOUD_IMAGE: ubuntu-1604-xenial
  300. CLOUD_REGION: us-central1-b
  301. CLUSTER_MODE: separate
  302. IDEMPOT_CHECK: "false"
  303. STARTUP_SCRIPT: ""
  304. .centos7_calico_ha_variables: &centos7_calico_ha_variables
  305. # stage: deploy-gce-special
  306. KUBE_NETWORK_PLUGIN: calico
  307. DOWNLOAD_LOCALHOST: "true"
  308. DOWNLOAD_RUN_ONCE: "true"
  309. CLOUD_IMAGE: centos-7
  310. CLOUD_REGION: europe-west1-b
  311. CLUSTER_MODE: ha-scale
  312. IDEMPOT_CHECK: "true"
  313. STARTUP_SCRIPT: ""
  314. .coreos_alpha_weave_ha_variables: &coreos_alpha_weave_ha_variables
  315. # stage: deploy-gce-special
  316. KUBE_NETWORK_PLUGIN: weave
  317. CLOUD_IMAGE: coreos-alpha-1506-0-0-v20170817
  318. CLOUD_REGION: us-west1-a
  319. CLUSTER_MODE: ha-scale
  320. BOOTSTRAP_OS: coreos
  321. RESOLVCONF_MODE: host_resolvconf # This is required as long as the CoreOS stable channel uses docker < 1.12
  322. STARTUP_SCRIPT: 'systemctl disable locksmithd && systemctl stop locksmithd'
  323. .ubuntu_rkt_sep_variables: &ubuntu_rkt_sep_variables
  324. # stage: deploy-gce-part1
  325. KUBE_NETWORK_PLUGIN: flannel
  326. CLOUD_IMAGE: ubuntu-1604-xenial
  327. CLOUD_REGION: us-central1-b
  328. CLUSTER_MODE: separate
  329. ETCD_DEPLOYMENT: rkt
  330. KUBELET_DEPLOYMENT: rkt
  331. STARTUP_SCRIPT: ""
  332. .ubuntu_vault_sep_variables: &ubuntu_vault_sep_variables
  333. # stage: deploy-gce-part1
  334. KUBE_NETWORK_PLUGIN: canal
  335. CERT_MGMT: vault
  336. CLOUD_IMAGE: ubuntu-1604-xenial
  337. CLOUD_REGION: us-central1-b
  338. CLUSTER_MODE: separate
  339. STARTUP_SCRIPT: ""
  340. .ubuntu_flannel_rbac_variables: &ubuntu_flannel_rbac_variables
  341. # stage: deploy-gce-special
  342. AUTHORIZATION_MODES: "{ 'authorization_modes': [ 'RBAC' ] }"
  343. KUBE_NETWORK_PLUGIN: flannel
  344. CLOUD_IMAGE: ubuntu-1604-xenial
  345. CLOUD_REGION: europe-west1-b
  346. CLUSTER_MODE: separate
  347. STARTUP_SCRIPT: ""
  348. # Builds for PRs only (premoderated by unit-tests step) and triggers (auto)
  349. coreos-calico-sep:
  350. stage: deploy-gce-part1
  351. <<: *job
  352. <<: *gce
  353. variables:
  354. <<: *gce_variables
  355. <<: *coreos_calico_sep_variables
  356. when: on_success
  357. except: ['triggers']
  358. only: [/^pr-.*$/]
  359. coreos-calico-sep-triggers:
  360. stage: deploy-gce-part1
  361. <<: *job
  362. <<: *gce
  363. variables:
  364. <<: *gce_variables
  365. <<: *coreos_calico_sep_variables
  366. when: on_success
  367. only: ['triggers']
  368. centos7-flannel:
  369. stage: deploy-gce-part2
  370. <<: *job
  371. <<: *gce
  372. variables:
  373. <<: *gce_variables
  374. <<: *centos7_flannel_variables
  375. when: on_success
  376. except: ['triggers']
  377. only: [/^pr-.*$/]
  378. centos7-flannel-triggers:
  379. stage: deploy-gce-part1
  380. <<: *job
  381. <<: *gce
  382. variables:
  383. <<: *gce_variables
  384. <<: *centos7_flannel_variables
  385. when: on_success
  386. only: ['triggers']
  387. ubuntu-weave-sep:
  388. stage: deploy-gce-special
  389. <<: *job
  390. <<: *gce
  391. variables:
  392. <<: *gce_variables
  393. <<: *ubuntu_weave_sep_variables
  394. when: on_success
  395. except: ['triggers']
  396. only: [/^pr-.*$/]
  397. ubuntu-weave-sep-triggers:
  398. stage: deploy-gce-part1
  399. <<: *job
  400. <<: *gce
  401. variables:
  402. <<: *gce_variables
  403. <<: *ubuntu_weave_sep_variables
  404. when: on_success
  405. only: ['triggers']
  406. # More builds for PRs/merges (manual) and triggers (auto)
  407. ubuntu-canal-ha:
  408. stage: deploy-gce-part1
  409. <<: *job
  410. <<: *gce
  411. variables:
  412. <<: *gce_variables
  413. <<: *ubuntu_canal_ha_variables
  414. when: manual
  415. except: ['triggers']
  416. only: ['master', /^pr-.*$/]
  417. ubuntu-canal-ha-triggers:
  418. stage: deploy-gce-part1
  419. <<: *job
  420. <<: *gce
  421. variables:
  422. <<: *gce_variables
  423. <<: *ubuntu_canal_ha_variables
  424. when: on_success
  425. only: ['triggers']
  426. rhel7-weave:
  427. stage: deploy-gce-part1
  428. <<: *job
  429. <<: *gce
  430. variables:
  431. <<: *gce_variables
  432. <<: *rhel7_weave_variables
  433. when: manual
  434. except: ['triggers']
  435. only: ['master', /^pr-.*$/]
  436. rhel7-weave-triggers:
  437. stage: deploy-gce-part1
  438. <<: *job
  439. <<: *gce
  440. variables:
  441. <<: *gce_variables
  442. <<: *rhel7_weave_variables
  443. when: on_success
  444. only: ['triggers']
  445. debian8-calico-upgrade:
  446. stage: deploy-gce-part2
  447. <<: *job
  448. <<: *gce
  449. variables:
  450. <<: *gce_variables
  451. <<: *debian8_calico_variables
  452. when: manual
  453. except: ['triggers']
  454. only: ['master', /^pr-.*$/]
  455. debian8-calico-triggers:
  456. stage: deploy-gce-part1
  457. <<: *job
  458. <<: *gce
  459. variables:
  460. <<: *gce_variables
  461. <<: *debian8_calico_variables
  462. when: on_success
  463. only: ['triggers']
  464. coreos-canal:
  465. stage: deploy-gce-part2
  466. <<: *job
  467. <<: *gce
  468. variables:
  469. <<: *gce_variables
  470. <<: *coreos_canal_variables
  471. when: manual
  472. except: ['triggers']
  473. only: ['master', /^pr-.*$/]
  474. coreos-canal-triggers:
  475. stage: deploy-gce-part1
  476. <<: *job
  477. <<: *gce
  478. variables:
  479. <<: *gce_variables
  480. <<: *coreos_canal_variables
  481. when: on_success
  482. only: ['triggers']
  483. rhel7-canal-sep:
  484. stage: deploy-gce-special
  485. <<: *job
  486. <<: *gce
  487. variables:
  488. <<: *gce_variables
  489. <<: *rhel7_canal_sep_variables
  490. when: manual
  491. except: ['triggers']
  492. only: ['master', /^pr-.*$/,]
  493. rhel7-canal-sep-triggers:
  494. stage: deploy-gce-part1
  495. <<: *job
  496. <<: *gce
  497. variables:
  498. <<: *gce_variables
  499. <<: *rhel7_canal_sep_variables
  500. when: on_success
  501. only: ['triggers']
  502. centos7-calico-ha:
  503. stage: deploy-gce-special
  504. <<: *job
  505. <<: *gce
  506. variables:
  507. <<: *gce_variables
  508. <<: *centos7_calico_ha_variables
  509. when: manual
  510. except: ['triggers']
  511. only: ['master', /^pr-.*$/]
  512. centos7-calico-ha-triggers:
  513. stage: deploy-gce-part1
  514. <<: *job
  515. <<: *gce
  516. variables:
  517. <<: *gce_variables
  518. <<: *centos7_calico_ha_variables
  519. when: on_success
  520. only: ['triggers']
  521. # no triggers yet https://github.com/kubernetes-incubator/kargo/issues/613
  522. coreos-alpha-weave-ha:
  523. stage: deploy-gce-special
  524. <<: *job
  525. <<: *gce
  526. variables:
  527. <<: *gce_variables
  528. <<: *coreos_alpha_weave_ha_variables
  529. when: manual
  530. except: ['triggers']
  531. only: ['master', /^pr-.*$/]
  532. ubuntu-rkt-sep:
  533. stage: deploy-gce-part1
  534. <<: *job
  535. <<: *gce
  536. variables:
  537. <<: *gce_variables
  538. <<: *ubuntu_rkt_sep_variables
  539. when: manual
  540. except: ['triggers']
  541. only: ['master', /^pr-.*$/]
  542. ubuntu-vault-sep:
  543. stage: deploy-gce-part1
  544. <<: *job
  545. <<: *gce
  546. variables:
  547. <<: *gce_variables
  548. <<: *ubuntu_vault_sep_variables
  549. when: manual
  550. except: ['triggers']
  551. only: ['master', /^pr-.*$/]
  552. ubuntu-flannel-rbac-sep:
  553. stage: deploy-gce-special
  554. <<: *job
  555. <<: *gce
  556. variables:
  557. <<: *gce_variables
  558. <<: *ubuntu_flannel_rbac_variables
  559. when: manual
  560. except: ['triggers']
  561. only: ['master', /^pr-.*$/]
  562. # Premoderated with manual actions
  563. ci-authorized:
  564. <<: *job
  565. stage: moderator
  566. before_script:
  567. - apt-get -y install jq
  568. script:
  569. - /bin/sh scripts/premoderator.sh
  570. except: ['triggers', 'master']
  571. syntax-check:
  572. <<: *job
  573. stage: unit-tests
  574. script:
  575. - ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root cluster.yml -vvv --syntax-check
  576. - ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root upgrade-cluster.yml -vvv --syntax-check
  577. - ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root reset.yml -vvv --syntax-check
  578. - 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
  579. except: ['triggers', 'master']
  580. yamllint:
  581. <<: *job
  582. stage: unit-tests
  583. script:
  584. - yamllint roles
  585. except: ['triggers', 'master']
  586. tox-inventory-builder:
  587. stage: unit-tests
  588. <<: *job
  589. script:
  590. - pip install tox
  591. - cd contrib/inventory_builder && tox
  592. when: manual
  593. except: ['triggers', 'master']