commit f2df9a7cd29bd3c458551a4896cf3867f0f392d2
parent 507660229e07632ab6da8191f8d41a5b6fb1ed14
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Fri, 2 Nov 2018 14:34:25 +0100
Do not grep status codes, diff index against local build
Diffstat:
2 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
@@ -12,15 +12,14 @@ deploy-staging:
#image: alpine:edge # https://pkgs.alpinelinux.org/packages?name=&branch=edge
image: registry.gitlab.com/pages/hugo:latest
before_script:
- - apk --no-cache add make lftp curl grep
+ - apk --no-cache add make lftp curl
- hugo version
script:
- make deploy-staging
- sleep 15
- - curl --silent --head https://staging.andersdamsgaard.com | head -n 1 | \
- grep '200'
- - curl --silent --head http://staging.andersdamsgaard.com | head -n 1 | \
- grep '302 Found'
+ - curl --silent --head https://staging.andersdamsgaard.com
+ - curl --silent --head http://staging.andersdamsgaard.com
+ - curl --silent https://staging.andersdamsgaard.com > online.html && diff online.html public/index.html
# artifacts:
# paths:
# - public
@@ -31,19 +30,16 @@ deploy:
#image: alpine:edge # https://pkgs.alpinelinux.org/packages?name=&branch=edge
image: registry.gitlab.com/pages/hugo:latest
before_script:
- - apk --no-cache add make lftp curl grep
+ - apk --no-cache add make lftp curl
- hugo version
script:
- make deploy
- sleep 15
- - curl --silent --head https://andersdamsgaard.com | head -n 1 | \
- grep '200'
- - curl --silent --head https://www.andersdamsgaard.com | head -n 1 | \
- grep '302'
- - curl --silent --head http://andersdamsgaard.com | head -n 1 | \
- grep '302 Found'
- - curl --silent --head http://www.andersdamsgaard.com | head -n 1 | \
- grep '302 Found'
+ - curl --silent --head https://andersdamsgaard.com
+ - curl --silent --head https://www.andersdamsgaard.com
+ - curl --silent --head http://andersdamsgaard.com
+ - curl --silent --head http://www.andersdamsgaard.com
+ - curl --silent https://andersdamsgaard.com > online.html && diff online.html public/index.html
# artifacts:
# paths:
# - public
diff --git a/Makefile b/Makefile
@@ -4,21 +4,27 @@ DOMAIN=andersdamsgaard.com
local:
hugo server -D
+deploy-staging-locally:
+ export FASTMAILKEY=`pass Online/fastmail-files-ftp-password` \
+ && make deploy-staging
+
deploy-locally:
- export FASTMAILKEY=`pass Online/fastmail-files-ftp-password` && make deploy
+ export FASTMAILKEY=`pass Online/fastmail-files-ftp-password` \
+ && make deploy
deploy-staging:
# generate public/
hugo
# remove unprocessed images
find public/ \
+ -name '.DS_Store' \
-name '*.jpg' -not -name '*resize*.jpg' -not -name '*box*.jpg' \
-delete
# upload to fastmail
lftp -c "set ftp:list-options -a; \
open ftp://anders@adamsgaard.dk:$(FASTMAILKEY)@ftp.fastmail.com; \
lcd ./public; \
- cd /anders.staging.adamsgaard.dk/files/$(DOMAIN); \
+ cd /anders.adamsgaard.dk/files/staging.$(DOMAIN); \
mirror --reverse --delete --use-cache --verbose --parallel=2 -p"
deploy: