new drone and makefile

This commit is contained in:
Marvin Steadfast 2020-02-27 15:11:23 +01:00
parent d794cd8107
commit c8bbccf07a
2 changed files with 39 additions and 0 deletions

14
.drone.yml Normal file
View File

@ -0,0 +1,14 @@
---
kind: pipeline
name: default
steps:
- name: build and upload
image: alpine:3.11
pull: always
environment:
FTP_PASS:
from_secret: ftp_pass
commands:
- apk add --no-cache make
- make install_deps
- make ftp_upload

25
Makefile Normal file
View File

@ -0,0 +1,25 @@
FTP_HOST=xsteadfastx.org/
FTP_TARGET_DIR=/
FTP_USER=xstead_0
HUGO_VERSION=0.65.3
OUTPUTDIR=./public
clean:
rm -rf public
build:
hugo
install_deps:
apk add --no-cache lftp git
git clone -b v$(HUGO_VERSION) --depth 1 https://github.com/gohugoio/hugo.git /tmp/hugo
(cd /tmp/hugo; go install)
rm -rf /tmp/hugo
ftp_upload:
lftp ftp://$(FTP_USER):$(FTP_PASS)@$(FTP_HOST) -e "set ssl:verify-certificate no; mirror -R --ignore-time --no-perms --parallel=4 -e --use-cache -v $(OUTPUTDIR) $(FTP_TARGET_DIR); quit"
ftp_upload_clean:
lftp ftp://$(FTP_USER):$(FTP_PASS)@$(FTP_HOST) -e "set ssl:verify-certificate no; mirror -R --no-perms --parallel=4 -e -v $(OUTPUTDIR) $(FTP_TARGET_DIR); quit"
.PHONY: clean build install_deps ftp_upload ftp_upload_clean