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 build and push scripts to allow Podman alias #234

Merged
merged 5 commits into from
Apr 17, 2024

Conversation

Jdubrick
Copy link
Contributor

@Jdubrick Jdubrick commented Apr 16, 2024

Please specify the area for this PR
Build scripts and documentation

What does does this PR do / why we need it:
This PR fixes an issue where running docker-build.sh and docker-push.sh from test/integration was not properly setting the Podman alias. This was due to setenv.sh not being able to expand its set alias back into the calling scripts environment. This was fixed with the addition of shopt -s expand_aliases to setenv.sh.

Additionally, when you run docker-push.sh it is looking for a command-line argument for the tag and that was not documented anywhere so I added a snippet for that to README.md.

This PR also removes shopt -s expand_aliases from build_registry.sh as it is no longer required. This is due to the alias expansion happening in the setenv.sh script.

The index/server build.sh and push.sh scripts were also updated to properly use Podman when USE_PODMAN is set to true.

Which issue(s) this PR fixes:

fixes devfile/api#1502
fixes devfile/api#1426

PR acceptance criteria:

  • Test Coverage
    • Are your changes sufficiently tested, and are any applicable test cases added or updated to cover your changes?

Documentation (WIP)

How to test changes / Special notes to the reviewer:

  1. Run export USE_PODMAN=true
  2. cd into tests/integration
  3. Run ./docker-build.sh and/or ./docker-push.sh <tag>
  4. cd into index/server
  5. Run ./build.sh and/or ./push.sh <tag>
  6. From root run bash build_registry.sh

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 16, 2024
Copy link
Member

@michael-valdron michael-valdron left a comment

Choose a reason for hiding this comment

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

Good find, this will help with a lot in fixing the remaining under registry-support!

I think with this, we should be able to remove this statement under build_registry.sh so that it uses the one under setenv.sh:

shopt -s expand_aliases

@Jdubrick
Copy link
Contributor Author

Good find, this will help with a lot in fixing the remaining under registry-support!

I think with this, we should be able to remove this statement under build_registry.sh so that it uses the one under setenv.sh:

shopt -s expand_aliases

I agree. I think I am going to include devfile/api#1426 as part of this PR because it is an identical fix, I will also clean up build_registry.sh then as well.

@michael-valdron

Copy link
Member

@michael-valdron michael-valdron left a comment

Choose a reason for hiding this comment

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

/lgtm

Tested docker-build.sh and docker-push.sh with USE_PODMAN=true set and works locally for me.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 16, 2024
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 16, 2024
@Jdubrick
Copy link
Contributor Author

FYI I updated the PR comment to reflect new changes with the additional changes to fix devfile/api#1426 as well. @thepetk @michael-valdron

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Copy link
Contributor

@thepetk thepetk left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2024
Copy link

openshift-ci bot commented Apr 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jdubrick, michael-valdron, thepetk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Jdubrick,michael-valdron,thepetk]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Jdubrick Jdubrick merged commit 954a12f into devfile:main Apr 17, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
3 participants