-
Notifications
You must be signed in to change notification settings - Fork 556
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
36 lines (29 loc) · 1.07 KB
/
docker-entrypoint.sh
File metadata and controls
36 lines (29 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
set -e
# Set default registry URI, same as Dockerfile
REGISTRY_URI="/hyperlane-registry"
echo "REGISTRY_COMMIT: $REGISTRY_COMMIT"
echo "REGISTRY_URI: $REGISTRY_URI"
echo "Current commit: $(git -C "$REGISTRY_URI" rev-parse HEAD)"
# Only update registry if REGISTRY_COMMIT is set
if [ -n "$REGISTRY_COMMIT" ]; then
echo "Updating Hyperlane registry to: $REGISTRY_COMMIT"
OLDPWD=$(pwd)
cd "$REGISTRY_URI"
git fetch origin "$REGISTRY_COMMIT"
git checkout "$REGISTRY_COMMIT"
# Only reset if it's a branch
if git show-ref --verify --quiet "refs/remotes/origin/$REGISTRY_COMMIT"; then
git reset --hard "origin/$REGISTRY_COMMIT"
fi
cd "$OLDPWD"
fi
# If INSTALL_GCP_LOGGER_CLI is true, install the package
if [ "$INSTALL_GCP_LOGGER_CLI" = "true" ]; then
echo "INSTALL_GCP_LOGGER_CLI is set, installing @google-cloud/pino-logging-gcp-config for CLI..."
# We install in the CLI directory context for pnpm workspaces
pnpm -C typescript/cli add @google-cloud/pino-logging-gcp-config
echo "Installation complete."
fi
# Execute the main container command
exec "$@"