Making the deploying script to attempt clone by itself.

This commit is contained in:
sergiotarxz 2022-02-09 12:08:42 +01:00
parent 82dbfd5743
commit b2678ec5b9
4 changed files with 27 additions and 12 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "aleta"]
path = aleta
url = https://gitea.sergiotarxz.freemyip.com/germedeb/aleta-postre

View File

@ -1,5 +1,5 @@
ARG uid=1000
FROM alpine:edge FROM alpine:edge
ARG uid=1000
RUN apk update RUN apk update
RUN apk add inkscape RUN apk add inkscape

1
aleta

@ -1 +0,0 @@
Subproject commit 8d27a543d1bcea72b92b3a7be487affbd2dce265

View File

@ -1,5 +1,29 @@
#!/bin/bash #!/bin/bash
docker ps &> /dev/null
if [ $? != 0 ]; then
docker() {
sudo $(which docker) "$@"
}
fi
build() { 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 cd aleta
git fetch git fetch
current_commit=$(git rev-parse HEAD) current_commit=$(git rev-parse HEAD)
@ -9,13 +33,8 @@ build() {
return 1 return 1
fi fi
git pull git pull
cd - cd -
if [ -e output ]; then return 0
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
} }
source ~/.bashrc source ~/.bashrc