Compare commits

..

4 Commits

Author SHA1 Message Date
8d2f3ef88e fixed tagging
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-01-03 22:17:30 +01:00
bd95c3d0c4 debugging
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-01-03 22:14:22 +01:00
dceb84669b debugging
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-01-03 22:13:21 +01:00
e980dbf884 working on tag creation
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-01-03 22:03:04 +01:00
3 changed files with 12 additions and 33 deletions

View File

@@ -14,7 +14,8 @@ jobs:
uses: actions/checkout@v4
- name: Build docker image
run: docker build -t umbrella .
run: |
docker build -t umbrella .
- name: Store tag date
run: |
@@ -40,32 +41,3 @@ jobs:
TAG=$(cat /tmp/tag)
docker push ${{ secrets.REGISTRY_PATH }}/umbrella:${{ gitea.ref_name }}
docker push ${{ secrets.REGISTRY_PATH }}/umbrella:$TAG
Clean-Registry:
runs-on: ubuntu-latest
steps:
- name: Get tag list
run: |
TAGS="$(curl -s -u "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASS }}" https://${{ secrets.REGISTRY_PATH }}/v2/umbrella/tags/list | jq -r ".tags[]")"
COUNT=$(echo "$TAGS" | wc -l)
if [ $COUNT -gt 10 ]; then
REMAIN=$((COUNT - 10))
echo "$TAGS" | head -n $REMAIN > /tmp/old_tags
else
echo less than 10 tags, skipping cleanup
echo "" > /tmp/old_tags
fi
- name: Remove tags
run: |
cat /tmp/old_tags | while read TAG; do
if [ -n "$TAG" ]; then
DIGEST=$(curl -u "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASS }}" -sS -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' -o /dev/null -w '%header{Docker-Content-Digest}' https://${{ secrets.REGISTRY_PATH }}/v2/umbrella/manifests/$TAG)
if [ -n "$DIGEST" ]; then
echo about to delete $TAG
curl -u "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASS }}" -sS -X DELETE https://${{ secrets.REGISTRY_PATH }}/v2/umbrella/manifests/$DIGEST
else
echo failed to get digest for $TAG
fi
fi
done

View File

@@ -1,5 +1,5 @@
FROM alpine:3.22 AS svelte_build
RUN apk add npm
RUN apk add bash git npm
RUN adduser -Dh /home/svelte svelte
ADD . /home/svelte/Umbrella
RUN chown -R svelte /home/svelte/Umbrella
@@ -8,14 +8,20 @@ WORKDIR /home/svelte/Umbrella/frontend
RUN npm install && npm run build
FROM alpine AS java_build
RUN apk add gradle fontconfig font-opensans openjdk21-jre
RUN apk add bash git gradle fontconfig font-opensans openjdk21-jre
ADD . /Umbrella
WORKDIR /Umbrella
COPY --from=svelte_build /home/svelte/Umbrella/frontend/dist web/src/main/resources/web
RUN gradle --no-daemon build
FROM alpine
RUN apk add bash fontconfig font-opensans graphviz openjdk21-jre weasyprint
RUN adduser -D umbrella
@@ -27,3 +33,4 @@ WORKDIR /home/umbrella
RUN mkdir .config && ln -s /host/config.json .config/Umbrella.json
EXPOSE 80
CMD java -jar jar/backend.jar

View File

@@ -207,7 +207,7 @@ public final class Document implements Mappable {
case SENDER: if (json.get(key) instanceof JSONObject nested) sender.patch(nested); break;
case STATE: state = State.of(json.getInt(key)).orElseThrow(() -> new UmbrellaException(HTTP_UNPROCESSABLE,"Invalid state")); break;
case POS: if (json.get(key) instanceof JSONObject nested) positions.patch(nested); break;
case TEMPLATE: if (json.get(key) instanceof String templateId) template = templateId; break;
case TEMPLATE_ID: if (json.get(key) instanceof String templateId) template = templateId; break;
default: key = null;
}
if (key != null) dirtyFields.add(key);