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.

42 lines
1.1 KiB

  1. INVENTORY=$(PWD)/../inventory/sample/${CI_JOB_NAME}-${BUILD_NUMBER}.ini
  2. init-packet:
  3. mkdir -p $(HOME)/.ssh
  4. echo $(PACKET_VM_SSH_PRIVATE_KEY) | base64 -d > $(HOME)/.ssh/id_rsa
  5. chmod 400 $(HOME)/.ssh/id_rsa
  6. create-tf:
  7. ./scripts/create-tf.sh
  8. delete-tf:
  9. ./scripts/delete-tf.sh
  10. create-packet: init-packet
  11. ansible-playbook cloud_playbooks/create-packet.yml -c local \
  12. $(ANSIBLE_LOG_LEVEL) \
  13. -e @"files/${CI_JOB_NAME}.yml" \
  14. -e test_id=$(TEST_ID) \
  15. -e branch="$(CI_COMMIT_BRANCH)" \
  16. -e pipeline_id="$(CI_PIPELINE_ID)" \
  17. -e inventory_path=$(INVENTORY)
  18. delete-packet:
  19. ansible-playbook cloud_playbooks/delete-packet.yml -c local \
  20. $(ANSIBLE_LOG_LEVEL) \
  21. -e @"files/${CI_JOB_NAME}.yml" \
  22. -e test_id=$(TEST_ID) \
  23. -e branch="$(CI_COMMIT_BRANCH)" \
  24. -e pipeline_id="$(CI_PIPELINE_ID)" \
  25. -e inventory_path=$(INVENTORY)
  26. cleanup-packet:
  27. ansible-playbook cloud_playbooks/cleanup-packet.yml -c local \
  28. $(ANSIBLE_LOG_LEVEL)
  29. create-vagrant:
  30. vagrant up
  31. cp $(CI_PROJECT_DIR)/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory $(INVENTORY)
  32. delete-vagrant:
  33. vagrant destroy -f