2018-04-10 21:02:33 +08:00
|
|
|
INVENTORY=$(PWD)/../inventory/sample/${CI_JOB_NAME}-${BUILD_NUMBER}.ini
|
2018-02-12 23:04:26 +08:00
|
|
|
|
2018-02-12 18:35:37 +08:00
|
|
|
$(HOME)/.ssh/id_rsa:
|
|
|
|
mkdir -p $(HOME)/.ssh
|
|
|
|
echo $(PRIVATE_KEY) | base64 -d > $(HOME)/.ssh/id_rsa
|
|
|
|
chmod 400 $(HOME)/.ssh/id_rsa
|
|
|
|
|
|
|
|
init-gce: $(HOME)/.ssh/id_rsa
|
|
|
|
# echo $(GCE_PEM_FILE) | base64 -d > $(HOME)/.ssh/gce
|
2018-02-12 22:32:40 +08:00
|
|
|
echo "$(GCE_CREDENTIALS_B64)" | base64 -d > $(HOME)/.ssh/gce.json
|
2018-02-12 18:35:37 +08:00
|
|
|
|
|
|
|
init-do: $(HOME)/.ssh/id_rsa
|
|
|
|
echo $(DO_PRIVATE_KEY) | base64 -d > $(HOME)/.ssh/id_rsa
|
|
|
|
|
2019-04-17 05:49:07 +08:00
|
|
|
init-packet:
|
|
|
|
echo $(PACKET_VM_SSH_PRIVATE_KEY) | base64 -d > $(HOME)/.ssh/id_rsa
|
|
|
|
chmod 400 $(HOME)/.ssh/id_rsa
|
|
|
|
|
2019-05-03 03:26:19 +08:00
|
|
|
create-tf:
|
|
|
|
./scripts/create-tf.sh
|
|
|
|
|
|
|
|
delete-tf:
|
|
|
|
./scripts/delete-tf.sh
|
|
|
|
|
2018-02-12 18:35:37 +08:00
|
|
|
create-do: init-do
|
2018-02-12 21:28:59 +08:00
|
|
|
ansible-playbook cloud_playbooks/create-do.yml -i local_inventory/hosts.cfg -c local \
|
2020-04-01 22:23:29 +08:00
|
|
|
${ANSIBLE_LOG_LEVEL} \
|
2018-02-12 21:28:59 +08:00
|
|
|
-e @"files/${CI_JOB_NAME}.yml" \
|
2018-02-12 23:04:26 +08:00
|
|
|
-e inventory_path=$(INVENTORY) \
|
2018-02-12 18:35:37 +08:00
|
|
|
-e test_id=${TEST_ID}
|
|
|
|
|
|
|
|
delete-do:
|
2018-02-12 23:04:26 +08:00
|
|
|
ansible-playbook -i $(INVENTORY) cloud_playbooks/create-do.yml -c local \
|
2020-04-01 22:23:29 +08:00
|
|
|
$(ANSIBLE_LOG_LEVEL) \
|
2018-02-12 21:28:59 +08:00
|
|
|
-e @"files/${CI_JOB_NAME}.yml" \
|
2018-02-12 18:35:37 +08:00
|
|
|
-e state=absent \
|
|
|
|
-e test_id=${TEST_ID} \
|
2018-02-12 23:04:26 +08:00
|
|
|
-e inventory_path=$(INVENTORY)
|
2019-04-17 05:49:07 +08:00
|
|
|
|
|
|
|
create-packet: init-packet
|
|
|
|
ansible-playbook cloud_playbooks/create-packet.yml -c local \
|
2020-04-01 22:23:29 +08:00
|
|
|
$(ANSIBLE_LOG_LEVEL) \
|
2019-04-17 05:49:07 +08:00
|
|
|
-e @"files/${CI_JOB_NAME}.yml" \
|
|
|
|
-e test_id=$(TEST_ID) \
|
2023-06-26 15:57:08 +08:00
|
|
|
-e branch="$(CI_COMMIT_BRANCH)" \
|
|
|
|
-e pipeline_id="$(CI_PIPELINE_ID)" \
|
2019-04-17 05:49:07 +08:00
|
|
|
-e inventory_path=$(INVENTORY)
|
|
|
|
|
|
|
|
delete-packet:
|
|
|
|
ansible-playbook cloud_playbooks/delete-packet.yml -c local \
|
2020-04-01 22:23:29 +08:00
|
|
|
$(ANSIBLE_LOG_LEVEL) \
|
2019-04-17 05:49:07 +08:00
|
|
|
-e @"files/${CI_JOB_NAME}.yml" \
|
|
|
|
-e test_id=$(TEST_ID) \
|
2023-06-26 15:57:08 +08:00
|
|
|
-e branch="$(CI_COMMIT_BRANCH)" \
|
|
|
|
-e pipeline_id="$(CI_PIPELINE_ID)" \
|
2019-04-17 05:49:07 +08:00
|
|
|
-e inventory_path=$(INVENTORY)
|
2020-05-28 15:46:02 +08:00
|
|
|
|
2023-06-26 15:57:08 +08:00
|
|
|
cleanup-packet:
|
|
|
|
ansible-playbook cloud_playbooks/cleanup-packet.yml -c local \
|
|
|
|
$(ANSIBLE_LOG_LEVEL)
|
|
|
|
|
2020-05-28 15:46:02 +08:00
|
|
|
create-vagrant:
|
|
|
|
vagrant up
|
|
|
|
find / -name vagrant_ansible_inventory
|
|
|
|
cp /builds/kargo-ci/kubernetes-sigs-kubespray/inventory/sample/vagrant_ansible_inventory $(INVENTORY)
|
|
|
|
|
|
|
|
delete-vagrant:
|
2022-03-18 09:05:39 +08:00
|
|
|
vagrant destroy -f
|