Skip to content

Define USER and BRANCH in the Docker image#393

Merged
mkhansenbot merged 3 commits intoros-navigation:masterfrom
Nickolaim:docker2
Dec 3, 2018
Merged

Define USER and BRANCH in the Docker image#393
mkhansenbot merged 3 commits intoros-navigation:masterfrom
Nickolaim:docker2

Conversation

@Nickolaim
Copy link
Copy Markdown
Contributor

Basic Info

Info Please fill out this column
Ticket(s) this addresses (N/A)
Primary OS tested on (Ubuntu)
Robotic platform tested on (N/A)

Description of contribution in a few bullet points

It is the response to the discussion in #389. I updated Travis, so it errors if it runs in any repo but ros-planning/navigation2. Added retries for wget. For some reasons, I cannot download the entire archive without retries, probably due to my physical location. The other changes are about the ability to customize GitHub username and branch while running Docker. The default has not been changed.

Hope this is a better PR than the previous one.

@SteveMacenski, @mkhansen-intel

Copy link
Copy Markdown
Collaborator

@mkhansenbot mkhansenbot left a comment

Choose a reason for hiding this comment

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

Thank you for sumitting this PR, your contribution is appreciated, however, I would like a minor change to how you're doing the if conditional. See my inline comment.

Dockerfile Outdated
ARG PULLREQ=false
ARG BRANCH=master
RUN echo "pullreq is $PULLREQ"
RUN if [ "$PULLREQ" == "false" ]; \
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd prefer if you made if [ $PULLREQ == "false" && $BRANCH == "master"]; then (echo the message) be the base case, but add a new case for elif [ $BRANCH != "master" ]; then checkout the branch.

I realize the end effect is the same but it makes the default case do nothing instead of checking out master onto a temporary branch which is more clear, I think it also is more readable and understandable in the $BRANCH case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Collaborator

@mkhansenbot mkhansenbot left a comment

Choose a reason for hiding this comment

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

Thanks for making the change. Looks good to me 👍

@crdelsey or @SteveMacenski - please review

cd -; \
echo "No pull request number given - defaulting to $BRANCH branch"; \
else \
git fetch origin pull/$PULLREQ/head:pr_branch; \
Copy link
Copy Markdown

@ghost ghost Dec 3, 2018

Choose a reason for hiding this comment

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

This last else clause gets executed if PULLREQ is true and BRANCH is master. Is that possible?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

BRANCH is master by default, so I would expect that to be the case when PULLREQ is true.

@mkhansenbot mkhansenbot merged commit 5424334 into ros-navigation:master Dec 3, 2018
mini-1235 pushed a commit to mini-1235/navigation2 that referenced this pull request Feb 5, 2025
Forsyth-Creations pushed a commit to Forsyth-Creations/navigation2 that referenced this pull request Feb 19, 2025
Co-authored-by: Bence Magyar <bence.magyar.robotics@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants