Try to run with LE mounting on post-deploy
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b9cdae9857
commit
bcaf9601e9
33
ansible/post-deploy.yml
Normal file
33
ansible/post-deploy.yml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
gather_facts: false
|
||||||
|
tasks:
|
||||||
|
- name: Load variables
|
||||||
|
include_vars:
|
||||||
|
dir: "{{ dokku_lib_root }}/data/ansible/autonomic.zone/vars/"
|
||||||
|
extensions:
|
||||||
|
- yml
|
||||||
|
|
||||||
|
- name: Setup LE certificates
|
||||||
|
shell: dokku letsencrypt autonomic.zone
|
||||||
|
args:
|
||||||
|
creates: /home/dokku/autonomic.zone/letsencrypt/certs
|
||||||
|
|
||||||
|
- name: Setup LE certificates renew cron job
|
||||||
|
shell: dokku letsencrypt:cron-job --add
|
||||||
|
args:
|
||||||
|
creates: /home/dokku/autonomic.zone/letsencrypt/cron-job
|
||||||
|
|
||||||
|
- name: Specify docker volume mounts
|
||||||
|
dokku_storage:
|
||||||
|
app: autonomic.zone
|
||||||
|
mounts:
|
||||||
|
- /home/dokku/autonomic.zone/letsencrypt/certs/current/key.pem:/etc/x509/https/tls.key
|
||||||
|
- /home/dokku/autonomic.zone/letsencrypt/certs/current/cert.pem:/etc/x509/https/tls.crt
|
||||||
|
|
||||||
|
- name: Set HTTP 443 port
|
||||||
|
dokku_ports:
|
||||||
|
app: autonomic.zone
|
||||||
|
mappings:
|
||||||
|
- "https:443:{{ http_port }}"
|
||||||
|
state: present
|
@ -56,30 +56,6 @@
|
|||||||
- "http:4000:4000"
|
- "http:4000:4000"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Setup LE certificates
|
|
||||||
shell: dokku letsencrypt autonomic.zone
|
|
||||||
args:
|
|
||||||
creates: /home/dokku/autonomic.zone/letsencrypt/certs
|
|
||||||
|
|
||||||
- name: Setup LE certificates renew cron job
|
|
||||||
shell: dokku letsencrypt:cron-job --add
|
|
||||||
args:
|
|
||||||
creates: /home/dokku/autonomic.zone/letsencrypt/cron-job
|
|
||||||
|
|
||||||
- name: Set HTTP 443 port
|
|
||||||
dokku_ports:
|
|
||||||
app: autonomic.zone
|
|
||||||
mappings:
|
|
||||||
- "https:443:{{ http_port }}"
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Specify docker volume mounts
|
|
||||||
dokku_storage:
|
|
||||||
app: autonomic.zone
|
|
||||||
mounts:
|
|
||||||
- /home/dokku/autonomic.zone/letsencrypt/certs/current/key.pem:/etc/x509/https/tls.key
|
|
||||||
- /home/dokku/autonomic.zone/letsencrypt/certs/current/cert.pem:/etc/x509/https/tls.crt
|
|
||||||
|
|
||||||
- name: Configure the dokku app environment
|
- name: Configure the dokku app environment
|
||||||
dokku_config:
|
dokku_config:
|
||||||
app: autonomic.zone
|
app: autonomic.zone
|
||||||
|
@ -6,19 +6,10 @@ set -eu -o pipefail
|
|||||||
run_jekyll() {
|
run_jekyll() {
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
local args="--port $JEKYLL_PORT --host $JEKYLL_HOST --trace"
|
jekyll serve \
|
||||||
|
--port "$JEKYLL_PORT" \
|
||||||
# Note(decentral1se): handle the case where the Dokku is deploying the app
|
--host "$JEKYLL_HOST" \
|
||||||
# with HTTP support only before we have a chance to deploy the lets encrypt
|
--trace
|
||||||
# certificates and mount them into the container
|
|
||||||
if [ -f "$JEKYLL_SSL_CERT" ]; then
|
|
||||||
args="${args} --ssl-cert $JEKYLL_SSL_CERT"
|
|
||||||
fi
|
|
||||||
if [ -f "$JEKYLL_SSL_KEY" ]; then
|
|
||||||
args="${args} --ssl-key $JEKYLL_SSL_KEY"
|
|
||||||
fi
|
|
||||||
|
|
||||||
jekyll serve "$args"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Main entrypoint
|
# Main entrypoint
|
||||||
|
Reference in New Issue
Block a user