| #!/bin/bash |
| set -e |
|
|
| if [ -z "$BINARY_URL" ]; then |
| echo "Error: BINARY_URL environment variable is required" |
| exit 1 |
| fi |
|
|
| if [ -z "$NOTICE_URL" ]; then |
| echo "Error: NOTICE_URL environment variable is required" |
| exit 1 |
| fi |
|
|
| if [ -d "./bin" ]; then |
| echo "Error: A directory named ./bin already exists in the current directory (/app)." >&2 |
| echo "This likely came from the 'COPY . .' step during the Docker build." >&2 |
| echo "Remove the 'bin' directory from your build context or rename the target download file." >&2 |
| exit 1 |
| fi |
|
|
| pwd |
|
|
| echo "Downloading binary from: $BINARY_URL" |
| curl -o sv "$BINARY_URL" || { echo "Failed to download binary" >&2; exit 1; } |
|
|
| echo "Downloading notice.txt from: $NOTICE_URL" |
| curl -o notice.txt "$NOTICE_URL" || { echo "Failed to notice.txt" >&2; exit 1; } |
| ls |
|
|
| chmod +x ./sv |
| exec ./sv |