ods-jenkins-shared-library icon indicating copy to clipboard operation
ods-jenkins-shared-library copied to clipboard

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

Open serverhorror opened this issue 1 year ago • 9 comments

fix #1066

serverhorror avatar Feb 20 '24 09:02 serverhorror

@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.

serverhorror avatar Feb 24 '24 13:02 serverhorror

@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('[email protected]') _

Jenkins does not allow to use this branchname

dvvanessastoiber avatar Feb 26 '24 07:02 dvvanessastoiber

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

metmajer avatar Feb 26 '24 11:02 metmajer

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 avatar Feb 26 '24 18:02 serverhorror

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).

dvvanessastoiber avatar Feb 26 '24 18:02 dvvanessastoiber

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

serverhorror avatar Feb 26 '24 18:02 serverhorror

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 avatar Feb 26 '24 18:02 dvvanessastoiber

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

dvvanessastoiber avatar Mar 04 '24 10:03 dvvanessastoiber

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.

jafarre-bi avatar Mar 05 '24 09:03 jafarre-bi

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

hrcornejo avatar Apr 22 '24 09:04 hrcornejo