Skip to content
Snippets Groups Projects
Makefile 1.61 KiB
Newer Older
  • Learn to ignore specific revisions
  • $(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
    
    Antoine Legrand's avatar
    Antoine Legrand committed
    	echo "$(GCE_CREDENTIALS_B64)" > $(HOME)/.ssh/gce.json
    
    
    init-do: $(HOME)/.ssh/id_rsa
    
    Antoine Legrand's avatar
    Antoine Legrand committed
    	pip install dopy==0.3.5
    
    	echo $(DO_PRIVATE_KEY) | base64 -d > $(HOME)/.ssh/id_rsa
    
    create-gce: init-gce
    	ansible-playbook cloud_playbooks/create-gce.yml -i local_inventory/hosts.cfg -c local \
    	$(LOG_LEVEL) \
    
    Antoine Legrand's avatar
    Antoine Legrand committed
    	-e @"files/${CI_JOB_NAME}.yml" \
    
    	-e gce_credentials_file=$(HOME)/.ssh/gce.json \
    	-e gce_project_id=$(GCE_PROJECT_ID) \
    	-e gce_service_account_email=$(GCE_ACCOUNT) \
    	-e inventory_path=$(PWD)/../inventory/sample/hosts.ini \
    	-e test_id=$(TEST_ID) \
    	-e preemptible=$(GCE_PREEMPTIBLE)
    
    
    delete-gce:
    	ansible-playbook -i ../inventory/sample/hosts.ini cloud_playbooks/delete-gce.yml -c local \
    	$(LOG_LEVEL) \
    
    Antoine Legrand's avatar
    Antoine Legrand committed
    	-e @"files/${CI_JOB_NAME}.yml" \
    
    	-e test_id=$(TEST_ID) \
    	-e gce_project_id=$(GCE_PROJECT_ID) \
    	-e gce_service_account_email=$(GCE_ACCOUNT) \
    	-e gce_credentials_file=$(HOME)/.ssh/gce.json \
    	-e inventory_path=$(PWD)/inventory/sample/hosts.ini
    
    create-do: init-do
    
    Antoine Legrand's avatar
    Antoine Legrand committed
    	ansible-playbook cloud_playbooks/create-do.yml -i local_inventory/hosts.cfg -c local \
    
    Antoine Legrand's avatar
    Antoine Legrand committed
    	-e @"files/${CI_JOB_NAME}.yml" \
    
    	-e inventory_path=${PWD}/../inventory/hosts.ini \
    	-e test_id=${TEST_ID}
    
    
    delete-do:
    
    Antoine Legrand's avatar
    Antoine Legrand committed
    	ansible-playbook -i ../inventory/sample/hosts.ini cloud_playbooks/create-do.yml -c local \
    
    Antoine Legrand's avatar
    Antoine Legrand committed
    	-e @"files/${CI_JOB_NAME}.yml" \
    
    	-e state=absent \
    	-e test_id=${TEST_ID} \
    	-e inventory_path=${PWD}/../inventory/inventory.ini \