deploy type copy
This commit is contained in:
parent
37cbb51573
commit
cfc7d1ca0b
15
Makefile
15
Makefile
|
@ -1,5 +1,6 @@
|
|||
.PHONY: self-update create-contexts deploy upload pull start stop restart
|
||||
|
||||
include make-deploy/copy.mk
|
||||
include make-deploy/docker.mk
|
||||
include make-deploy/k8s.mk
|
||||
include make-deploy/cron.mk
|
||||
|
@ -12,9 +13,17 @@ self-update:
|
|||
|
||||
deploy: upload pre-deploy pull start post-deploy
|
||||
|
||||
pre-deploy: pre-deploy-$(DEPLOY_TYPE)
|
||||
|
||||
post-deploy: post-deploy-$(DEPLOY_TYPE)
|
||||
pre-deploy:
|
||||
@- echo "\n### running pre-deploy script"
|
||||
@- $(foreach host,$(DEPLOY_HOSTS), \
|
||||
ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh pre-deploy.sh"; \
|
||||
)
|
||||
|
||||
post-deploy:
|
||||
@- echo "\n### running post-deploy script"
|
||||
@- $(foreach host,$(DEPLOY_HOSTS), \
|
||||
ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh post-deploy.sh"; \
|
||||
)
|
||||
|
||||
upload:
|
||||
@- echo "\n### uploading files"
|
||||
|
|
27
README.md
27
README.md
|
@ -34,10 +34,6 @@ Example `secrets.mk`:
|
|||
|
||||
## Usage
|
||||
|
||||
### Available options for DEPLOY_TYPE
|
||||
|
||||
compose, swarm, k8s (TBD), helm (TBD), cron (TBD)
|
||||
|
||||
### Start the deployment process
|
||||
|
||||
make deploy
|
||||
|
@ -46,3 +42,26 @@ compose, swarm, k8s (TBD), helm (TBD), cron (TBD)
|
|||
|
||||
make create-docker-contexts
|
||||
|
||||
### Update make-deploy submodule in your project
|
||||
|
||||
make self-update
|
||||
|
||||
### Available options for DEPLOY_TYPE
|
||||
|
||||
copy, compose, swarm, k8s (TBD), helm (TBD), cron (TBD)
|
||||
|
||||
#### copy
|
||||
|
||||
Just copy the repo to the remote location(s). Put additional logic into pre- and post-deploy.sh.
|
||||
|
||||
#### compose
|
||||
|
||||
Docker Compose deployment.
|
||||
|
||||
##### swarm
|
||||
|
||||
Docker Swarm deployment.
|
||||
|
||||
##### k8s, helm, cron
|
||||
|
||||
To be implemented.
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
# copy
|
||||
#
|
||||
# this just rsyncs the stuff to the remote server(s) and runs
|
||||
# pre- and post-deploy
|
||||
|
||||
pull-copy:
|
||||
# nop
|
||||
|
||||
start-copy:
|
||||
# nop
|
20
docker.mk
20
docker.mk
|
@ -8,26 +8,6 @@ create-docker-contexts:
|
|||
docker context create $(host) --description "$(host)" --docker "host=ssh://$(SSH_USER)@$(host)"; \
|
||||
)
|
||||
|
||||
pre-deploy-compose: pre-deploy-docker
|
||||
|
||||
post-deploy-compose: post-deploy-docker
|
||||
|
||||
pre-deploy-swarm: pre-deploy-docker
|
||||
|
||||
post-deploy-swarm: post-deploy-docker
|
||||
|
||||
pre-deploy-docker:
|
||||
@- echo "\n### running pre-deploy script"
|
||||
@- $(foreach host,$(DEPLOY_HOSTS), \
|
||||
ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh pre-deploy.sh"; \
|
||||
)
|
||||
|
||||
post-deploy-docker:
|
||||
@- echo "\n### running post-deploy script"
|
||||
@- $(foreach host,$(DEPLOY_HOSTS), \
|
||||
ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh post-deploy.sh"; \
|
||||
)
|
||||
|
||||
pull-compose:
|
||||
@- echo "\n### pulling image(s)"
|
||||
@- $(foreach ctx,$(DEPLOY_HOSTS), \
|
||||
|
|
Loading…
Reference in New Issue