-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathcustom-entrypoint.sh.tftpl
43 lines (34 loc) · 1.43 KB
/
custom-entrypoint.sh.tftpl
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
#!/bin/bash
set -e
mkdir -p ${mount_folder}
chown 100 ${mount_folder}
cat <<'EOF' > "${mount_folder}/${entrypoint_filename}"
#!/bin/bash
set -e
ARCH="x86_64"
apk --no-cache upgrade && apk --no-cache add \
curl \
python3 \
py3-crcmod \
py3-openssl \
bash \
libc6-compat \
openssh-client \
git \
gnupg \
&& curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-${cloud_sdk_version}-linux-$${ARCH}.tar.gz && \
tar xzf google-cloud-cli-${cloud_sdk_version}-linux-$${ARCH}.tar.gz && \
rm google-cloud-cli-${cloud_sdk_version}-linux-$${ARCH}.tar.gz
export PATH=$PATH:/google-cloud-sdk/bin
gcloud config set core/disable_usage_reporting true
gcloud config set component_manager/disable_update_check true
gcloud config set metrics/environment github_docker_image
gcloud --version
gcloud secrets versions access latest --secret="${app_key_secret_name}" > "${key_file_path}" && chmod 400 "${key_file_path}" && chown 100 "${key_file_path}"
export ATLANTIS_GH_APP_ID=$(gcloud secrets versions access latest --secret="${app_id_secret_name}")
export ATLANTIS_GH_APP_KEY_FILE="${key_file_path}"
export ATLANTIS_GH_WEBHOOK_SECRET=$(gcloud secrets versions access latest --secret="${webhook_secret_secret_name}")
# Call original atlantis entrypoint, passing along all arguments
docker-entrypoint.sh "$@"
EOF
chmod 0755 "${mount_folder}/${entrypoint_filename}"