jaypore_ci.remotes package
Submodules
jaypore_ci.remotes.email module
An email remote.
This is used to report pipeline status via email. Multiple updates appear as a single thread.
- class jaypore_ci.remotes.email.Email(*, host: str, port: int, addr: str, password: str, email_to: str, email_from: str, subject: str, only_on_failure: bool = False, publish_interval: int = 30, **kwargs)[source]
Bases:
Remote
You can send pipeline status via email using this remote. In order to use it you can specify the following environment variables in your secrets:
JAYPORE_EMAIL_ADDR=email-account@gmail.com JAYPORE_EMAIL_PASSWORD=some-app-password JAYPORE_EMAIL_TO=myself@gmail.com,mailing-list@gmail.com JAYPORE_EMAIL_FROM=noreply@gmail.com
If you’re using something other than gmail, you can specify JAYPORE_EMAIL_HOST and JAYPORE_EMAIL_PORT as well.
Once that is done you can supply this remote to your pipeline instead of the usual gitea one.
from jaypore_ci import jci, remotes, repos git = repos.Git.from_env() email = remotes.Email.from_env(repo=git) with jci.Pipeline(repo=git, remote=email) as p: pass # Do something
- Parameters:
host – What smtp host to use.
port – Smtp port to use.
addr – Smtp address to use for login.
password – Smtp password to use for login.
email_to – Which address the email should go to.
email_from – Which address should be the sender of this email.
subject – The subject line of the email.
only_on_failure – If set to True, a single email will be sent when the pipeline fails. In all other cases no email is sent.
publish_interval – Determines the delay in sending another email when we are sending multiple email updates in a single email thread. If only_on_failure is set, this option is ignored.
- publish(report: str, status: str) None [source]
Will publish the report via email.
- Parameters:
report – Report to write to remote.
status – One of [“pending”, “success”, “error”, “failure”, “warning”] This is the dot next to each commit in gitea.
- property smtp
jaypore_ci.remotes.git module
This is used to save the pipeline status to git itself.
- class jaypore_ci.remotes.git.GitRemote(*, repo, **kwargs)[source]
Bases:
Remote
You can save pipeline status to git using this remote.
To push/fetch your local refs to a git remote you can run
git fetch origin refs/jayporeci/*:refs/jayporeci/* git push origin refs/jayporeci/*:refs/jayporeci/*
jaypore_ci.remotes.gitea module
A gitea remote git host.
This is used to report pipeline status to the remote.
- class jaypore_ci.remotes.gitea.Gitea(*, root, owner, repo, token, **kwargs)[source]
Bases:
Remote
The remote implementation for gitea.
jaypore_ci.remotes.github module
A github remote git host.
This is used to report pipeline status to the remote.
- class jaypore_ci.remotes.github.Github(*, root, owner, repo, token, **kwargs)[source]
Bases:
Remote
The remote implementation for github.
jaypore_ci.remotes.mock module
A mock remote.
This is used to test pipelines.