2022-09-26 19:27:41 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								kind: pipeline
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 20:02:49 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								type: docker
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 19:27:41 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								name: hello
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								steps:
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 20:46:31 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								- name: deploy
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 20:38:22 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  image: ubuntu
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 20:46:31 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  environment:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    HOST:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      from_secret: host
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 21:58:32 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    USER:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      from_secret: user
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 20:46:31 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    SSH_KEY:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								      from_secret: ssh_key
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 22:07:14 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    DEST: gemini/content
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 20:46:31 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 19:27:41 +01:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  commands:
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 20:46:31 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  - apt-get update -qq > /dev/null
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 21:54:01 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  - apt-get install ssh rsync -qq > /dev/null
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 20:46:31 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  # a comment hopefully
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  - which ssh-agent
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  - eval $(ssh-agent -s)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  - mkdir -p ~/.ssh
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  - echo "$SSH_KEY" > ~/.ssh/id_rsa
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  - chmod 600 ~/.ssh/id_rsa
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  - ssh-add
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  # skip key checking
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  - echo "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  - cat ~/.ssh/config
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-26 22:07:14 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  - ssh "$${USER}@$${HOST}" "[[ -d $${DEST} ]] && rm -r $${DEST}"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  - rsync -rP content/* "$${USER}@$${HOST}:$${DEST}"
							 |