bpo.job_services package¶
Submodules¶
bpo.job_services.base module¶
bpo.job_services.local module¶
- class bpo.job_services.local.LocalJobService¶
Bases:
JobService
- get_link(job_id)¶
- get_status(job_id_check)¶
- Returns:
JobStatus
- run_job(name, note, tasks, branch)¶
- class bpo.job_services.local.LocalJobServiceThread¶
Bases:
Thread
Local jobs are running on the same machine, but in a different thread. New jobs can be queued while another job is running. They will be executed in sequence.
- run()¶
Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.
- run_job(name, note, tasks, branch, job_id)¶
- run_print(command)¶
- run_print_try(command)¶
Try to execute a shell command. :returns: True if exit code is 0, False otherwise
- setup_task(branch)¶
Setup temp_path with copy of pmaports.git/pmbootstrap.git and remove locally built packages.
Optionally copy the WIP repository to the local packages dir, so we can build packages depending on others, without actually firing up a second webserver when testing locally and making the whole development / automated testing setup more complicated. When BPO is using a different backend than the local one (e.g. sourcehut), the WIP repository will not get copied over the local packages dir, instead it will get added as regular HTTPS mirror.
- bpo.job_services.local.job_failed()¶
The testsuite can hook into this function to stop on failure, instead of having build jobs retry multiple times as usually.
- bpo.job_services.local.stop_thread()¶
bpo.job_services.sourcehut module¶
Job service for builds.sr.ht, see: https://man.sr.ht/builds.sr.ht
- class bpo.job_services.sourcehut.SourcehutJobService¶
Bases:
JobService
- get_link(job_id)¶
- get_status(job_id)¶
- Returns:
JobStatus
- init()¶
Initialize the job service when the bpo server starts (make sure that tokens are there etc.)
- run_job(name, note, tasks, branch)¶
- bpo.job_services.sourcehut.api_request(path, payload=None, method='POST')¶
- bpo.job_services.sourcehut.get_manifest(name, tasks, branch)¶
- bpo.job_services.sourcehut.get_secrets_by_job_name(name)¶
Have some privilege separation by only enabling the secrets, that are required for particular job types. In practice, this allows having the final repo sign key only available when necessary. :param name: job name (see bpo/jobs, e.g. “sign_index”) :returns: string like “secrets:<newline>- first<newline>- second<newline>” (<newline> is backslash-n)
- bpo.job_services.sourcehut.sanitize_task_name(name)¶
Replace characters that are not allowed in sr.ht task names