// Documentation: https://www.jenkins.io/doc/book/pipeline/jenkinsfile/ pipeline { parameters { booleanParam( name: "FORCED_STAGE_TRIGGER", defaultValue: false, description: "Force conditional blocks to trigger" ) } agent { node { // Only x64 only because of OCI container used for Earthly. label 'earthly && linux && x64' } } environment { TERM = "dumb" } stages { stage("checkout") { steps { checkout scm } } stage("build") { when { anyOf { expression { return params.FORCED_STAGE_TRIGGER } expression { currentBuild.number <= 1 } changeset "Earthfile" changeset "Jenkinsfile" changeset "*/*/*.ebuild" } } options { timeout(time: 20, unit: "MINUTES") } steps { sh "earthly +build" } } stage("test") { when { anyOf { expression { return params.FORCED_STAGE_TRIGGER } expression { currentBuild.number <= 1 } changeset "Earthfile" changeset "Jenkinsfile" changeset "*/*/*.ebuild" } } options { timeout(time: 20, unit: "MINUTES") } steps { sh "earthly +test" } } } }