Skip to content

Docker entrypoint script fails when no COPYBARA_OPTIONS flag passed #235

@sp3nx0r

Description

@sp3nx0r

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions