Go implementation of the original bash plugin, containing all features

This commit is contained in:
cbrgm 2018-06-12 18:41:04 +02:00
commit 1ec3bbb482
19 changed files with 826 additions and 671 deletions

View file

@ -1,29 +1,17 @@
.PHONY: all test push build release clean
.PHONY: test build amd64 arm64 arm i386
README_TEMPLATE=./docs/tmpl.md
test:
dep ensure
go test ./...
all: release
build: .drone.sh
./.drone.sh
test: Dockerfile drone-hugo.sh
docker build -t "plugins/hugo:$(release)_test" --build-arg HUGO_VERSION="$(hugo)" .
amd64: Dockerfile
docker build -t "plugins/hugo:amd64" --build-arg HUGO_VERSION="$(hugo)" --build-arg HUGO_ARCH=64bit .
build: Dockerfile drone-hugo.sh
docker build -t "plugins/hugo:$(release)" --build-arg HUGO_VERSION="$(hugo)" .
docker build -t "plugins/hugo:latest" --build-arg HUGO_VERSION="$(hugo)" .
arm64: Dockerfile.arm64
docker build -t "plugins/hugo:arm64" --build-arg HUGO_VERSION="$(hugo)" --build-arg HUGO_ARCH=arm64 .
push: build
docker push "plugins/hugo:$(release)"
docker push "plugins/hugo:latest"
release: $(README_TEMPLATE) test push build clean
sed 's/<HUGO_VERSION>/$(hugo)/g' $(README_TEMPLATE) > temp.md
sed 's/<RELEASE>/$(release)/g' temp.md > README.md
rm -rf temp.md
git add .
git commit -m "Updated to the latest Hugo version v.$(hugo), see https://github.com/gohugoio/hugo/releases"
git push origin master
clean:
docker rmi plugins/hugo:$(release)
docker rmi plugins/hugo:latest
docker rmi plugins/hugo:$(release)_test
arm: Dockerfile.arm
docker build -t "plugins/hugo:arm" --build-arg HUGO_VERSION="$(hugo)" --build-arg HUGO_ARCH=arm .