myos/make/apps/deploy.mk

25 lines
1012 B
Makefile
Raw Normal View History

2021-05-31 03:45:39 +02:00
##
# DEPLOY
2021-02-09 17:05:00 +01:00
.PHONY: deploy app-deploy
# target deploy: Run post install hooks in the deployed application
## Called by ansible after creation of the docker application on remote host
2021-05-31 03:45:39 +02:00
deploy: app-deploy deploy-ping ## Run post install hooks in the deployed application
2021-02-09 17:05:00 +01:00
.PHONY: deploy@%
# target deploy@%: Deploy application docker images
## tag and push docker images to docker registry
## run ansible-pull on hosts to pull docker images from the registry
## tag and push docker images as latest to docker registry
2021-05-17 03:40:02 +02:00
deploy@%: myos-base build@% ## Deploy application docker images
2021-02-09 17:05:00 +01:00
$(call make,docker-login docker-tag docker-push)
2021-05-17 03:40:02 +02:00
$(call make,myos-ansible-pull@$(ENV) ANSIBLE_DOCKER_IMAGE_TAG=$(VERSION) ANSIBLE_TAGS=aws,,APP AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY)
2021-02-09 17:05:00 +01:00
$(call make,docker-tag-latest docker-push-latest)
.PHONY: deploy-ping
2021-05-31 03:45:39 +02:00
deploy-ping: deploy-ping-hook
2021-02-09 17:05:00 +01:00
2021-05-31 03:45:39 +02:00
.PHONY: deploy-ping-hook
deploy-ping-hook:
curl -X POST --data-urlencode 'payload={"text": "$(DEPLOY_HOOK_TEXT)"}' $(DEPLOY_HOOK_URL) ||: