create necessary dirs before deploy
This commit is contained in:
		
							parent
							
								
									f56601ce5a
								
							
						
					
					
						commit
						2e8a078880
					
				
					 2 changed files with 9 additions and 5 deletions
				
			
		
							
								
								
									
										9
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										9
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
					@ -1,16 +1,14 @@
 | 
				
			||||||
.PHONY: self-update create-contexts deploy upload pull start stop restart
 | 
					.PHONY: self-update create-contexts deploy upload pull start stop restart
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include make-deploy/docker.mk
 | 
					include make-deploy/docker.mk
 | 
				
			||||||
 | 
					include make-deploy/k8s.mk
 | 
				
			||||||
 | 
					include make-deploy/cron.mk
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include config.mk
 | 
					include config.mk
 | 
				
			||||||
 | 
					
 | 
				
			||||||
self-update:
 | 
					self-update:
 | 
				
			||||||
	@- git submodule update --remote
 | 
						@- git submodule update --remote
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
create-contexts:
 | 
					 | 
				
			||||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
					 | 
				
			||||||
	    docker context create $(host) --description "$(host)" --docker "host=ssh://$(SSH_USER)@$(host)"; \
 | 
					 | 
				
			||||||
	)
 | 
					 | 
				
			||||||
	
 | 
					 | 
				
			||||||
deploy: upload pre-deploy pull start post-deploy
 | 
					deploy: upload pre-deploy pull start post-deploy
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pre-deploy: pre-deploy-$(DEPLOY_TYPE)
 | 
					pre-deploy: pre-deploy-$(DEPLOY_TYPE)
 | 
				
			||||||
| 
						 | 
					@ -20,6 +18,7 @@ post-deploy: post-deploy-$(DEPLOY_TYPE)
 | 
				
			||||||
upload:
 | 
					upload:
 | 
				
			||||||
	@- echo "\n### uploading files"
 | 
						@- echo "\n### uploading files"
 | 
				
			||||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
						@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
				
			||||||
 | 
							ssh $(SSH_USER)@$(host) "mkdir -p $(DEPLOY_PATH)/$(DEPLOY_NAME)"; \
 | 
				
			||||||
		rsync -rav --exclude '*~' --exclude '.git*' . $(SSH_USER)@$(host):$(DEPLOY_PATH)/$(DEPLOY_NAME); \
 | 
							rsync -rav --exclude '*~' --exclude '.git*' . $(SSH_USER)@$(host):$(DEPLOY_PATH)/$(DEPLOY_NAME); \
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,8 @@
 | 
				
			||||||
 | 
					create-docker-contexts:
 | 
				
			||||||
 | 
						@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
				
			||||||
 | 
						    docker context create $(host) --description "$(host)" --docker "host=ssh://$(SSH_USER)@$(host)"; \
 | 
				
			||||||
 | 
						)
 | 
				
			||||||
 | 
						
 | 
				
			||||||
pre-deploy-compose: pre-deploy-docker
 | 
					pre-deploy-compose: pre-deploy-docker
 | 
				
			||||||
 | 
					
 | 
				
			||||||
post-deploy-compose: post-deploy-docker
 | 
					post-deploy-compose: post-deploy-docker
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue