-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·30 lines (23 loc) · 1014 Bytes
/
entrypoint.sh
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
#!/bin/sh
set -e
# Check if provider is AWS
if [ "$PROVIDER" = "aws" ]; then
aws ecr get-login-password --region "$AWS_REGION" | docker login --username AWS --password-stdin "$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com"
# Check if provider is GCP
elif [ "$PROVIDER" = "gcp" ]; then
gcloud auth configure-docker "$GCP_REGION-docker.pkg.dev" --quiet
# Check if provider is Docker Hub
elif [ "$PROVIDER" = "dockerhub" ]; then
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
# Check if provider is GitHub Container Registry
elif [ "$PROVIDER" = "github" ]; then
echo "$TOKEN" | docker login ghcr.io -u "$GITHUB_USERNAME" --password-stdin
# Check if provider is Azure
elif [ "$PROVIDER" = "azure" ]; then
az login --service-principal -u "$AZURE_CLIENT_ID" -p "$AZURE_CLIENT_SECRET" --tenant "$AZURE_TENANT_ID"
az acr login --name "$AZURE_REGISTRY_NAME"
else
echo "Please pass a valid provider"
fi
# Execute the application
exec "/go/src/app/enigma" "$@"