Added version attribute to define hugo version used in pipeline

This commit is contained in:
cbrgm 2018-05-13 01:38:59 +02:00
commit ea27a59bc4
5 changed files with 43 additions and 27 deletions

View file

@ -5,23 +5,25 @@ README_TEMPLATE=./docs/tmpl.md
all: release
test: Dockerfile drone-hugo.sh
docker build -t "plugins/hugo:$(hugo)_test" --build-arg HUGO_VERSION="$(hugo)" .
docker build -t "plugins/hugo:$(release)_test" --build-arg HUGO_VERSION="$(hugo)" .
build: Dockerfile drone-hugo.sh
docker build -t "plugins/hugo:$(hugo)" --build-arg HUGO_VERSION="$(hugo)" .
docker build -t "plugins/hugo:$(release)" --build-arg HUGO_VERSION="$(hugo)" .
docker build -t "plugins/hugo:latest" --build-arg HUGO_VERSION="$(hugo)" .
push: build
docker push "plugins/hugo:$(hugo)"
docker push "plugins/hugo:$(release)"
docker push "plugins/hugo:latest"
release: $(README_TEMPLATE) test build push clean
sed 's/<HUGO_VERSION>/$(hugo)/g' $(README_TEMPLATE) > README.md
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:$(hugo)
docker rmi plugins/hugo:$(release)
docker rmi plugins/hugo:latest
docker rmi plugins/hugo:$(hugo)_test
docker rmi plugins/hugo:$(release)_test