Skip to content
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

feat(buildDockerAndPublishImage): add optional disablePublication parameter #784

Merged

Conversation

lemeurherve
Copy link
Member

@lemeurherve lemeurherve commented Nov 10, 2023

This PR adds a parameter to disable tagging and publication of docker image(s) and github release.

Use case: running the same pipeline on both ci.jenkins.io and infra.ci.jenkins.io

Tested with jenkins-infra/account-app#351

Confirmed working as expected: https://ci.jenkins.io/job/Infra/job/account-app/job/main/167/pipeline-console/log?nodeId=87

[2024-02-10T13:15:21.549Z] INFO: publication disabled.

The main branch job passed on ci.jenkins.io.

Ref:

lemeurherve added a commit to jenkinsci/jenkins-infra-test-plugin that referenced this pull request Nov 13, 2023
lemeurherve added a commit to lemeurherve/plugin-site-api that referenced this pull request Nov 13, 2023
lemeurherve added a commit to jenkins-infra/plugin-site-api that referenced this pull request Nov 13, 2023
…mage` (#142)

* feat(build): use `buildDockerAndPublishImage`

* fix hadolint

* cleanup pushToDocker

* restore indentation

* use docker to build only when not on infra.ci

* also stash when not on infra

* Test jenkins-infra/pipeline-library#784

* fixup

* buildDockerAndPublishImage on infra.ci only for now

* remove unused ci.j stash, and stash only the jar in the infra.ci one

* restore blank line

* restore blank line again
@lemeurherve lemeurherve changed the title feat(buildDockerAndPublishImage): add optional enablePublication parameter feat(buildDockerAndPublishImage): add optional disablePublication parameter Feb 9, 2024
@lemeurherve lemeurherve marked this pull request as ready for review February 10, 2024 13:21
@lemeurherve lemeurherve requested a review from a team as a code owner February 10, 2024 13:21
@lemeurherve
Copy link
Member Author

lemeurherve commented Feb 10, 2024

Tested with jenkins-infra/account-app#351

Confirmed working as expected: https://ci.jenkins.io/job/Infra/job/account-app/job/main/167/pipeline-console/log?nodeId=87

[2024-02-10T13:15:21.549Z] INFO: publication disabled.

The main branch job passed on ci.jenkins.io.

@lemeurherve
Copy link
Member Author

A nice follow-up feature would be to disable publication if the merged pull request had a specific label (like skip-publication) for changes that don't worth a new release (doc, GitHub action, updatecli).

Copy link
Contributor

@smerle33 smerle33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lemeurherve lemeurherve merged commit 21ffe67 into jenkins-infra:master Feb 12, 2024
3 checks passed
@lemeurherve lemeurherve deleted the allow-disable-publish-image branch February 12, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants