Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

chore(sidecar-images): fix bumping of devfiles to new sidecar tags #479

Merged
merged 6 commits into from
Oct 6, 2021

Conversation

vitaliy-guliy
Copy link
Contributor

Signed-off-by: Vitaliy Gulyy vgulyy@redhat.com

What does this PR do?

Fixes creating of pull request after bumping the devfiles to new sidecar tags.
Fixup for #464

Screenshot/screencast of this PR

no screenshot

What issues does this PR fix or reference?

eclipse-che/che#19695

How to test this PR?

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
@@ -14,3 +14,4 @@ ENTRYPOINT [ "/entrypoint.sh" ]
CMD ["tail", "-f", "/dev/null"]

LABEL "che.base.image" ${BASE_IMAGE}

Copy link
Contributor

Choose a reason for hiding this comment

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

do we need this change ?

Copy link
Contributor Author

@vitaliy-guliy vitaliy-guliy Oct 6, 2021

Choose a reason for hiding this comment

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

It needs to trigger the build script to rebuild all the images, then to bump devfiles to new sidecars tag and create a pull request.

Copy link
Contributor

Choose a reason for hiding this comment

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

could we just execute the action with a parameter 'rebuild all' ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we do this when changes in base.dockerfile, entrypoint,sh or in install-editor-tooling.sh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

action build-sidecar-images-on-push.yml runs build-sidecar-images-on-push.sh which detects the changes in the last commit and decides whether it needs to rebuild only specific image or all the images.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My latest commit (this fixup) will not contain anything related to the dockerfiles, and anything will be built.
To be able to build the images manually we need to add another gh-action. But do we need it?

Copy link
Contributor

Choose a reason for hiding this comment

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

so instead of having

if [ -n "${CHANGES}" ]; then
  echo -e "\nRebuild ALL images"

we check as well if there is parameter saying to rebuild anyway all the images

and in the github .yaml we provide the parameter to the build.sh script (that may be empty, default case)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so instead of having

if [ -n "${CHANGES}" ]; then
  echo -e "\nRebuild ALL images"

we check as well if there is parameter saying to rebuild anyway all the images

ok, trying to add it.

Copy link
Contributor

Choose a reason for hiding this comment

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

@vitaliy-guliy you don't need to add a new action.
One action can be triggered manually or when we push changes

and when we trigger it manually we can add specific parameters and in that case we can ask to rebuild everything

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the PR. Does it look better?

dockerfiles/build.sh Outdated Show resolved Hide resolved
Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
@vitaliy-guliy
Copy link
Contributor Author

Have just tested the case with sequence of actions on another repository.
Changes in sources are persisted between running of action steps.
Seems I missed one argument when launching build.sh script.

Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
run: ./build/workflows/build-sidecar-images-on-push.sh --push --rm --update-devfiles
run: |
if [[ "${{ github.event.inputs.rebuild_all }}" == "true" ]]; then
./build/workflows/build-sidecar-images-on-push.sh --push --rm --update-devfiles --rebuild-all
Copy link
Contributor

Choose a reason for hiding this comment

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

we could have a parameter EXTRA_ARG set to empty or to --rebuild-all to avoid to duplicate the line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it.

Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
@vitaliy-guliy vitaliy-guliy merged commit ce0526f into main Oct 6, 2021
@vitaliy-guliy vitaliy-guliy deleted the che-19695-fixup2 branch October 6, 2021 14:04
@che-bot che-bot added this to the 7.38 milestone Oct 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants