ENT-14361: Added a Jenkins pipeline that builds packages in containers - #2434
ENT-14361: Added a Jenkins pipeline that builds packages in containers#2434larsewi wants to merge 1 commit into
Conversation
The CFEngine organization folder scans the org for a Jenkinsfile in the repository root, so this file alone makes a job of every branch and every pull request. Nothing in infra defines the job. Ticket: ENT-14361 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
craigcomstock
left a comment
There was a problem hiding this comment.
looks cool! thanks!
| .collect { it.trim() } | ||
| .findAll { it.startsWith('PACKAGES_') && it ==~ params.LABEL_FILTER } | ||
| if (!sel) { | ||
| error "LABEL_FILTER '${params.LABEL_FILTER}' matches no label in build-scripts/labels.txt." |
There was a problem hiding this comment.
oh I love this so much!
|
|
||
| // Returns the architecture of the node a label has to build on. | ||
| def archOf(String label) { | ||
| return label.contains('_arm_64') ? 'arm64' : 'amd64' |
There was a problem hiding this comment.
exotics in 3.24.x return solaris, hpux, aix?
| // Returns the refspec to fetch a repo with. Branch heads are always fetched. | ||
| // Pull requests live outside refs/heads. Building one means fetching its ref | ||
| // too, or its commit is not in the clone. | ||
| def refspecFor(String rev) { |
There was a problem hiding this comment.
I wonder if there is a way we can share this boilerplate/functions around with other Jenkinsfiles in other repos. Maybe a follow up ticket. Of course the other strategy would be a template that then is rendered out to various repos.
| // too, or its commit is not in the clone. | ||
| def refspecFor(String rev) { | ||
| def heads = '+refs/heads/*:refs/remotes/origin/*' | ||
| if (!(rev ==~ /^(?:refs\/)?pull\/\d+\/(merge|head)$/)) { return heads } |
There was a problem hiding this comment.
for things like this it would be cool to have unit tests ;) I know that is wacky in this context, but who knows? If we pushed these bits to a groovy script we might be able to unit test them with groovy.
| --source-dir "\$WORKSPACE/src" \\ | ||
| --output-dir "\$WORKSPACE/output" \\ | ||
| --cache-dir '${cacheDir}' \\ | ||
| --sftp-key "\$JENKINS_SFTP_KEY_PATH" |
There was a problem hiding this comment.
Does the build also need the SFTP_PUBKEY for known_hosts?
The CFEngine organization folder scans the org for a Jenkinsfile in the repository root, so this file alone makes a job of every branch and every pull request. Nothing in infra defines the job.
Ticket: ENT-14361