-
Notifications
You must be signed in to change notification settings - Fork 3
DAOS-19247 build: Support running Bullseye #528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
phender
wants to merge
17
commits into
master
Choose a base branch
from
hendersp/DAOS-18348-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+220
−94
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
88a150b
DAOS-19247 build: Support running Bullseye
phender d8ecebf
Added backwards support for depracated new_rpm buildRpmPost arg.
phender 47bddad
Updates
phender 55aa1a2
Added more robust Map defaults
phender f6f2024
Cleanup
phender 89ba68d
Fixes
phender 6280e60
Fixes
phender 586dfe5
Groocylint updates
phender e62d0ec
More groovylint updates.
phender 72fd171
Updates
phender 0c5a833
More groovylint fixes
phender 91ac5e8
More groovylint fixes
phender d4fafee
Claenup
phender e7818b2
Updates.
phender b4ad9bc
Merge branch 'master' into hendersp/DAOS-18348-2
phender 0f0fe7c
Simplify scriptedDockerStage()
phender 206dda9
Apply feedback.
phender File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| /* groovylint-disable NestedBlockDepth */ | ||
| // vars/scriptedDockerStage.groovy | ||
|
|
||
| import org.jenkinsci.plugins.pipeline.modeldefinition.Utils | ||
|
|
||
| /** | ||
| * scriptedDockerStage | ||
| * | ||
| * Get a docker stage in scripted syntax. | ||
| * | ||
| * @param kwargs Map containing the following optional arguments (empty strings yield defaults): | ||
| * name the docker stage name | ||
| * runStage optional additional condition to determine if the stage runs | ||
| * jobStatus Map of status for each stage in the job/build | ||
| * dockerTag the docker image tag to use for the build | ||
| * dockerBuildArgs optional docker build arguments | ||
| * stepMethod method to call to run the stage | ||
| * archiveArtifactsArgs optional arguments to pass to archiveArtifacts() | ||
| * @return a scripted stage to run in a pipeline | ||
| */ | ||
| /* groovylint-disable-next-line MethodSize */ | ||
| Map call(Map kwargs = [:]) { | ||
| String name = kwargs.get('name', null) | ||
| Boolean runStage = kwargs.get('runStage', true) | ||
| Map jobStatus = kwargs.get('jobStatus', null) ?: [:] | ||
| String dockerTag = kwargs.get('dockerTag', null) | ||
| String dockerBuildArgs = kwargs.get('dockerBuildArgs', '') | ||
| Closure stepMethod = kwargs.get('stepMethod') | ||
| Map archiveArtifactsArgs = kwargs.get('archiveArtifactsArgs', null) ?: [:] | ||
|
|
||
| if (!name) { | ||
| error("scriptedDockerStage() requires a stage 'name' argument") | ||
| } | ||
| if (!dockerTag) { | ||
| error("scriptedDockerStage() requires a 'dockerTag' argument") | ||
| } | ||
|
|
||
| return { | ||
| stage("${name}") { | ||
| if (!runStage) { | ||
| println("[${name}] Marking docker stage as skipped") | ||
| Utils.markStageSkippedForConditional("${name}") | ||
| return | ||
| } | ||
| node('docker_runner') { | ||
| println("[${name}] Check out from version control") | ||
| checkoutScm(pruneStaleBranch: true) | ||
|
|
||
| Throwable tryError = null | ||
| /* groovylint-disable-next-line NoDef, VariableTypeRequired */ | ||
| def dockerImage = docker.build(dockerTag, dockerBuildArgs) | ||
| try { | ||
| dockerImage.inside { | ||
| println("[${name}] Running stepMethod: ${stepMethod?.getClass()?.name}") | ||
| jobStatusUpdate(jobStatus, name, stepMethod.call()) | ||
| } | ||
| /* groovylint-disable-next-line CatchException */ | ||
| } catch (Exception e) { | ||
| tryError = e | ||
| println("[${name}] Caught exception in try: ${tryError}") | ||
| jobStatusUpdate(jobStatus, name, 'FAILURE') | ||
| throw tryError | ||
| } finally { | ||
| // Cleanup actions | ||
| try { | ||
| if (archiveArtifactsArgs) { | ||
| println("[${name}] Running archiveArtifacts()") | ||
| archiveArtifacts(archiveArtifactsArgs) | ||
| } | ||
| jobStatusUpdate(jobStatus, name) | ||
| /* groovylint-disable-next-line CatchException */ | ||
| } catch (Exception finallyError) { | ||
| println("[${name}] Caught exception in finally: ${finallyError}") | ||
| /* groovylint-disable-next-line DuplicateStringLiteral */ | ||
| jobStatusUpdate(jobStatus, name, 'FAILURE') | ||
| if (tryError == null) { | ||
| /* groovylint-disable-next-line ThrowExceptionFromFinallyBlock */ | ||
| throw finallyError | ||
| } | ||
| } | ||
| } | ||
| } | ||
| println("[${name}] Finished with ${jobStatus}") | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So
config['productArtifacts']is a list but we are also defining this local variable of the same name, but it is a map?Should we change
config['productArtifacts'] -> config['productNames']soproductArtifactsis not overloaded?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 206dda9