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.

50 lines
1.5 KiB

  1. $(HOME)/.ssh/id_rsa:
  2. mkdir -p $(HOME)/.ssh
  3. echo $(PRIVATE_KEY) | base64 -d > $(HOME)/.ssh/id_rsa
  4. chmod 400 $(HOME)/.ssh/id_rsa
  5. init-gce: $(HOME)/.ssh/id_rsa
  6. # echo $(GCE_PEM_FILE) | base64 -d > $(HOME)/.ssh/gce
  7. echo "$(GCE_CREDENTIALS)" > $(HOME)/.ssh/gce.json
  8. init-do: $(HOME)/.ssh/id_rsa
  9. pip install dopy
  10. echo $(DO_PRIVATE_KEY) | base64 -d > $(HOME)/.ssh/id_rsa
  11. create-gce: init-gce
  12. ansible-playbook cloud_playbooks/create-gce.yml -i local_inventory/hosts.cfg -c local \
  13. $(LOG_LEVEL) \
  14. -e @$(CI_TEST_VARS) \
  15. -e gce_credentials_file=$(HOME)/.ssh/gce.json \
  16. -e gce_project_id=$(GCE_PROJECT_ID) \
  17. -e gce_service_account_email=$(GCE_ACCOUNT) \
  18. -e inventory_path=$(PWD)/../inventory/sample/hosts.ini \
  19. -e test_id=$(TEST_ID) \
  20. -e preemptible=$(GCE_PREEMPTIBLE)
  21. delete-gce:
  22. ansible-playbook -i ../inventory/sample/hosts.ini cloud_playbooks/delete-gce.yml -c local \
  23. $(LOG_LEVEL) \
  24. -e @$(CI_TEST_VARS) \
  25. -e test_id=$(TEST_ID) \
  26. -e gce_project_id=$(GCE_PROJECT_ID) \
  27. -e gce_service_account_email=$(GCE_ACCOUNT) \
  28. -e gce_credentials_file=$(HOME)/.ssh/gce.json \
  29. -e inventory_path=$(PWD)/inventory/sample/hosts.ini
  30. create-do: init-do
  31. ansible-playbook cloud_playbooks/create-do.yml -i tests/local_inventory/hosts.cfg -c local \
  32. ${LOG_LEVEL} \
  33. -e @$(CI_TEST_VARS) \
  34. -e inventory_path=${PWD}/../inventory/hosts.ini \
  35. -e test_id=${TEST_ID}
  36. delete-do:
  37. ansible-playbook -i ../inventory/sample/hosts.ini tests/cloud_playbooks/create-do.yml -c local \
  38. $LOG_LEVEL \
  39. -e state=absent \
  40. -e test_id=${TEST_ID} \
  41. -e inventory_path=${PWD}/../inventory/inventory.ini \