-
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.
-- 98c2b8e by maleo <[email protected]>: Refactoring of Dockerfile This allows passing args to Copybara directly via CMD as an alternative to using environment variables. Closes #239 GitOrigin-RevId: 42493ee Change-Id: I245c22161dcec9756cf5a122514909e5521ccc78
- Loading branch information
1 parent
53b4ee3
commit 9a1e763
Showing
4 changed files
with
59 additions
and
47 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
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