Introduction
Introduction Statistics Contact Development Disclaimer Help
tAdd deploy-staging target and configuration - andersdamsgaard.com - my photogr…
git clone git://src.adamsgaard.dk/andersdamsgaard.com
Log
Files
Refs
Submodules
README
LICENSE
---
commit 8a7ea5d339ddc3f5c3d957399b71dbc1b3d15c28
parent 7b26ea04afca4a62eed6a9c719fad592dff2f29c
Author: Anders Damsgaard <[email protected]>
Date: Fri, 2 Nov 2018 14:20:09 +0100
Add deploy-staging target and configuration
Diffstat:
M .gitlab-ci.yml | 21 ++++++++++++++++++---
M Makefile | 14 ++++++++++++++
2 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
t@@ -1,14 +1,29 @@
variables:
GIT_SUBMODULE_STRATEGY: recursive
-test:
+deploy:
+ #image: alpine:edge # https://pkgs.alpinelinux.org/packages?name=&branch=ed…
image: registry.gitlab.com/pages/hugo:latest
+ before_script:
+ - apk --no-cache add make lftp curl grep
+ - hugo version
script:
- - hugo
+ - make deploy-staging
+ - 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'
+ # artifacts:
+ # paths:
+ # - public
except:
- master
-# deployment will fail until hugo is updated to version 0.50
deploy:
#image: alpine:edge # https://pkgs.alpinelinux.org/packages?name=&branch=ed…
image: registry.gitlab.com/pages/hugo:latest
diff --git a/Makefile b/Makefile
t@@ -7,6 +7,20 @@ local:
deploy-locally:
export FASTMAILKEY=`pass Online/fastmail-files-ftp-password` && make d…
+deploy-staging:
+ # generate public/
+ hugo
+ # remove unprocessed images
+ find public/ \
+ -name '*.jpg' -not -name '*resize*.jpg' -not -name '*box*.jpg'…
+ -delete
+ # upload to fastmail
+ lftp -c "set ftp:list-options -a; \
+ open ftp://[email protected]:$(FASTMAILKEY)@ftp.fastmail.com; \
+ lcd ./public; \
+ cd /anders.staging.adamsgaard.dk/files/$(DOMAIN); \
+ mirror --reverse --delete --use-cache --verbose --parallel=2 -p"
+
deploy:
# generate public/
hugo
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.