Add download, build, and optionally push script
This commit is contained in:
parent
71caaca21c
commit
894e2bed22
2 changed files with 30 additions and 0 deletions
|
@ -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`
|
||||
|
|
24
download-build-push.sh
Executable file
24
download-build-push.sh
Executable file
|
@ -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}
|
||||
|
Loading…
Reference in a new issue