Commit 15dfd968 authored by Bryce Fisher-Fleig's avatar Bryce Fisher-Fleig

(feat) Automatic certbot renewal via Route53

parent 6b63a3a1
stages:
- deploy
- scheduled
image: docker:latest
......@@ -18,3 +19,18 @@ pages:
artifacts:
paths:
- public
letsencrypt:
stage: scheduled
only:
- schedules
image:
name: certbot/dns-route53
entrypoint: [""]
script:
- apk add curl
- 'certbot certonly -n --agree-tos --email "${EMAIL}" --dns-route53 -d "${DOMAIN}"'
- 'curl -XPUT -H "PRIVATE-TOKEN: $GITLAB_TOKEN"
--form "certificate=$(cat "/etc/letsencrypt/live/${DOMAIN}/fullchain.pem")"
--form "key=$(cat "/etc/letsencrypt/live/${DOMAIN}/privkey.pem")"
"https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/pages/domains/${DOMAIN}"'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment