add optional artifact check via external_artifact_check
in jenkins_vars.yml
#283
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A few images use a custom external trigger to check for upstream artifacts before triggering a new build. However, once switched over to custom, the whole external trigger is manually managed and any update to the template requires manual updates to the custom ones.
This PR adds the external artifact check into the template, activated a new block var in jenkins-vars.yml named
external_artifact_check
.This var can be set to any multiline bash commands (written in the jinja/ansible template style) and it will be injected into the external trigger.
The only requirement is that the var sets
artifacts_found
to eithertrue
orfalse
depending on whatever check needs to be performed.A sample var for Emby is as follows:
This block gets entered into the external trigger as shown here:
https://github.com/linuxserver/docker-emby/blob/bfa7d0bf3c127146ec5e7209cb6eadd5079b9952/.github/workflows/external_trigger.yml#L80-L85
As you can see, the github workflow variables such as
${{ secrets.CR_USER }}
need to be entered into jenkins-vars.yml as${{ '{{' }} secrets.CR_USER {{ '}}' }}
because they go through jinja/ansible templating.Here's the output of the test trigger: https://github.com/linuxserver/docker-emby/actions/runs/10725065218 (it was manually adjusted to force triggering even on the same version)
Here's the output of the test trigger with artifact check failed intentionally: https://github.com/linuxserver/docker-emby/actions/runs/10725987059