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

Fix logic on package-buildpack.sh #528

Merged
merged 1 commit into from
Jan 28, 2022
Merged

Fix logic on package-buildpack.sh #528

merged 1 commit into from
Jan 28, 2022

Conversation

dmikusa
Copy link
Contributor

@dmikusa dmikusa commented Jan 28, 2022

Summary

  • The previous logic would require PUBLISH=true to run pack buildpack package and publish the result. This was OK, but if PUBLISH was set to anything else, even an empty string, it would still run pack buildpack package. It doesn't seem like this was actually happening in the pipelines, but this change makes the logic stricter. You need to have PUBLISH=true exactly, or it won't publish.
  • Inside the publish block, we were checking if VERSION_MINOR and VERSION_MAJOR have content. This was incorrectly assuming that these variables will always be set, which was causing pipeline failures. This logic changes the behavior to account for them being not set or empty, and in both cases skips the block that would add additional tags. If there is content, then we'll set the additional tags.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

- The previous logic would require PUBLISH=true to run `pack buildpack package` and publish the result. This was OK, but if PUBLISH was set to anything else, even an empty string, it would still run `pack buildpack package`. It doesn't seem like this was actually happening in the pipelines, but this change makes the logic stricter. You need to have PUBLISH=true exactly, or it won't publish.
- Inside the publish block, we were checking if VERSION_MINOR and VERSION_MAJOR have content. This was incorrectly assuming that these variables will always be set, which was causing pipeline failures. This logic changes the behavior to account for them being not set or empty, and in both cases skips the block that would add additional tags. If there is content, then we'll set the additional tags.

Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
@dmikusa dmikusa added type:bug A general bug semver:patch A change requiring a patch version bump labels Jan 28, 2022
@dmikusa dmikusa requested a review from a team January 28, 2022 18:53
@dmikusa dmikusa merged commit 7ab78da into main Jan 28, 2022
@dmikusa dmikusa deleted the fix-logic branch January 28, 2022 18:56
This was referenced Feb 9, 2022
This was referenced Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump type:bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant