Skip to content

Commit 4b865c9

Browse files
committed
Another one
1 parent d099fd0 commit 4b865c9

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

Dockerfile

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
1-
FROM alpine:3.15
1+
FROM google/cloud-sdk:alpine
22

33
RUN apk update \
4-
&& apk --no-cache add dumb-init postgresql-client curl python3
5-
6-
RUN curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-396.0.0-linux-x86_64.tar.gz
7-
8-
# ARM
9-
# RUN curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-396.0.0-linux-arm.tar.gz
10-
11-
RUN tar -xf google-cloud-cli-396.0.0-linux-x86_64.tar.gz
12-
13-
RUN ./google-cloud-sdk/install.sh --usage-reporting false -q
14-
15-
RUN rm google-cloud-cli-396.0.0-linux-x86_64.tar.gz
16-
17-
ENV PATH $PATH:/google-cloud-sdk/bin/
18-
19-
ADD boto.config /root/.boto
4+
&& apk --no-cache add dumb-init postgresql-client curl
205

216
RUN curl -L https://github.com/odise/go-cron/releases/download/v0.0.7/go-cron-linux.gz | zcat > /usr/local/bin/go-cron && chmod +x /usr/local/bin/go-cron
227

backup.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ case "${PG_BACKUP_ACTION:-dump}" in
4848
AWS_ARGS="--endpoint-url ${S3_ENDPOINT}"
4949
fi
5050

51-
echo "Configuring ACCESS KEYS"
52-
sed -i "s|replace_gs_access_key_id|$S3_ACCESS_KEY_ID|g" /root/.boto
53-
sed -i "s|replace_gs_secret_access_key|$S3_SECRET_ACCESS_KEY|g" /root/.boto
51+
# Google Cloud Auth
52+
echo "Authenticating to Google Cloud..."
53+
echo $S3_SECRET_ACCESS_KEY | base64 -d > /key.json
54+
gcloud auth activate-service-account --key-file /key.json --project "$S3_ACCESS_KEY_ID" -q
5455

5556
# env vars needed for aws tools
5657
export AWS_ACCESS_KEY_ID=$S3_ACCESS_KEY_ID

0 commit comments

Comments
 (0)