From 3f7bb3c7badf884574f93965dc9bde6442b09059 Mon Sep 17 00:00:00 2001 From: Jonas Oberg Date: Tue, 12 Sep 2017 09:56:30 +0200 Subject: [PATCH] Plan b, upload to aws in preparation. --- Dockerfile | 4 +++- playbook.yml | 1 + site/build/build.sh | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d198af1..e3038ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,9 @@ ENV HUGO_VERSION 0.20.7 ENV HUGO_BINARY hugo_${HUGO_VERSION}_Linux-64bit.deb RUN apt-get update && apt-get upgrade -y && \ - apt-get install -y git curl unzip python3 + apt-get install -y git curl unzip python3 python3-pip libyaml-dev + +RUN pip3 install awscli RUN curl -sS https://getcomposer.org/installer \ | php -- --install-dir=/usr/local/bin --filename=composer diff --git a/playbook.yml b/playbook.yml index 271c105..46ba378 100644 --- a/playbook.yml +++ b/playbook.yml @@ -19,4 +19,5 @@ LETSENCRYPT_EMAIL: jonas@fsfe.org volumes: - "/srv/forms/pmpc:/usr/share/blog/data/signatures:ro" + - "/srv/pmpc-cred:/srv/cred:ro" diff --git a/site/build/build.sh b/site/build/build.sh index 58fff55..fdb7b80 100755 --- a/site/build/build.sh +++ b/site/build/build.sh @@ -18,4 +18,11 @@ if [ "$mode" == "server" ]; then hugo server else hugo + + # + # After building the website, we set the AWS credentials and uploda + # everything to our AWS s3 bucket. + # + . /srv/cred/aws.sh + /usr/local/bin/aws s3 cp /usr/share/blog/public/ s3://aws-website-pmpc-soegm/ --recursive fi