Add deploy script
This commit is contained in:
		
							parent
							
								
									c97f7ef2f3
								
							
						
					
					
						commit
						03a502b6e2
					
				| 
						 | 
					@ -0,0 +1,22 @@
 | 
				
			||||||
 | 
					[Unit]
 | 
				
			||||||
 | 
					Description=TLS cert decoder application
 | 
				
			||||||
 | 
					After=network.target
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Service]
 | 
				
			||||||
 | 
					WorkingDirectory=/srv/useful_web_tools/cert_decoder/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Create venv and install deps if not already done
 | 
				
			||||||
 | 
					ExecStartPre=/bin/bash -c '[ -d ".venv" ] || python3 -m venv .venv'
 | 
				
			||||||
 | 
					ExecStartPre=/bin/bash -c 'source .venv/bin/activate && pip install -r requirements.txt'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Activate venv and run the app
 | 
				
			||||||
 | 
					ExecStart=/bin/bash -c 'source .venv/bin/activate && python main.py --port 5001'
 | 
				
			||||||
 | 
					Restart=always
 | 
				
			||||||
 | 
					Environment="PYTHONUNBUFFERED=1"
 | 
				
			||||||
 | 
					StandardOutput=journal
 | 
				
			||||||
 | 
					StandardError=journal
 | 
				
			||||||
 | 
					SyslogIdentifier=cert-decoder
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Install]
 | 
				
			||||||
 | 
					WantedBy=multi-user.target
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,5 @@
 | 
				
			||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					cp cert_decoder/cert-decoder.service /lib/systemd/system/
 | 
				
			||||||
 | 
					cp diff/diff-tool.service /lib/systemd/system/
 | 
				
			||||||
 | 
					systemctl enable --now cert-decoder
 | 
				
			||||||
 | 
					systemctl enable --now diff-tool
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,22 @@
 | 
				
			||||||
 | 
					[Unit]
 | 
				
			||||||
 | 
					Description=Diff tool application
 | 
				
			||||||
 | 
					After=network.target
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Service]
 | 
				
			||||||
 | 
					WorkingDirectory=/srv/useful_web_tools/diff/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Create venv and install deps if not already done
 | 
				
			||||||
 | 
					ExecStartPre=/bin/bash -c '[ -d ".venv" ] || python3 -m venv .venv'
 | 
				
			||||||
 | 
					ExecStartPre=/bin/bash -c 'source .venv/bin/activate && pip install -r requirements.txt'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Activate venv and run the app
 | 
				
			||||||
 | 
					ExecStart=/bin/bash -c 'source .venv/bin/activate && python main.py --port 5002'
 | 
				
			||||||
 | 
					Restart=always
 | 
				
			||||||
 | 
					Environment="PYTHONUNBUFFERED=1"
 | 
				
			||||||
 | 
					StandardOutput=journal
 | 
				
			||||||
 | 
					StandardError=journal
 | 
				
			||||||
 | 
					SyslogIdentifier=diff-tool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Install]
 | 
				
			||||||
 | 
					WantedBy=multi-user.target
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue