diff --git a/README.md b/README.md index fe84abd..e4946c7 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,12 @@ services: ## Building +### Manually + 1. Download Dart Sass (linux-x64) from [here](https://github.com/sass/dart-sass/releases/latest), and extract it with `tar -xzf dart-sass-*.tar.gz` 2. Download Hugo from (linux-amd64) from [here](https://github.com/gohugoio/hugo/releases/latest) and extract it with `tar -xzf hugo_*_linux-amd64.tar.gz --one-top-level` 3. Run `docker build .` + +### Automatically + +1. Edit and run `./download-build-push.sh` diff --git a/download-build-push.sh b/download-build-push.sh new file mode 100755 index 0000000..cf6e9e6 --- /dev/null +++ b/download-build-push.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env sh +ORG=askiiart +NAME=hugo +PUSH=yes + +curl -s https://api.github.com/repos/sass/dart-sass/releases/latest | grep "browser_download_url.*dart-sass-.*-linux-x64.tar.gz" | cut -d : -f 2,3 | tr -d \" | wget -qi - +curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "browser_download_url.*hugo_.*_linux-amd64.tar.gz" | head --lines 1 | cut -d : -f 2,3 | tr -d \" | wget -qi - + +tar -xzf dart-sass-*.tar.gz +tar -xzf hugo_*_linux-amd64.tar.gz --one-top-level + +VERSION=$(find . -name "hugo_*_linux-amd64" | sed 's/.*_\(.*\)_.*/\1/') +ID=$(docker build . -q) + +if PUSH=yes; then + echo hi + exit +fi + +docker tag ${ID} ${ORG}/${NAME}:latest +docker tag ${ID} ${ORG}/${NAME}:v${VERSION} +docker push ${ORG}/${NAME}:latest +docker push ${ORG}/${NAME}:v${VERSION} +