Compare commits

..
14 Commits
Author SHA1 Message Date
ecdown 6d315dfff9 updated agone_jenkins
agone-combined/pipeline/pr-main This commit looks good
agone-combined/pipeline/head This commit looks good
2026-09-30 00:02:46 -07:00
ecdown 8ab4197aab fixed typo
agone-combined/pipeline/pr-main There was a failure building this commit
agone-combined/pipeline/head There was a failure building this commit
2026-09-29 23:49:29 -07:00
ecdown f7036c59b8 fixed pr build branching strategy
agone-combined/pipeline/head There was a failure building this commit
agone-combined/pipeline/pr-main There was a failure building this commit
2026-09-29 23:46:46 -07:00
ecdown 8bf5a6ff54 typo
agone-combined/pipeline/pr-main There was a failure building this commit
agone-combined/pipeline/head This commit looks good
2026-09-29 23:31:01 -07:00
ecdown 4fb07a618d update interpolation
agone-combined/pipeline/head This commit looks good
agone-combined/pipeline/pr-main There was a failure building this commit
2026-09-29 23:23:17 -07:00
ecdown 294cebf0f7 Merge branch 'pullone' of https://myrepo.etechtips.com/ecdown/goldobne into pullone 2026-09-29 23:11:58 -07:00
ecdown d5dff17d10 updated storing intdir from nightly for reuse 2026-09-29 23:09:00 -07:00
ecdown f19564431b Merge branch 'main' into pullone
agone-combined/pipeline/head This commit looks good
2026-09-29 22:36:15 -07:00
ecdown 339028b826 fixed url for Coverity Connect
agone-combined/pipeline/pr-main This commit looks good
2026-09-29 22:27:16 -07:00
ecdown f8c1ba3763 fixed url for Coverity Connect
agone-combined/pipeline/head This commit looks good
2026-09-29 22:26:00 -07:00
ecdown ef047dec21 added bazel flag
agone-combined/pipeline/head There was a failure building this commit
2026-09-29 22:22:28 -07:00
ecdown 3734ceee33 added bazel flag
agone-combined/pipeline/pr-main This commit looks good
2026-09-29 22:20:14 -07:00
ecdown 4cb1102b56 merging main
agone-combined/pipeline/pr-main This commit looks good
2026-09-29 22:02:12 -07:00
ecdown e7dbe62d2a updated full build with bazel clean
agone-combined/pipeline/pr-main This commit looks good
2026-09-29 21:54:05 -07:00
+65 -18
View File
@@ -2,10 +2,17 @@ pipeline {
agent any
environment {
COVERITY_URL = 'http://coverity.etechtips.com'
COVERITY_URL = 'https://coverity.etechtips.com'
COVERITY_STREAM = 'agone-full'
COVERITY_PR_STREAM = 'agone-pr'
// Add Coverity binaries to PATH if not globally set on the Jenkins agent
PATH = "/opt/coverity/analysis/bin:${env.PATH}"
// Full-build baseline artifact
COVERITY_BASELINE_ARCHIVE = 'agone-full-cov-int.tar.gz'
//For a Multibranch Pipeline
AGONE_FULL_JOB = 'agone/main'
}
options {
@@ -36,7 +43,7 @@ COVERITY_URL = 'http://coverity.etechtips.com'
// 2. Run full Bazel build wrapped in cov-build
// --spawn_strategy=standalone ensures Coverity intercepts compiler processes
sh '''
cov-build --dir cov-int \
cov-build --dir cov-int --bazel \
bazel build --spawn_strategy=standalone //:run
'''
@@ -49,14 +56,29 @@ bazel build --spawn_strategy=standalone //:run
passwordVariable: 'COV_PASSWORD',
usernameVariable: 'COV_USER'
)]) {
sh """
sh '''
cov-commit-defects --dir cov-int \
--url ${COVERITY_URL} \
--stream ${COVERITY_STREAM} \
--user ${COV_USER} \
--password ${COV_PASSWORD}
"""
--url "${COVERITY_URL}" \
--stream "${COVERITY_STREAM}" \
--user "${COV_USER}" \
--password "${COV_PASSWORD}"
'''
}
// 5. Package the completed full-build intermediate directory
sh '''
rm -f "${COVERITY_BASELINE_ARCHIVE}"
tar -czf "${COVERITY_BASELINE_ARCHIVE}" cov-int
test -s "${COVERITY_BASELINE_ARCHIVE}"
'''
// 6. Store Baseline as a jenkins artifact
archiveArtifacts (
artifacts: "${COVERITY_BASELINE_ARCHIVE}",
fingerprint: true,
onlyIfSuccessful: true
)
}
}
}
@@ -78,11 +100,20 @@ bazel build --spawn_strategy=standalone //:run
// 1. Determine target branch and fetch changes
def targetBranch = env.CHANGE_TARGET ?: 'main'
sh "git fetch origin ${targetBranch}"
// 2. Identify changed files relative to the target branch
sh """
git fetch origin \
+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}
"""
def mergeBase = sh(
script: "git merge-base HEAD origin/${targetBranch}",
returnStdout: true
).trim()
echo "Merge base: ${mergeBase}"
def changedFiles = sh(
script: "git diff --name-only origin/${targetBranch}...HEAD",
script: "git diff --name-only ${mergeBase} HEAD",
returnStdout: true
).trim()
@@ -109,22 +140,38 @@ bazel build --spawn_strategy=standalone //:run
echo "Affected Bazel targets:\n${affectedTargets}"
// 4. Clean PR-specific Coverity directory
sh 'rm -rf cov-int-pr'
copyArtifacts (
projectName: "${AGONE_FULL_JOB}",
selector: last_successful(),
filter: "${COVERITY_BASELINE_ARCHIVE}",
fingerprintArtifacts: true
)
// 4a. recover nightly pr
sh '''
rm -rf cov-int-pr baseline-cov-int
mkdir baseline-cov-int
tar -xzf "${COVERITY_BASELINE_ARCHIVE}" \
-C baseline-cov-int
test -d baseline-cov-int/cov-int
mv baseline-cov-int/cov-int cov-int-pr
rmdir baseline-cov-int
'''
// 5. Build only the affected targets wrapped in cov-build
sh """
cov-build --dir cov-int-pr \
cov-build --dir cov-int-pr --bazel \
bazel build --spawn_strategy=standalone ${affectedTargets.replaceAll('\n', ' ')}
"""
// 6. Run fast desktop analysis on only changed files
sh """
sh '''
cov-run-desktop --dir cov-int-pr \
--target-url ${COVERITY_URL} \
--stream ${COVERITY_STREAM} \
--target-url "${COVERITY_URL}" \
--stream "${COVERITY_PR_STREAM}" \
${changedFiles.replaceAll('\n', ' ')}
"""
'''
}
}
}