Skip to content

ENT-14361: Added a Jenkins pipeline that builds packages in containers - #2434

Open
larsewi wants to merge 1 commit into
cfengine:masterfrom
larsewi:jenkinsfile
Open

ENT-14361: Added a Jenkins pipeline that builds packages in containers#2434
larsewi wants to merge 1 commit into
cfengine:masterfrom
larsewi:jenkinsfile

Conversation

@larsewi

@larsewi larsewi commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

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

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>
@larsewi
larsewi marked this pull request as ready for review August 14, 2026 14:18

@craigcomstock craigcomstock left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks cool! thanks!

Comment thread Jenkinsfile
.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."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I love this so much!

Comment thread Jenkinsfile

// Returns the architecture of the node a label has to build on.
def archOf(String label) {
return label.contains('_arm_64') ? 'arm64' : 'amd64'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exotics in 3.24.x return solaris, hpux, aix?

Comment thread Jenkinsfile
// 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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Jenkinsfile
// 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 }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Jenkinsfile
--source-dir "\$WORKSPACE/src" \\
--output-dir "\$WORKSPACE/output" \\
--cache-dir '${cacheDir}' \\
--sftp-key "\$JENKINS_SFTP_KEY_PATH"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the build also need the SFTP_PUBKEY for known_hosts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants