Skip to content

Commit

Permalink
jar release
Browse files Browse the repository at this point in the history
  • Loading branch information
freekode committed Jan 7, 2024
1 parent 7001cb5 commit 415ba05
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: docker-publish
name: release

on:
push:
Expand All @@ -9,7 +9,8 @@ env:
IMAGE_NAME: tp2intervals

jobs:
push:
docker:
name: Docker Image Release
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ out/
.vscode/

application-dev.yaml

database.mv.db
database.trace.db
tp2intervals-db.mv.db
tp2intervals-db.trace.db
4 changes: 1 addition & 3 deletions boot/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 7 additions & 2 deletions ui/src/app/configuration/configuration.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
<div class="row">
<div class="col">
<mat-form-field class="full-width">
<input matInput placeholder="API Key" formControlName="apiKey">
<input matInput placeholder="Intervals API Key" formControlName="apiKey">
</mat-form-field>
</div>
</div>

<div class="row">
<div class="col">
<mat-form-field class="full-width">
<input matInput placeholder="Athlete Id" formControlName="athleteId">
<input matInput placeholder="Intervals Athlete Id" formControlName="athleteId">
</mat-form-field>
</div>
</div>
Expand All @@ -42,5 +42,10 @@
</button>
<div class="error-message">{{errorMessage}}</div>
</mat-card-actions>

<mat-card-footer>
<mat-progress-bar *ngIf="inProgress" mode="query"></mat-progress-bar>
</mat-card-footer>

</mat-card>
</form>
9 changes: 8 additions & 1 deletion ui/src/app/configuration/configuration.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
})
Expand All @@ -25,6 +27,7 @@ export class ConfigurationComponent implements OnInit {
});

errorMessage = '';
inProgress = false;

constructor(
private router: Router,
Expand All @@ -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,
Expand All @@ -56,6 +62,7 @@ export class ConfigurationComponent implements OnInit {
return EMPTY;
})
).subscribe(() => {
this.inProgress = false
this.router.navigate(['/home']);
});
}
Expand Down

0 comments on commit 415ba05

Please sign in to comment.