From 415ba052e87f3e2b56dc180ce5fe7ed130f3271d Mon Sep 17 00:00:00 2001 From: Evgeny Date: Sun, 7 Jan 2024 13:18:51 +0100 Subject: [PATCH] jar release --- .../{docker-publish.yml => release.yml} | 37 ++++++++++++++++++- .gitignore | 3 ++ boot/src/main/resources/application.yaml | 4 +- .../configuration.component.html | 9 ++++- .../configuration/configuration.component.ts | 9 ++++- 5 files changed, 54 insertions(+), 8 deletions(-) rename .github/workflows/{docker-publish.yml => release.yml} (62%) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/release.yml similarity index 62% rename from .github/workflows/docker-publish.yml rename to .github/workflows/release.yml index cd030bea..a352e8aa 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: docker-publish +name: release on: push: @@ -9,7 +9,8 @@ env: IMAGE_NAME: tp2intervals jobs: - push: + docker: + name: Docker Image Release runs-on: ubuntu-latest steps: @@ -49,3 +50,35 @@ jobs: echo VERSION=$VERSION docker tag $IMAGE_NAME $IMAGE_ID:$VERSION docker push $IMAGE_ID:$VERSION + + + jar: + name: Jar Release + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-java@v3 + with: + java-version: 21 + distribution: 'corretto' + + - uses: actions/setup-node@v4 + with: + node-version: 20.10.0 + + - name: Build frontend + working-directory: ./ui + run: npm ci && npm run build + + - name: Copy UI + run: cp -r ui/dist/ui/browser/ boot/src/main/resources/static + + - name: Build backend + working-directory: ./boot + run: ./gradlew build + + - uses: actions/upload-artifact@v4 + with: + path: build/libs/tp2intervals.jar diff --git a/.gitignore b/.gitignore index f9d0344b..78274ddd 100644 --- a/.gitignore +++ b/.gitignore @@ -37,5 +37,8 @@ out/ .vscode/ application-dev.yaml + database.mv.db database.trace.db +tp2intervals-db.mv.db +tp2intervals-db.trace.db diff --git a/boot/src/main/resources/application.yaml b/boot/src/main/resources/application.yaml index ccd6c714..f0cac8e9 100644 --- a/boot/src/main/resources/application.yaml +++ b/boot/src/main/resources/application.yaml @@ -8,9 +8,7 @@ spring: jackson: default-property-inclusion: non_null datasource: - url: jdbc:h2:file:./database - username: sa - password: password + url: jdbc:h2:file:./tp2intervals-db driverClassName: org.h2.Driver jpa: generate-ddl: true diff --git a/ui/src/app/configuration/configuration.component.html b/ui/src/app/configuration/configuration.component.html index a9fd9089..0758e670 100644 --- a/ui/src/app/configuration/configuration.component.html +++ b/ui/src/app/configuration/configuration.component.html @@ -17,7 +17,7 @@
- +
@@ -25,7 +25,7 @@
- +
@@ -42,5 +42,10 @@
{{errorMessage}}
+ + + + + diff --git a/ui/src/app/configuration/configuration.component.ts b/ui/src/app/configuration/configuration.component.ts index a750162f..0ee1dadf 100644 --- a/ui/src/app/configuration/configuration.component.ts +++ b/ui/src/app/configuration/configuration.component.ts @@ -8,11 +8,13 @@ import { MatFormFieldModule } from "@angular/material/form-field"; import { MatInputModule } from "@angular/material/input"; import { MatButtonModule } from "@angular/material/button"; import { catchError, EMPTY } from "rxjs"; +import { MatProgressBarModule } from "@angular/material/progress-bar"; +import { NgIf } from "@angular/common"; @Component({ selector: 'app-configuration', standalone: true, - imports: [ReactiveFormsModule, MatCardModule, MatFormFieldModule, MatInputModule, MatButtonModule], + imports: [ReactiveFormsModule, MatCardModule, MatFormFieldModule, MatInputModule, MatButtonModule, MatProgressBarModule, NgIf], templateUrl: './configuration.component.html', styleUrl: './configuration.component.scss' }) @@ -25,6 +27,7 @@ export class ConfigurationComponent implements OnInit { }); errorMessage = ''; + inProgress = false; constructor( private router: Router, @@ -34,16 +37,19 @@ export class ConfigurationComponent implements OnInit { } ngOnInit(): void { + this.inProgress = true this.configurationService.getConfig().subscribe(config => { this.formGroup.setValue({ tpAuthCookie: config.tpAuthCookie || null, athleteId: config.intervalsAthleteId || null, apiKey: config.intervalsApiKey || null, }); + this.inProgress = false }); } onSubmit(): void { + this.inProgress = true let newConfiguration = new ConfigData( this.formGroup.value.tpAuthCookie, this.formGroup.value.apiKey, @@ -56,6 +62,7 @@ export class ConfigurationComponent implements OnInit { return EMPTY; }) ).subscribe(() => { + this.inProgress = false this.router.navigate(['/home']); }); }