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

core: Dockerfile: Enforce style for git version #2441

Merged
merged 2 commits into from Apr 26, 2024

Conversation

patrickelectric
Copy link
Member

Fix #2435

@patrickelectric patrickelectric added the merge-after-stable Should be merged only after next stable release label Mar 14, 2024
core/Dockerfile Outdated
ARG GIT_DESCRIBE_TAGS
RUN [ -z "$GIT_DESCRIBE_TAGS" ] \
&& echo "GIT_DESCRIBE_TAGS argument not provided." \
&& echo "Use: --build-arg GIT_DESCRIBE_TAGS=\$(git describe --tags --long --always)" \
&& exit 1 \
|| [[ ! $GIT_DESCRIBE_TAGS =~ -[0-9]+-g[a-f0-9]{8}$ ]] \
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe change this line to something like this, since /bin/sh will not support the [[ ]] and docker usually uses /bin/sh, at least in my machine didn't worked without invoking bash

Suggested change
|| [[ ! $GIT_DESCRIBE_TAGS =~ -[0-9]+-g[a-f0-9]{8}$ ]] \
|| /bin/bash -c "[[ ! $GIT_DESCRIBE_TAGS =~ -[0-9]+-g[a-f0-9]{8}$ ]]" \

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
…P_GIT_DESCRIBE

This avoid building the entire docker if building locally for tests

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
@patrickelectric
Copy link
Member Author

ping @JoaoMario109

@patrickelectric patrickelectric merged commit 66c1f53 into bluerobotics:master Apr 26, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-after-stable Should be merged only after next stable release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dockerfile: Add validation for GIT_DESCRIBE_TAGS to be in a valid format
3 participants