Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Docker entrypoint script fails when no COPYBARA_OPTIONS flag passed #235

Open
sp3nx0r opened this issue May 16, 2023 · 1 comment
Open

Comments

@sp3nx0r
Copy link

sp3nx0r commented May 16, 2023

Ran into this during deployment using a dockerized implementation:

+ java -jar /opt/copybara/copybara_deploy.jar '' migrate copy.bara.sky push_examples_private_to_public ''
May 16, 2023 6:42:59 PM com.google.copybara.Main configureLog
INFO: Setting up LogManager
Copybara (Version: Unknown version)
0516 18:43:00.214 ERROR: Invalid subcommand ''. Available commands: [generator, help, info, migrate, onboard, validate, version]
0516 18:43:00.217 ERROR: Try 'copybara help'.

Because of the ordering in the [entrypoint.sh](https://github.com/google/copybara/blob/47ce5ccd468b46bf3a813a0ce3e83ee44fead192/.docker/entrypoint.sh#L17) script, it assumes there's some value to be passed for the COPYBARA_OPTIONS. Moving COPYBARA_SUBCOMMAND up the order in that script resolves the issue.

Note that we opted to use an ENTRYPOINT in the Dockerfile, so we're deviating a little bit from the existing Dockerfile, but because we wanted to abstract away all the command syntax from our devs and just expose the config options as envvars.

@hsudhof
Copy link
Collaborator

hsudhof commented May 16, 2023

Ah, yes. We switched to a new JCommander version that does not discard empty params.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@sp3nx0r @hsudhof and others