Use a python builder for handling automated fetch of tag
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
e24298f786
commit
190ee269d8
2 changed files with 13 additions and 2 deletions
|
@ -2,6 +2,6 @@ docker-build:
|
||||||
stage: build
|
stage: build
|
||||||
before_script:
|
before_script:
|
||||||
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" registry.baalajimaestro.me --password-stdin
|
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" registry.baalajimaestro.me --password-stdin
|
||||||
|
- pip install --user -r requirements.txt
|
||||||
script:
|
script:
|
||||||
- docker build . -t registry.baalajimaestro.me/baalajimaestro/hugo-alpine-ext:latest
|
- python build.py
|
||||||
- docker push registry.baalajimaestro.me/baalajimaestro/hugo-alpine-ext:latest
|
|
11
build.py
Normal file
11
build.py
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import subprocess
|
||||||
|
import os
|
||||||
|
from requests import get
|
||||||
|
import ujson
|
||||||
|
|
||||||
|
data = ujson.loads(get("https://api.github.com/repos/gohugoio/hugo/releases/latest").content)
|
||||||
|
|
||||||
|
tag = data["tag_name"][1:]
|
||||||
|
|
||||||
|
subprocess.run(["docker", "build", ".", "--build-arg", "HUGO_VERSION=" + tag, "-t", "registry.baalajimaestro.me/baalajimaestro/hugo-alpine-ext:latest"])
|
||||||
|
subprocess.run(["docker", "push", "registry.baalajimaestro.me/baalajimaestro/hugo-alpine-ext:latest"])
|
Loading…
Add table
Reference in a new issue