updated copyright, added actions workflow script
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
71
.gitea/workflows/docker.yaml
Normal file
71
.gitea/workflows/docker.yaml
Normal 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
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
FROM alpine AS build
|
FROM alpine AS build
|
||||||
RUN apk update apk add openjdk21-jre
|
RUN apk update
|
||||||
|
RUN apk add openjdk21-jre
|
||||||
RUN apk add bash git
|
RUN apk add bash git
|
||||||
ADD . /OpenCloudCal
|
ADD . /OpenCloudCal
|
||||||
WORKDIR /OpenCloudCal
|
WORKDIR /OpenCloudCal
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.api;
|
package de.srsoftware.cal.api;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.api;
|
package de.srsoftware.cal.api;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.api;
|
package de.srsoftware.cal.api;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.api;
|
package de.srsoftware.cal.api;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.api;
|
package de.srsoftware.cal.api;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.app;
|
package de.srsoftware.cal.app;
|
||||||
|
|
||||||
import static java.lang.System.Logger.Level.*;
|
import static java.lang.System.Logger.Level.*;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.app;
|
package de.srsoftware.cal.app;
|
||||||
|
|
||||||
import static java.lang.System.Logger.Level.*;
|
import static java.lang.System.Logger.Level.*;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal;
|
package de.srsoftware.cal;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.*;
|
import static de.srsoftware.cal.Util.*;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal;
|
package de.srsoftware.cal;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.*;
|
import static de.srsoftware.cal.Util.*;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal;
|
package de.srsoftware.cal;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.url;
|
import static de.srsoftware.cal.Util.url;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal;
|
package de.srsoftware.cal;
|
||||||
|
|
||||||
import static de.srsoftware.tools.Error.error;
|
import static de.srsoftware.tools.Error.error;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal;
|
package de.srsoftware.cal;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.db;
|
package de.srsoftware.cal.db;
|
||||||
|
|
||||||
import de.srsoftware.cal.api.Appointment;
|
import de.srsoftware.cal.api.Appointment;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.db;
|
package de.srsoftware.cal.db;
|
||||||
|
|
||||||
public class Fields {
|
public class Fields {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.db;
|
package de.srsoftware.cal.db;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.extractCoords;
|
import static de.srsoftware.cal.Util.extractCoords;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.db;
|
package de.srsoftware.cal.db;
|
||||||
|
|
||||||
import de.srsoftware.tools.Error;
|
import de.srsoftware.tools.Error;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.db;
|
package de.srsoftware.cal.db;
|
||||||
|
|
||||||
import de.srsoftware.tools.Error;
|
import de.srsoftware.tools.Error;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.erfurt;
|
package de.srsoftware.cal.importer.erfurt;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.url;
|
import static de.srsoftware.cal.Util.url;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.erfurt;
|
package de.srsoftware.cal.importer.erfurt;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.parseGermanTime;
|
import static de.srsoftware.cal.Util.parseGermanTime;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.erfurt;
|
package de.srsoftware.cal.importer.erfurt;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.parseGermanTime;
|
import static de.srsoftware.cal.Util.parseGermanTime;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.gera;
|
package de.srsoftware.cal.importer.gera;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.*;
|
import static de.srsoftware.cal.Util.*;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.jena;
|
package de.srsoftware.cal.importer.jena;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.extractBackgroundImage;
|
import static de.srsoftware.cal.Util.extractBackgroundImage;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.jena;
|
package de.srsoftware.cal.importer.jena;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.parseGermanDate;
|
import static de.srsoftware.cal.Util.parseGermanDate;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.jena;
|
package de.srsoftware.cal.importer.jena;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.parseGermanTime;
|
import static de.srsoftware.cal.Util.parseGermanTime;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.jena;
|
package de.srsoftware.cal.importer.jena;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.*;
|
import static de.srsoftware.cal.Util.*;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.jena;
|
package de.srsoftware.cal.importer.jena;
|
||||||
|
|
||||||
import static de.srsoftware.tools.Error.error;
|
import static de.srsoftware.tools.Error.error;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.jena;
|
package de.srsoftware.cal.importer.jena;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.parseGermanTime;
|
import static de.srsoftware.cal.Util.parseGermanTime;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.leipzig;
|
package de.srsoftware.cal.importer.leipzig;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.parseGermanTime;
|
import static de.srsoftware.cal.Util.parseGermanTime;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.neustadt;
|
package de.srsoftware.cal.importer.neustadt;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.parseGermanDate;
|
import static de.srsoftware.cal.Util.parseGermanDate;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.weimar;
|
package de.srsoftware.cal.importer.weimar;
|
||||||
|
|
||||||
import static de.srsoftware.tools.Error.error;
|
import static de.srsoftware.tools.Error.error;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.weimar;
|
package de.srsoftware.cal.importer.weimar;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.parseGermanDate;
|
import static de.srsoftware.cal.Util.parseGermanDate;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal.importer.weimar;
|
package de.srsoftware.cal.importer.weimar;
|
||||||
|
|
||||||
import static de.srsoftware.tools.Result.transform;
|
import static de.srsoftware.tools.Result.transform;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal;
|
package de.srsoftware.cal;
|
||||||
|
|
||||||
import static de.srsoftware.cal.Util.extractCoords;
|
import static de.srsoftware.cal.Util.extractCoords;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal;
|
package de.srsoftware.cal;
|
||||||
|
|
||||||
import static de.srsoftware.tools.Optionals.nullable;
|
import static de.srsoftware.tools.Optionals.nullable;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal;
|
package de.srsoftware.cal;
|
||||||
|
|
||||||
import com.sun.net.httpserver.HttpExchange;
|
import com.sun.net.httpserver.HttpExchange;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
package de.srsoftware.cal;
|
package de.srsoftware.cal;
|
||||||
|
|
||||||
import com.sun.net.httpserver.HttpExchange;
|
import com.sun.net.httpserver.HttpExchange;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
import static de.srsoftware.cal.ApiEndpoint.parseDate;
|
import static de.srsoftware.cal.ApiEndpoint.parseDate;
|
||||||
import static java.time.LocalDateTime.of;
|
import static java.time.LocalDateTime.of;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* © SRSoftware 2024 */
|
/* © SRSoftware 2026 */
|
||||||
import static de.srsoftware.cal.ApiEndpoint.parsePast;
|
import static de.srsoftware.cal.ApiEndpoint.parsePast;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user