opendevstack / ods-jenkins-shared-library

Shared Jenkins library which all ODS projects & components use - provisioning, SonarQube code scanning, Nexus publishing, OpenShift template based deployments and repository orchestration
Apache License 2.0
75 stars 57 forks source link

Inject `global.*` values to make them available to release manager #1074

Closed serverhorror closed 6 months ago

serverhorror commented 9 months ago

fix #1066

serverhorror commented 9 months ago

@dvvanessastoiber if you use this branch it might just work

Code used to succesfully release to prod and have a global.imageTag propagate to a subchart.

dvvanessastoiber commented 8 months ago

@dvvanessastoiber if you use this branch it might just work

Code used to succesfully release to prod and have a global.imageTag propagate to a subchart.

Thank you, @serverhorror! How can I use this branch in my Jenkinsfile as it is not a release version?

@Library('ods-jenkins-shared-library@4.x') _

Jenkins does not allow to use this branchname

metmajer commented 8 months ago

Thanks @serverhorror and @dvvanessastoiber, we appreciate the fix. FYI @jafarre-bi @hrcornejo

serverhorror commented 8 months ago

Doesn't seem to work enough, yet 😔

Release Manager wants the tag names to be present (the ones it creat s)

Any hints how those could be forwarded or overwritten so that Helm can receive the right values?

dvvanessastoiber commented 8 months ago

Doesn't seem to work enough, yet 😔

Release Manager wants the tag names to be present (the ones it creat s)

Any hints how those could be forwarded or overwritten so that Helm can receive the right values?

@serverhorror From what I saw in my tests, the generated image tag is correctly set and used. The only thing that is not working for me at the moment is the creation of the image tag in the frontend image stream in QA (backend is working).

serverhorror commented 8 months ago

Let's take a look, in that case it might be the options used to build the image.

dvvanessastoiber commented 8 months ago

Let's take a look, in that case it might be the options used to build the image.

...
odsComponentStageBuildOpenShiftImage(
context, [resourceName: "${context.componentId}-backend", imageTag: "v7.1.1", dockerDir: "docker/backend", buildTimeoutMinutes: 10]
)
odsComponentStageBuildOpenShiftImage(
context, [resourceName: "${context.componentId}-frontend", imageTag: "v7.1.1", dockerDir: "docker/frontend", buildTimeoutMinutes: 10]
)
odsComponentStageRolloutOpenShiftDeployment(context, [
imageTag: "v7.1.1", 
deployTimeoutMinutes: 10, 
selector: "app.kubernetes.io/instance=${context.componentId}",
chartDir: 'chart',
helmEnvBasedValuesFiles: [
'values.env.yaml',
'secrets.env.yaml'
],
helmAdditionalFlags: ['--debug']
])
...

The options in the Jenkinsfile are basically the same for frontend and backend

@serverhorror I can remember that we created the frontend ImageStream manually because it was not there initially (see https://github.com/opendevstack/ods-jenkins-shared-library/issues/1065). Could this cause this behavior? Is there a way to trigger the correct creation of all imagestreams?

dvvanessastoiber commented 8 months ago

@serverhorror I just wanted to confirm explicitly that this PR is fixing the underlying issue for me. Thank you!

jafarre-bi commented 8 months ago

Hello, @serverhorror @dvvanessastoiber thank you very much for the work you have done here. I think we should talk to clarify any open points. Will contact you offline.

hrcornejo commented 7 months ago

The PR solves the problem with tags. The Release Manager needs the tags created to process images. Some examples: We have this image created in DEV: image

And after a release to QA, this is the image in the test environment: image The same image (SHA), but with a different tag.

In the example, a CM is using the tag created in QA: image