diff --git a/.gitmodules b/.gitmodules index 9d0cb02..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "aleta"] - path = aleta - url = https://gitea.sergiotarxz.freemyip.com/germedeb/aleta-postre diff --git a/Dockerfile b/Dockerfile index 1c25790..a608630 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG uid=1000 FROM alpine:edge +ARG uid=1000 RUN apk update RUN apk add inkscape diff --git a/aleta b/aleta deleted file mode 160000 index 8d27a54..0000000 --- a/aleta +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8d27a543d1bcea72b92b3a7be487affbd2dce265 diff --git a/build.sh b/build.sh index e52182b..b923b42 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,29 @@ #!/bin/bash +docker ps &> /dev/null +if [ $? != 0 ]; then + docker() { + sudo $(which docker) "$@" + } +fi build() { + cd - + if [ -e output ]; then + rm -rf output + fi + if update_aleta; then + mkdir output + docker build --no-cache -t aletareleaser:latest . --build-arg uid=$(getent passwd $(whoami) | awk -F: '{ print $3 }') + docker run -v $(realpath output):/var/lib/aleta/output --rm aletareleaser + else + return 1; + fi +} + +update_aleta() { + if [ ! -e aleta ]; then + git clone https://gitea.sergiotarxz.freemyip.com/germedeb/aleta-postre aleta + return 0; + fi cd aleta git fetch current_commit=$(git rev-parse HEAD) @@ -9,13 +33,8 @@ build() { return 1 fi git pull - cd - - if [ -e output ]; then - rm -rf output - fi - mkdir output - docker build --no-cache -t aletareleaser:latest . --build-arg uid=$(getent passwd $(whoami) | awk -F: '{ print $3 }') - docker run -v $(realpath output):/var/lib/aleta/output --rm aletareleaser + cd - + return 0 } source ~/.bashrc