andersdamsgaard.com

my photography webpage
git clone git://src.adamsgaard.dk/andersdamsgaard.com # fast
git clone https://src.adamsgaard.dk/andersdamsgaard.com.git # slow
Log | Files | Refs | Submodules | README | LICENSE Back to index

commit 49566bd769cd122ca7ea5d292784e894c0e8000b
parent 6f9e3dd5f6767be043bcb034dd2f7f296283d92d
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Mon,  5 Nov 2018 06:29:34 +0100

Deploy at gitlab instead of fastmail

Diffstat:
M.gitlab-ci.yml | 91++++++++++++++++++++++++++++++++++++++++++++++---------------------------------
MMakefile | 27+++++++++++++++------------
2 files changed, 68 insertions(+), 50 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml @@ -8,49 +8,64 @@ test: except: - master -deploy-staging: - # image: alpine:edge # https://pkgs.alpinelinux.org/packages?name=&branch=edge - # image: registry.gitlab.com/pages/hugo:latest +pages: image: registry.gitlab.com/plett/hugoextended:0.50 before_script: # - apk --no-cache add make lftp curl npm - apt-get install make lftp curl - hugo version script: - - make deploy-staging - - sleep 15 - - 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 - after_script: - - du -h public/ - # artifacts: - # paths: - # - public - except: + - make deploy-gitlab + artifacts: + paths: + - public + only: - master -deploy: - # image: alpine:edge # https://pkgs.alpinelinux.org/packages?name=&branch=edge - # image: registry.gitlab.com/pages/hugo:latest - image: registry.gitlab.com/plett/hugoextended:0.50 - before_script: - # - apk --no-cache add make lftp curl npm - - apt-get update - - apt-get -y install make lftp curl - - hugo version - script: - - make deploy - - sleep 15 - - 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 - after_script: - - du -h public/ - # artifacts: - # paths: - # - public - only: - - master + +# deploy-staging: +# # image: alpine:edge # https://pkgs.alpinelinux.org/packages?name=&branch=edge +# # image: registry.gitlab.com/pages/hugo:latest +# image: registry.gitlab.com/plett/hugoextended:0.50 +# before_script: +# # - apk --no-cache add make lftp curl npm +# - apt-get install make lftp curl +# - hugo version +# script: +# - make deploy-staging +# - sleep 15 +# - 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 +# after_script: +# - du -h public/ +# # artifacts: +# # paths: +# # - public +# except: +# - master + +# deploy: +# # image: alpine:edge # https://pkgs.alpinelinux.org/packages?name=&branch=edge +# # image: registry.gitlab.com/pages/hugo:latest +# image: registry.gitlab.com/plett/hugoextended:0.50 +# before_script: +# # - apk --no-cache add make lftp curl npm +# - apt-get update +# - apt-get -y install make lftp curl +# - hugo version +# script: +# - make deploy +# - sleep 15 +# - 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 +# after_script: +# - du -h public/ +# # artifacts: +# # paths: +# # - public +# only: +# - master diff --git a/Makefile b/Makefile @@ -4,15 +4,24 @@ DOMAIN=andersdamsgaard.com local: hugo server -D +.PHONY: deploy +deploy: deploy-fm + +.PHONY: deploy-gitlab +deploy-gitlab: generate-public + +.PHONY: deploy-staging-locally deploy-staging-locally: export FASTMAILKEY=`pass Online/fastmail-files-ftp-password` \ && make deploy-staging +.PHONY: deploy-locally deploy-locally: export FASTMAILKEY=`pass Online/fastmail-files-ftp-password` \ && make deploy -deploy-staging: +.PHONY: generate-public +generate-public: # generate public/ hugo # remove unprocessed images @@ -23,6 +32,9 @@ deploy-staging: -not -name '*fill*.jpg' \ -not -name '*fit*.jpg' \ -delete + +.PHONY: deploy-staging +deploy-staging: generate-public # upload to fastmail @lftp -c "set ftp:list-options -a; \ open ftp://anders@adamsgaard.dk:$(FASTMAILKEY)@ftp.fastmail.com; \ @@ -30,17 +42,8 @@ deploy-staging: cd /anders.adamsgaard.dk/files/staging.$(DOMAIN); \ mirror --reverse --delete --use-cache --verbose --parallel=2 -p" -deploy: - # generate public/ - hugo - # remove unprocessed images - find public/ \ - -name '.DS_Store' \ - -name '*.jpg' \ - -not -name '*resize*.jpg' \ - -not -name '*fill*.jpg' \ - -not -name '*fit*.jpg' \ - -delete +.PHONY: deploy-fm +deploy-fm: generate-public # upload to fastmail @lftp -c "set ftp:list-options -a; \ open ftp://anders@adamsgaard.dk:$(FASTMAILKEY)@ftp.fastmail.com; \