-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use deploy hook to trigger success script for certbot
- Loading branch information
1 parent
3b6cbd1
commit dba07c9
Showing
2 changed files
with
10 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,3 @@ | ||
#!/bin/bash | ||
working_directory=/root/ddw-analyst-ui/ | ||
renewal_result="$(command certbot renew --webroot -w /root/ddw-analyst-ui/static/letsencrypt)" | ||
#Check if successful result is received | ||
result="$(echo $renewal_result | grep -o Congratulations )" | ||
|
||
#If successful copy certs to the correct folder and refresh nginx docker node | ||
if [ $result ]; then | ||
cd $working_directory | ||
cp -f /etc/letsencrypt/live/ddw.devinit.org/privkey.pem /root/ddw-analyst-ui/ssl/ | ||
cp -f /etc/letsencrypt/live/ddw.devinit.org/fullchain.pem /root/ddw-analyst-ui/ssl/ | ||
|
||
command docker-compose exec ddw-analyst-ui_nginx_1 nginx reload | ||
fi | ||
working_directory=/root/ddw-analyst-ui | ||
command certbot renew --webroot -w "$working_directory"/static/letsencrypt --deploy-hook "$working_directory"/certbot_success.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
working_directory=/root/ddw-analyst-ui | ||
#If successful copy certs to the correct folder and refresh nginx docker node | ||
cd $working_directory | ||
cp -f /etc/letsencrypt/live/ddw.devinit.org/privkey.pem /root/ddw-analyst-ui/ssl/ | ||
cp -f /etc/letsencrypt/live/ddw.devinit.org/fullchain.pem /root/ddw-analyst-ui/ssl/ | ||
|
||
command docker-compose exec ddw-analyst-ui_nginx_1 nginx reload |