google / google/copybara

Docker entrypoint script fails when no COPYBARA_OPTIONS flag passed

Open
#235 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.8k
Forks
345
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.