Fixes
This commit is contained in:
parent
cf883ca8ad
commit
a8df3e8130
32
README.md
Normal file
32
README.md
Normal file
@ -0,0 +1,32 @@
|
||||
# Webservice automatic deployment on Hetzner Cloud
|
||||
|
||||
## Getting started
|
||||
|
||||
First you need to create a python virtual environment and activate it:
|
||||
```
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
```
|
||||
|
||||
Next you need to install required dependencies using pip:
|
||||
```
|
||||
pip install hcloud
|
||||
```
|
||||
|
||||
To deploy the webservice simply run the `deploy.py` script providing the token to Hetzner Cloud and ssh key as arguments:
|
||||
|
||||
```
|
||||
python3 deploy.py <HETZNER_TOKEN> <PUBLIC_SSH_KEY>
|
||||
```
|
||||
|
||||
To remove the created servers run the `clean.py` script:
|
||||
|
||||
```
|
||||
python3 clean.py <HETZNER_TOKEN>
|
||||
```
|
||||
|
||||
You can also use the `deploy.sh` script to run all above commands.
|
||||
```
|
||||
chmod +x deploy.sh
|
||||
./deploy.sh <HETZNER_TOKEN> <PUBLIC_SSH_KEY>
|
||||
```
|
1
clean.py
1
clean.py
@ -8,7 +8,6 @@ subnet_name = prefix+"-webservice-subnet"
|
||||
server_name = prefix+"-webservice-server"
|
||||
load_balancer_name = prefix+"-webservice-loadbalancer"
|
||||
|
||||
public_key = sys.argv[2]
|
||||
token = sys.argv[1]
|
||||
|
||||
server_count = 5
|
||||
|
2
clean.sh
2
clean.sh
@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
source venv/bin/activate
|
||||
python3 clean.py <HETZNER_TOKEN> <SSH_PUBLIC_KEY>
|
||||
python3 clean.py "$1"
|
Loading…
Reference in New Issue
Block a user