More postdeploy circles

This commit is contained in:
Luke Murphy 2020-03-15 09:12:11 +01:00
parent ddffce5711
commit 3cb8ce2183
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
3 changed files with 23 additions and 1 deletions

View File

@ -5,5 +5,6 @@ COPY CHECKS ${WORKDIR}
RUN mkdir -p /app/ RUN mkdir -p /app/
COPY predeploy.sh /app/ COPY predeploy.sh /app/
COPY postdeploy.sh /app/
EXPOSE 3000 EXPOSE 3000

View File

@ -12,7 +12,8 @@
}, },
"scripts": { "scripts": {
"dokku": { "dokku": {
"predeploy": "bash /app/predeploy.sh" "predeploy": "bash /app/predeploy.sh",
"postdeploy": "bash /app/postdeploy.sh"
} }
}, },
"volumes": [ "volumes": [

20
postdeploy.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
set -eu -o pipefail
setup_letsencrypt_certs() {
set -eu
if [ ! -d "/home/dokku/gitea/letsencrypt" ]; then
echo "=====> Generating let's encrypt certificates"
dokku letsencrypt gitea
fi
}
main() {
set -eu
setup_letsencrypt_certs
}
main