Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved options to timeout stmt and property
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ng <[email protected]>
jeffng-or committed Oct 28, 2024
1 parent 96e95b3 commit 8abda9c
Showing 1 changed file with 39 additions and 43 deletions.
82 changes: 39 additions & 43 deletions jenkins/public_build.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,50 +1,46 @@
@Library('[email protected]') _


// Prevent builds stomping on each other and set a timeout to avoid runaways
options {
disableConcurrentBuilds(abortPrevious: true);
timeout(time: 72, unit: 'HOURS');
}

// kick off worker using megaboom cloud definition
node('gce-megaboom-central1') {
properties([copyArtifactPermission('${JOB_NAME},'+env.BRANCH_NAME)]);

// checkout megaboom and apply PR
stage('Checkout Megaboom') {
checkout([
$class: 'GitSCM',
branches: [[name: scm.branches[0].name]],
extensions: [
[$class: 'CloneOption', noTags: false],
],
userRemoteConfigs: scm.userRemoteConfigs
]);
def description = sh(script: "git log -1 --pretty=%B", returnStdout: true).trim();
if (description.contains('ci') && description.contains('skip')) {
currentBuild.result = 'SKIPPED'; // 'SUCCESS', 'SKIPPED'
return;
// Prevent builds stomping on each other and set a timeout to avoid runaways
timeout(time: 72, unit: 'HOURS') {
node('gce-megaboom-central1') {
properties([copyArtifactPermission('${JOB_NAME},'+env.BRANCH_NAME),
disableConcurrentBuilds(abortPrevious: true)]);

// checkout megaboom and apply PR
stage('Checkout Megaboom') {
checkout([
$class: 'GitSCM',
branches: [[name: scm.branches[0].name]],
extensions: [
[$class: 'CloneOption', noTags: false],
],
userRemoteConfigs: scm.userRemoteConfigs
]);
def description = sh(script: "git log -1 --pretty=%B", returnStdout: true).trim();
if (description.contains('ci') && description.contains('skip')) {
currentBuild.result = 'SKIPPED'; // 'SUCCESS', 'SKIPPED'
return;
}
}
}

def DOCKER_IMAGE;

// Run docker build for machine image
stage('Build and Push Docker Machine Image') {
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'megaboom');
echo "Docker image is $DOCKER_IMAGE";
}

// execute bazel to build BoomTile through grt stage
stage('Build Megaboom') {
buildMegaboom(DOCKER_IMAGE);
}

// TODO Add some smoke tests

stage ('Cleanup and Reporting') {
finalReport(DOCKER_IMAGE, "megaboom");
def DOCKER_IMAGE;

// Run docker build for machine image
stage('Build and Push Docker Machine Image') {
DOCKER_IMAGE = dockerPush('ubuntu22.04', 'megaboom');
echo "Docker image is $DOCKER_IMAGE";
}

// execute bazel to build BoomTile through grt stage
stage('Build Megaboom') {
buildMegaboom(DOCKER_IMAGE);
}

// TODO Add some smoke tests

stage ('Cleanup and Reporting') {
finalReport(DOCKER_IMAGE, "megaboom");
}
}
}

0 comments on commit 8abda9c

Please sign in to comment.