Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the script with GitLab CI/CD #5

Open
renderd1 opened this issue Nov 17, 2022 · 2 comments
Open

Using the script with GitLab CI/CD #5

renderd1 opened this issue Nov 17, 2022 · 2 comments

Comments

@renderd1
Copy link

renderd1 commented Nov 17, 2022

Hello,

First of all, I appreciate the work you have put into the script, so thank you!

I managed to run it with GitLab CI/CD, as I believe @Zeioth has done (I put my .gitlab-ci.yml settings at the bottom of this post) but I had questions regarding the next steps after successful completion of the script:

  • How can I actually save the fullchain.pem and privkey.pem that cerbot generates if I'm running a venv on GitLab?
  • My site is also hosted on NameSilo. Would I need to manually insert the certificate details in my cPanel each time I run the script? Are you also hosting your site with this provider and have you managed to automate this process somehow?

I would appreciate any guidance at all, thank you so much in advance.

image: python:latest

stages:
  - build
  - test
  - deploy

variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

cache:
  paths:
    - .cache/pip
    - venv/

before_script:
  - pip install virtualenv
  - virtualenv venv
  - source venv/bin/activate

install:
  stage: build
  script:
    - pip install tldextract untangle
    - pip install certbot

renew:
  stage: test
  script:
    - chmod +x ./authenticator.py
    - chmod +x ./cleanup.py
    - certbot certonly -v --manual --email xyz@xyz.com --agree-tos --manual-public-ip-logging-ok --preferred-challenges=dns --manual-auth-hook ./authenticator.py --manual-cleanup-hook ./cleanup.py -d *.xyz.com -d xyz.com

success:
  stage: deploy
  script:
    - echo "SSL certificate renewed succesfully!"
@ethauvin
Copy link
Owner

You might want to talk with @Zeioth. I believe he's using the script with GitLab.

@renderd1 renderd1 changed the title Job failed: Incorrect TXT record found Using the script with GitLab CI/CD Nov 20, 2022
@renderd1
Copy link
Author

@ethauvin Thank you for getting back to me. The script completes successfully now and does indeed write the necessary records.

@Zeioth, If you have any time to spare, I would appreciate if you could help me understand the points raised in the original post?

I have updated the post to reflect the current situation and added my gitlab-ci.yml file.

Thank you both for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants