improve deploy script
This commit is contained in:
		
							parent
							
								
									33337cf2ed
								
							
						
					
					
						commit
						fb75a9b4de
					
				
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					# build artifact
 | 
				
			||||||
 | 
					period3.xyz
 | 
				
			||||||
							
								
								
									
										15
									
								
								deploy.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								deploy.sh
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					site=period3.xyz
 | 
				
			||||||
 | 
					gemini=/home/gemini/gemini
 | 
				
			||||||
 | 
					dest="$gemini/content"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sudo rm -r $dest/*
 | 
				
			||||||
 | 
					sudo mv $site/* $dest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rm -r $site
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					printf "\n\tdone!\n\n"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										26
									
								
								makefile
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								makefile
									
									
									
									
									
								
							@ -1,6 +1,22 @@
 | 
				
			|||||||
HOST	= pluto
 | 
					.DEFAULT_GOAL := site
 | 
				
			||||||
SITE	= period3.xyz
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
deploy:
 | 
					SITE		= period3.xyz
 | 
				
			||||||
	git push
 | 
					
 | 
				
			||||||
	ssh $(HOST) ./deploy-$(SITE)
 | 
					HOST		= pluto
 | 
				
			||||||
 | 
					HOST_DIR	= $(HOST):~
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CONTENT		= content/
 | 
				
			||||||
 | 
					DEPLOY		= deploy.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					site: $(SITE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$(SITE): $(CONTENT)
 | 
				
			||||||
 | 
						[ -d $(SITE) ] || rsync -rP $(CONTENT) $(SITE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					deploy: site
 | 
				
			||||||
 | 
						rsync -P $(DEPLOY) $(HOST_DIR)
 | 
				
			||||||
 | 
						rsync -rP $(SITE) $(HOST_DIR)
 | 
				
			||||||
 | 
						ssh $(HOST) "bash -s" < $(DEPLOY)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					clean:
 | 
				
			||||||
 | 
						rm -r $(SITE)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user