-
Notifications
You must be signed in to change notification settings - Fork 57
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
Image author / commit empty in oc image built thru jenkins shared lib #47
Comments
the difference is driven by the BC - if the BC is based on a GIT commit / git source then the author of the commit is taken if the source is binary ... Author
|
we have the commit / branch etc ... we may need the author and the message as well could use this :) (question, but how?- via env,.... ) @renedupont - can you pick this up - this is a big one! |
update: the *io. pieces come from the build config instance (use the BuildConfig.spec.output.imageLabels field to specify a list of custom labels that will be applied to each image built from the BuildConfig.) and here is how :) https://docs.openshift.com/container-platform/3.4/dev_guide/builds/build_output.html |
@renedupont Can you look into this - let me know if you need help. |
I talked to @michaelsauter about it and started working on it, should be done in a couple of days. |
@renedupont Put all the Info into labels |
so here is the list of thngs we should put in
I would stick them all under ods.build. for the last one or def ocAPiUrl = sh(returnStdout: true, script: 'oc project ${PROJECT}-cd').trim() ocAPiUrl = ocAPiUrl.substring(ocAPiUrl.indexOf("http")).replaceAll("\".", "") |
@clemensutschig I was now able to retrieve all of the information and present them as labels, BUT the shared lib version that we wanted to get via
causes a RejectAccessException during the build since it runs in a groovy sandbox. The precise exception is:
To allow that access it is possible to manually allow it in Jenkins Web UI under Script Approval: Since we obviously don't want to do this manually for every jenkins instance, besides being a security risk according to the script approval message, the question is how we deal with this. I remember there were similar issues in the past with this sandbox rejecting access, any idea how it was dealt with @michaelsauter ? |
@renedupont ' then lets leave this one out. |
Other Option- sh "env | grep" |
I'll take it out for now since it seems not to be accessible without this security issue. |
env | grep "library.ods-library.version" should do .. grep expects an argument WHAT do search for ... :) $ env | grep HOST HOSTNAME=.... |
oh thank you, that helped 👍 |
Nice. Pull in @michaelsauter tmrw to help with Upstream |
@clemensutschig @renedupont I realised what you used for |
Adds information from Git to image via labels. Closes opendevstack#47.
…m feature/BIX-531-git-lfs-jenkins-configuration to production * commit '2c12edc6e9355c520d2c76d4c009aa30c72c8b4f': adding git lfs migrate note in readme file adding whole GitSCM configuration GitSCMSource not resolved from Jenkins, switching to GitSCM checkout with git lfs extension enabled
For some reason, the author of the image produced by the Jenkins build is unknown. This information should be set though as the commit author is known.
The text was updated successfully, but these errors were encountered: