updated copyright, added actions workflow script

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2026-01-04 21:22:20 +01:00
parent de98c400c7
commit b5cb254c2d
41 changed files with 112 additions and 40 deletions

View File

@@ -0,0 +1,71 @@
name: Build Docker Image
run-name: ${{ gitea.actor }} building ${{ gitea.ref_name }}
on:
push:
branches:
- main
- dev
jobs:
Docker-Build:
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
- name: Build docker image
run: docker build -t occ .
- name: Store tag date
run: |
TAG=$(date +%Y%m%d_%H%M)_${{ gitea.ref_name }}
echo $TAG > /tmp/tag
echo Using '"'$TAG'"' as tag.
- name: Tag image for upload
run: |
TAG=$(cat /tmp/tag)
docker tag occ ${{ secrets.REGISTRY_PATH }}/occ:${{ gitea.ref_name }}
docker tag occ ${{ secrets.REGISTRY_PATH }}/occ:$TAG
- name: Login to registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.REGISTRY_PATH }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASS }}
- name: Push to registry
run: |
TAG=$(cat /tmp/tag)
docker push ${{ secrets.REGISTRY_PATH }}/occ:${{ gitea.ref_name }}
docker push ${{ secrets.REGISTRY_PATH }}/occ:$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/occ/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/occ/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/occ/manifests/$DIGEST
else
echo failed to get digest for $TAG
fi
fi
done

View File

@@ -1,5 +1,6 @@
FROM alpine AS build
RUN apk update apk add openjdk21-jre
RUN apk update
RUN apk add openjdk21-jre
RUN apk add bash git
ADD . /OpenCloudCal
WORKDIR /OpenCloudCal

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.api;
import java.time.LocalDateTime;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.api;
import java.net.URL;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.api;
import java.util.Map;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.api;
import java.io.IOException;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.api;
import java.net.URL;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.app;
import static java.lang.System.Logger.Level.*;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.app;
import static java.lang.System.Logger.Level.*;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal;
import static de.srsoftware.cal.Util.*;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal;
import static de.srsoftware.cal.Util.*;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal;
import static de.srsoftware.cal.Util.url;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal;
import static de.srsoftware.tools.Error.error;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal;
import static org.junit.jupiter.api.Assertions.assertEquals;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.db;
import de.srsoftware.cal.api.Appointment;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.db;
public class Fields {

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.db;
import static de.srsoftware.cal.Util.extractCoords;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.db;
import de.srsoftware.tools.Error;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.db;
import de.srsoftware.tools.Error;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.erfurt;
import static de.srsoftware.cal.Util.url;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.erfurt;
import static de.srsoftware.cal.Util.parseGermanTime;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.erfurt;
import static de.srsoftware.cal.Util.parseGermanTime;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.gera;
import static de.srsoftware.cal.Util.*;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.jena;
import static de.srsoftware.cal.Util.extractBackgroundImage;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.jena;
import static de.srsoftware.cal.Util.parseGermanDate;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.jena;
import static de.srsoftware.cal.Util.parseGermanTime;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.jena;
import static de.srsoftware.cal.Util.*;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.jena;
import static de.srsoftware.tools.Error.error;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.jena;
import static de.srsoftware.cal.Util.parseGermanTime;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.leipzig;
import static de.srsoftware.cal.Util.parseGermanTime;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.neustadt;
import static de.srsoftware.cal.Util.parseGermanDate;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.weimar;
import static de.srsoftware.tools.Error.error;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.weimar;
import static de.srsoftware.cal.Util.parseGermanDate;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal.importer.weimar;
import static de.srsoftware.tools.Result.transform;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal;
import static de.srsoftware.cal.Util.extractCoords;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal;
import static de.srsoftware.tools.Optionals.nullable;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal;
import com.sun.net.httpserver.HttpExchange;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
package de.srsoftware.cal;
import com.sun.net.httpserver.HttpExchange;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
import static de.srsoftware.cal.ApiEndpoint.parseDate;
import static java.time.LocalDateTime.of;
import static org.junit.jupiter.api.Assertions.assertEquals;

View File

@@ -1,4 +1,4 @@
/* © SRSoftware 2024 */
/* © SRSoftware 2026 */
import static de.srsoftware.cal.ApiEndpoint.parsePast;
import static org.junit.jupiter.api.Assertions.assertEquals;