-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·55 lines (46 loc) · 1.3 KB
/
deploy.sh
File metadata and controls
executable file
·55 lines (46 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# Define deployment configuration
DEPLOY_USER="noone"
DEPLOY_HOST="strangeworld.blog"
REGULAR_DIR="/srv/http/StrangeBlog/"
ONION_DIR="/srv/http/StrangeBlogOn/"
# Function to deploy to regular domain
deploy_regular_domain() {
echo "Deploying to regular domain..."
hugo -b "https://strangeworld.blog" && rsync -av --delete -e "ssh -i ~/Downloads/arch_web_serv.pem" ~/work/hugo/public/ "${DEPLOY_USER}"@"${DEPLOY_HOST}":"${REGULAR_DIR}"
}
# Function to deploy to Tor onion service
deploy_tor_onion_service() {
echo "Deploying to Tor onion service..."
hugo -b "http://strangesj6o7ey6kunwe5eqefksbqj6mwx6vcrcv2t6abmqtfikzsxyd.onion" && rsync -av --delete -e "ssh -i ~/Downloads/arch_web_serv.pem" ~/work/hugo/public/ "${DEPLOY_USER}"@"${DEPLOY_HOST}":"${ONION_DIR}"
}
# Function to run both deployments
deploy_all() {
deploy_regular_domain
deploy_tor_onion_service
}
# Function to run only the onion deployment
deploy_onion() {
deploy_tor_onion_service
}
# Function to run only the clearnet deployment
deploy_clearnet() {
deploy_regular_domain
}
# Main script logic
case "$1" in
all)
deploy_all
;;
on)
deploy_onion
;;
cl)
deploy_clearnet
;;
*)
echo "Usage: $0 {all|on|cl}"
exit 1
;;
esac
exit 0