Compare commits

...

5 Commits

Author SHA1 Message Date
8a375623a2 improved Dockerfile
All checks were successful
Build Docker Image / Docker-Build (push) Successful in 1m52s
Build Docker Image / Clean-Registry (push) Successful in 2s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-01-04 23:12:40 +01:00
05c6e0c5f8 fixed bug in Dockerfile
All checks were successful
Build Docker Image / Docker-Build (push) Successful in 2m14s
Build Docker Image / Clean-Registry (push) Successful in 3s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-01-04 23:09:35 +01:00
bdf6f19b03 added workflow to triggering branches
All checks were successful
Build Docker Image / Docker-Build (push) Successful in 1m58s
Build Docker Image / Clean-Registry (push) Successful in 2s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-01-04 21:23:38 +01:00
b5cb254c2d updated copyright, added actions workflow script
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-01-04 21:22:20 +01:00
de98c400c7 preparing for gitea action workflow
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-01-04 20:48:57 +01:00
42 changed files with 120 additions and 55 deletions

View File

@@ -0,0 +1,72 @@
name: Build Docker Image
run-name: ${{ gitea.actor }} building ${{ gitea.ref_name }}
on:
push:
branches:
- main
- dev
- workflow
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,26 +1,19 @@
FROM alpine AS build
RUN apk update \
&& apk add openjdk21-jre
RUN apk add bash clang-extra-tools git
RUN apk update
RUN apk add openjdk21-jre
RUN apk add git
ADD . /OpenCloudCal
WORKDIR /OpenCloudCal
RUN VERSION=$(clang-format --version | sed -e "s/.* //g") && sed -i "s|clangFormat(.*).style|clangFormat(\"$VERSION\").style|g" build.gradle.kts
RUN ./gradlew build
RUN mv *app/build/distributions/*.zip /occ.zip
FROM alpine
RUN apk update \
&& apk add bash openjdk21-jre
RUN apk update
RUN apk add openjdk21-jre
COPY --from=build /occ.zip /opt/occ.zip
RUN cd /opt \
&& unzip occ.zip \
&& mv de.srsoftware.cal.app occ \
&& rm *.zip
RUN cd /opt && unzip occ.zip && mv de.srsoftware.cal.app occ && rm *.zip
WORKDIR /opt/occ
RUN mkdir lib/importers \
&& cp lib/*importer*jar lib/importers/
RUN adduser -S occ \
&& ln -s /data /home/occ/.config
RUN mkdir lib/importers && cp lib/*importer*jar lib/importers/
RUN adduser -S occ && ln -s /data /home/occ/.config
USER occ
ENTRYPOINT /opt/occ/bin/de.srsoftware.cal.app

View File

@@ -11,7 +11,7 @@ spotless {
target("**/src/**/java/**/*.java")
removeUnusedImports()
importOrder()
licenseHeader("/* © SRSoftware 2024 */")
licenseHeader("/* © SRSoftware 2026 */")
}
}

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;