-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This allows passing args to Copybara directly via CMD as an alternative to using environment variables. - Add .dockerignore to allow using cache - Cleanup Dockerfile - Improve container image startup
- Loading branch information
Showing
5 changed files
with
67 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Handle environment variables for backwards compatibility | ||
if [ -n "${COPYBARA_SUBCOMMAND}" ] || [ -n "${COPYBARA_CONFIG}" ] || [ -n "${COPYBARA_WORKFLOW}" ] || [ -n "${COPYBARA_SOURCEREF}" ] || [ -n "${COPYBARA_OPTIONS}" ]; then | ||
echo "Detected \$COPYBARA_* environment variables, overwriting shell args" | ||
ARGS=() | ||
if [ -n "${COPYBARA_SUBCOMMAND}" ]; then | ||
ARGS+=("${COPYBARA_SUBCOMMAND}") | ||
else | ||
ARGS+=("migrate") | ||
fi | ||
if [ -n "${COPYBARA_CONFIG}" ]; then | ||
ARGS+=("${COPYBARA_CONFIG}") | ||
else | ||
ARGS+=("copy.bara.sky") | ||
fi | ||
if [ -n "${COPYBARA_WORKFLOW}" ]; then | ||
ARGS+=("${COPYBARA_WORKFLOW}") | ||
else | ||
ARGS+=("default") | ||
fi | ||
if [ -n "${COPYBARA_SOURCEREF}" ]; then | ||
ARGS+=("${COPYBARA_SOURCEREF}") | ||
fi | ||
if [ -n "${COPYBARA_OPTIONS}" ]; then | ||
ARGS+=(${COPYBARA_OPTIONS}) # no quotation marks to split them by space | ||
fi | ||
echo "Setting arguments to: \"${ARGS[@]}\"" | ||
set -- "${ARGS[@]}" | ||
fi | ||
|
||
exec java -jar /opt/copybara/copybara_deploy.jar "$@" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
* | ||
!.docker | ||
!external | ||
!java | ||
!third_party | ||
!.bazelrc | ||
!BUILD | ||
!repositories*.bzl | ||
!WORKSPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters