From 4f4c556bb968590b82d715440dec100ebefd9457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Mon, 13 Nov 2023 19:49:36 +0100 Subject: [PATCH 1/8] Use moment for parsing dates of taskfieldinfo and adapt annotation for spring json parsing --- .../core/api/models/timemanager/tasks/TaskFieldInfo.java | 5 +++++ frontend/src/app/tasks/task-editor/task-editor.component.ts | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/core/api/models/timemanager/tasks/TaskFieldInfo.java b/backend/src/main/java/core/api/models/timemanager/tasks/TaskFieldInfo.java index d4f2cf9..1cf7335 100644 --- a/backend/src/main/java/core/api/models/timemanager/tasks/TaskFieldInfo.java +++ b/backend/src/main/java/core/api/models/timemanager/tasks/TaskFieldInfo.java @@ -1,5 +1,6 @@ package core.api.models.timemanager.tasks; +import com.fasterxml.jackson.annotation.JsonFormat; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; @@ -11,7 +12,11 @@ public class TaskFieldInfo { @Length(max = 255) private String taskName; private int eta; + + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") private LocalDate startDate; + + @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") private LocalDate deadline; public TaskFieldInfo() { diff --git a/frontend/src/app/tasks/task-editor/task-editor.component.ts b/frontend/src/app/tasks/task-editor/task-editor.component.ts index 7752773..ab05b42 100644 --- a/frontend/src/app/tasks/task-editor/task-editor.component.ts +++ b/frontend/src/app/tasks/task-editor/task-editor.component.ts @@ -7,6 +7,7 @@ import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; import {TaskService} from "../../../api"; import {TaskEditorData} from "./TaskEditorData"; import {MatSnackBar} from "@angular/material/snack-bar"; +import * as moment from "moment/moment"; @Component({ @@ -53,8 +54,8 @@ export class TaskEditorComponent implements OnInit { this.taskService.tasksTaskgroupIDPut(this.editorData.taskgroupID, { taskName: this.nameCtrl.value, eta: this.etaCtrl.value, - startDate: this.startDate.value, - deadline: this.endDate.value + startDate: moment(this.startDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), + deadline: moment(this.endDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ') }).subscribe({ next: resp => { this.dialog.close(resp); -- 2.34.1 From be6ab301c67a75e677a7c764a6449cc96344f4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Mon, 13 Nov 2023 22:01:00 +0100 Subject: [PATCH 2/8] Build frontend automatically --- .gitea/workflows/demo.yaml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 21b19b8..b4dbf34 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -3,7 +3,7 @@ run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 on: [push] jobs: - build: + test: runs-on: ubuntu-latest @@ -22,6 +22,29 @@ jobs: - name: Build with Maven run: mvn -B package --file backend/pom.xml - # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive - # - name: Update dependency graph - #uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 \ No newline at end of file + build-and-push-frontend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Log into registry at Gitea + uses: docker/login-action@v2 + with: + registry: https://git.fawkes100.de + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v3 + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v2 + with: + images: git.fawkes100.de/TimeManager/timemanager-frontend + - name: Build and Push Latest Docker Image + id: build-and-push-latest + uses: docker/build-push-action@v4 + if: ${{ github.ref == 'refs/heads/main' }} + with: + context: . + file: ./docker/frontend + push: true + tags: git.fawkes100.de/TimeManager/timemanager-frontend:latest \ No newline at end of file -- 2.34.1 From ab43c49507e99101cb42e6b5110d913ef9570df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Mon, 13 Nov 2023 22:03:55 +0100 Subject: [PATCH 3/8] Change path to Dockerfile --- .gitea/workflows/demo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index b4dbf34..b85075a 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -45,6 +45,6 @@ jobs: if: ${{ github.ref == 'refs/heads/main' }} with: context: . - file: ./docker/frontend + file: frontend/Dockerfile push: true tags: git.fawkes100.de/TimeManager/timemanager-frontend:latest \ No newline at end of file -- 2.34.1 From 8936dd65f49a0741c30397120b429bf336bd68ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Mon, 13 Nov 2023 22:26:13 +0100 Subject: [PATCH 4/8] Change dockerimage for continues deployment --- .gitea/workflows/demo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index b85075a..30da3d4 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -23,7 +23,7 @@ jobs: run: mvn -B package --file backend/pom.xml build-and-push-frontend: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-deploy steps: - uses: actions/checkout@v2 - name: Log into registry at Gitea -- 2.34.1 From 0e28d59e3c1570a36f5336a8f32e6e6af07a83dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Mon, 13 Nov 2023 22:32:02 +0100 Subject: [PATCH 5/8] Change dockerimage for continues deployment to ubuntu-latest --- .gitea/workflows/demo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 30da3d4..b85075a 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -23,7 +23,7 @@ jobs: run: mvn -B package --file backend/pom.xml build-and-push-frontend: - runs-on: ubuntu-latest-deploy + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Log into registry at Gitea -- 2.34.1 From aa9b462c96f0c8342a4ff583eec09772bc307ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Mon, 13 Nov 2023 22:38:50 +0100 Subject: [PATCH 6/8] Change context of dockerfile --- .gitea/workflows/demo.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index b85075a..ce7ffc0 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -44,7 +44,6 @@ jobs: uses: docker/build-push-action@v4 if: ${{ github.ref == 'refs/heads/main' }} with: - context: . file: frontend/Dockerfile push: true tags: git.fawkes100.de/TimeManager/timemanager-frontend:latest \ No newline at end of file -- 2.34.1 From 2d4c44ee09b687251344ce410eade2802f77b6c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Mon, 13 Nov 2023 22:40:24 +0100 Subject: [PATCH 7/8] Change context of dockerfile to frontend --- .gitea/workflows/demo.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index ce7ffc0..d9e1159 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -44,6 +44,7 @@ jobs: uses: docker/build-push-action@v4 if: ${{ github.ref == 'refs/heads/main' }} with: + context: frontend file: frontend/Dockerfile push: true tags: git.fawkes100.de/TimeManager/timemanager-frontend:latest \ No newline at end of file -- 2.34.1 From a19de7b1b50e5f33b5b02251f27643d89948d449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Mon, 13 Nov 2023 22:51:19 +0100 Subject: [PATCH 8/8] Change branch to push on to master --- .gitea/workflows/demo.yaml | 30 +++++++++++++++++++++++++++--- backend/.idea/workspace.xml | 17 +---------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index d9e1159..d202286 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -42,9 +42,33 @@ jobs: - name: Build and Push Latest Docker Image id: build-and-push-latest uses: docker/build-push-action@v4 - if: ${{ github.ref == 'refs/heads/main' }} + if: ${{ github.ref == 'refs/heads/master' }} with: - context: frontend file: frontend/Dockerfile push: true - tags: git.fawkes100.de/TimeManager/timemanager-frontend:latest \ No newline at end of file + tags: git.fawkes100.de/TimeManager/timemanager-frontend:latest + build-and-push-backend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Log into registry at Gitea + uses: docker/login-action@v2 + with: + registry: https://git.fawkes100.de + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v3 + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v2 + with: + images: git.fawkes100.de/TimeManager/timemanager-backend + - name: Build and Push Latest Docker Image + id: build-and-push-latest + uses: docker/build-push-action@v4 + if: ${{ github.ref == 'refs/heads/master' }} + with: + file: backend/Dockerfile + push: true + tags: git.fawkes100.de/TimeManager/timemanager-backend:latest \ No newline at end of file diff --git a/backend/.idea/workspace.xml b/backend/.idea/workspace.xml index cf3cb53..2afbcaf 100644 --- a/backend/.idea/workspace.xml +++ b/backend/.idea/workspace.xml @@ -5,12 +5,7 @@ - - - - - - +