Add marker file via Dockerfile. Script will remove marker and exit if…#198
Draft
kerogers-cloudbees wants to merge 3 commits intocloudbees:masterfrom
Draft
Add marker file via Dockerfile. Script will remove marker and exit if…#198kerogers-cloudbees wants to merge 3 commits intocloudbees:masterfrom
kerogers-cloudbees wants to merge 3 commits intocloudbees:masterfrom
Conversation
… marker is present.
mikecirioli
reviewed
Oct 19, 2021
| // MAIN CODE BODY | ||
| info("Checking for first run inside an OCI container"); | ||
| // The Dockerfile will need to create this file. It will prevent this script from running. | ||
| noRunFilePath = "/var/jenkins_home/init.groovy.d/DO_NOT_RUN_UC_REMEDIATION"; |
Contributor
There was a problem hiding this comment.
I would store this marker file outside of the init.groovy folder in case jenkins tries to "run" it during the initial install
mikecirioli
reviewed
Oct 19, 2021
| if (noRunFile.exists()) { | ||
| info("Found marker file for first run. Removing file and exiting") | ||
| noRunFile.delete() | ||
| return "NO_CHANGE_NEEDED" |
Contributor
There was a problem hiding this comment.
return "SKIPPING_FIRST_RUN"
Author
There was a problem hiding this comment.
do I need to add it to the list of ok returns or have it handle that as an error?
Contributor
There was a problem hiding this comment.
yeah, probably. i'd treat it as a success
mikecirioli
reviewed
Oct 19, 2021
uc-certificate-fix/Dockerfile
Outdated
| RUN mkdir -p /var/jenkins_home/init.groovy.d | ||
| COPY ./ucCertRemediation.groovy /var/jenkins_home/init.groovy.d/ | ||
|
|
||
| RUN touch /var/jenkins_home/init.groovy.d/DO_NOT_RUN_UC_REMEDIATION && \ |
Contributor
There was a problem hiding this comment.
suggest not storing this in the init.groovy.d folder so that jenkins doesn't try to run it
…ew return value SKIPPING_FIRST_RUN.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
… marker is present.