From 77008af86e27b19f5f82ffef049a990ba838c913 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Wed, 8 Jan 2020 13:35:01 +0100 Subject: [PATCH 1/5] deploy new offen version to staging --- homepage/pelicanconf.py | 2 +- homepage/publishconf.py | 2 +- homepage/theme/templates/base.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homepage/pelicanconf.py b/homepage/pelicanconf.py index bdae281..5ef5570 100644 --- a/homepage/pelicanconf.py +++ b/homepage/pelicanconf.py @@ -69,4 +69,4 @@ PATREON_URL = 'https://www.patreon.com/offen' LINKEDIN_URL = 'https://www.linkedin.com/company/hioffen' TWITTER_URL = 'https://twitter.com/hioffen' -# OFFEN_ACCOUNT_ID = '9b63c4d8-65c0-438c-9d30-cc4b01173393' +OFFEN_ACCOUNT_ID = '8f7ee44a-4cd8-47f2-a77e-8c7c98d46b89' diff --git a/homepage/publishconf.py b/homepage/publishconf.py index 11d3de2..2d3d36c 100644 --- a/homepage/publishconf.py +++ b/homepage/publishconf.py @@ -16,4 +16,4 @@ DELETE_OUTPUT_DIRECTORY = True PLUGINS += ['optimize_images'] -# OFFEN_ACCOUNT_ID = '5ec8345a-2a45-4eb9-92e5-8d9e5684db58' +OFFEN_ACCOUNT_ID = None diff --git a/homepage/theme/templates/base.html b/homepage/theme/templates/base.html index a78e818..0ccd272 100644 --- a/homepage/theme/templates/base.html +++ b/homepage/theme/templates/base.html @@ -28,7 +28,7 @@ {% if OFFEN_ACCOUNT_ID and not no_stats %} - + {% endif %} {% endblock %} From 35b3520f8de2b95a49ab015afeedef0bec28fe4a Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Wed, 8 Jan 2020 13:45:51 +0100 Subject: [PATCH 2/5] source offen account id from env --- homepage/pelicanconf.py | 3 ++- homepage/publishconf.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/homepage/pelicanconf.py b/homepage/pelicanconf.py index 5ef5570..65fc504 100644 --- a/homepage/pelicanconf.py +++ b/homepage/pelicanconf.py @@ -1,3 +1,4 @@ +import os from datetime import datetime from calendar import month_name # If your site is available via HTTPS, make sure SITEURL begins with https:// @@ -69,4 +70,4 @@ PATREON_URL = 'https://www.patreon.com/offen' LINKEDIN_URL = 'https://www.linkedin.com/company/hioffen' TWITTER_URL = 'https://twitter.com/hioffen' -OFFEN_ACCOUNT_ID = '8f7ee44a-4cd8-47f2-a77e-8c7c98d46b89' +OFFEN_ACCOUNT_ID = os.environ.get('OFFEN_ACCOUNT_ID', None) diff --git a/homepage/publishconf.py b/homepage/publishconf.py index 2d3d36c..17a1e20 100644 --- a/homepage/publishconf.py +++ b/homepage/publishconf.py @@ -15,5 +15,3 @@ FEED_ALL_ATOM = 'feeds/all.atom.xml' DELETE_OUTPUT_DIRECTORY = True PLUGINS += ['optimize_images'] - -OFFEN_ACCOUNT_ID = None From 8cc74d9cf4671d109ae88bd1c5832e2621dd5775 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Wed, 8 Jan 2020 15:53:08 +0100 Subject: [PATCH 3/5] inject offen account id at build time --- .circleci/config.yml | 1 + Makefile | 2 +- build/Dockerfile | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a64c594..beda556 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,6 +25,7 @@ jobs: export BUCKET="offen-dev-staging" export DISTRIBUTION="E13I20LK8ASYFH" export ROBOTS_FILE="robots.txt.staging" + export OFFEN_ACCOUNT_ID="8f7ee44a-4cd8-47f2-a77e-8c7c98d46b89" fi make build aws s3 sync --delete ./output/. s3://$BUCKET diff --git a/Makefile b/Makefile index ff62038..d1512c5 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ ROBOTS_FILE ?= robots.txt.staging SITEURL ?= http://localhost:8000 build: - @docker build --build-arg siteurl=${SITEURL} -t offen/website -f build/Dockerfile . + @docker build --build-arg siteurl=${SITEURL} --build-arg offen-account-id=${OFFEN_ACCOUNT_ID} -t offen/website -f build/Dockerfile . @rm -rf output && mkdir output @docker create --entrypoint=bash -it --name assets offen/website @docker cp assets:/code/homepage/output/. ./output/ diff --git a/build/Dockerfile b/build/Dockerfile index 518c59e..5bd3952 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -5,6 +5,8 @@ ENV NODE_PATH="/usr/lib/node_modules" ARG siteurl ENV SITEURL=$siteurl +ARG offen-account-id +ENV OFFEN_ACCOUNT_ID=$offen-account-id RUN npm install -g postcss-cli@^6.1.3 autoprefixer@^9.7.0 svgo@^1.3.0 RUN apt-get update \ From af769aeee1d3807bc4177470542d9299532355a5 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Wed, 8 Jan 2020 15:58:59 +0100 Subject: [PATCH 4/5] do not use hyphens in build arg --- Makefile | 2 +- build/Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d1512c5..b3069c0 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ ROBOTS_FILE ?= robots.txt.staging SITEURL ?= http://localhost:8000 build: - @docker build --build-arg siteurl=${SITEURL} --build-arg offen-account-id=${OFFEN_ACCOUNT_ID} -t offen/website -f build/Dockerfile . + @docker build --build-arg siteurl=${SITEURL} --build-arg offenaccountid=${OFFEN_ACCOUNT_ID} -t offen/website -f build/Dockerfile . @rm -rf output && mkdir output @docker create --entrypoint=bash -it --name assets offen/website @docker cp assets:/code/homepage/output/. ./output/ diff --git a/build/Dockerfile b/build/Dockerfile index 5bd3952..c82a961 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -5,8 +5,8 @@ ENV NODE_PATH="/usr/lib/node_modules" ARG siteurl ENV SITEURL=$siteurl -ARG offen-account-id -ENV OFFEN_ACCOUNT_ID=$offen-account-id +ARG offenaccountid +ENV OFFEN_ACCOUNT_ID=$offenaccountid RUN npm install -g postcss-cli@^6.1.3 autoprefixer@^9.7.0 svgo@^1.3.0 RUN apt-get update \ From be08f5b8353dd937b9b39ee4b776c5cbdc9e685c Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Sun, 12 Jan 2020 19:03:33 +0100 Subject: [PATCH 5/5] add production analytics id --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index beda556..89a2fc5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,6 +20,7 @@ jobs: export BUCKET="offen-dev-production" export DISTRIBUTION="E2UP8XHLFOC3QC" export ROBOTS_FILE="robots.txt.production" + export OFFEN_ACCOUNT_ID="5ec8345a-2a45-4eb9-92e5-8d9e5684db58" else export SITEURL="https://staging.offen.dev" export BUCKET="offen-dev-staging"