-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
executable file
·44 lines (33 loc) · 918 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
set -e
# if [ -z "$S3_BUCKET" ]; then
# echo "S3_BUCKET is not set. Quitting."
# exit 1
# fi
# if [ -z "$AWS_ACCESS_KEY_ID" ]; then
# echo "AWS_ACCESS_KEY_ID is not set. Quitting."
# exit 1
# fi
# if [ -z "$AWS_SECRET_ACCESS_KEY" ]; then
# echo "AWS_SECRET_ACCESS_KEY is not set. Quitting."
# exit 1
# fi
# if [-z "$FILE"]; then
# echo "FILE is not set. Quitting"
# exit 1
# fi
# if [ -z "$AWS_REGION"]; then
# AWS_REGION="us-east-1"
# fi
mkdir -p ~/.aws
touch ~/.aws/credentials
echo "[default]
aws_access_key_id = ${AWS_ACCESS_KEY_ID}
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}" > ~/.aws/credentials
sh -c "aws configure set region ${AWS_DEFAULT_REGION}"
# Extract the base64 encoded config data and write this to the KUBECONFIG
echo "${KUBE_CONFIG_DATA}" | base64 --decode > /tmp/config
export KUBECONFIG=/tmp/config
sh -c "kubectl $*"
rm -rf ~/.aws
rm -rf /tmp/config