Compare commits
6 Commits
1.2.1
...
2e271bcd52
| Author | SHA1 | Date | |
|---|---|---|---|
|
2e271bcd52
|
|||
|
ebde8c6ffd
|
|||
| a3639dd89b | |||
|
0a43f1bb5b
|
|||
|
8c6fdb2239
|
|||
|
c0d5af5d7a
|
33
.gitea/workflows/release.yml
Normal file
33
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Build release images
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*.*.*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-container:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 19
|
||||||
|
- run: npm i -g pnpm@8 && pnpm i
|
||||||
|
- run: pnpm licenses:export
|
||||||
|
- name: Login to registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: registry.odit.services
|
||||||
|
username: ${{ vars.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ vars.REGISTRY }}/lfk/backend:${{ github.ref_name }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
steps:
|
|
||||||
- name: build latest
|
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
|
||||||
settings:
|
|
||||||
repo: registry.odit.services/lfk/backend
|
|
||||||
tags:
|
|
||||||
- latest
|
|
||||||
registry: registry.odit.services
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
cache_from: registry.odit.services/lfk/backend:dev
|
|
||||||
username:
|
|
||||||
from_secret: odit-registry-builder-username
|
|
||||||
password:
|
|
||||||
from_secret: odit-registry-builder-password
|
|
||||||
when:
|
|
||||||
branch: main
|
|
||||||
- name: build dev
|
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
|
||||||
settings:
|
|
||||||
repo: registry.odit.services/lfk/backend
|
|
||||||
tags:
|
|
||||||
- dev
|
|
||||||
registry: registry.odit.services
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
cache_from: registry.odit.services/lfk/backend:dev
|
|
||||||
username:
|
|
||||||
from_secret: odit-registry-builder-username
|
|
||||||
password:
|
|
||||||
from_secret: odit-registry-builder-password
|
|
||||||
when:
|
|
||||||
branch: dev
|
|
||||||
when:
|
|
||||||
event: push
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
steps:
|
|
||||||
- name: build tag
|
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
|
||||||
settings:
|
|
||||||
repo: registry.odit.services/lfk/backend
|
|
||||||
tags:
|
|
||||||
- "${CI_COMMIT_TAG}"
|
|
||||||
registry: registry.odit.services
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
cache_from: registry.odit.services/lfk/backend:dev
|
|
||||||
username:
|
|
||||||
from_secret: odit-registry-builder-username
|
|
||||||
password:
|
|
||||||
from_secret: odit-registry-builder-password
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# Typescript Build
|
# Typescript Build
|
||||||
FROM registry.odit.services/hub/library/node:21.1.0-alpine3.18 as build
|
FROM registry.odit.services/hub/library/node:21.1.0-alpine3.18 AS build
|
||||||
ARG NPM_REGISTRY_URL=https://registry.npmjs.org
|
ARG NPM_REGISTRY_URL=https://registry.npmjs.org
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ RUN pnpm run build \
|
|||||||
&& pnpm i --production --prefer-offline
|
&& pnpm i --production --prefer-offline
|
||||||
|
|
||||||
# final image
|
# final image
|
||||||
FROM registry.odit.services/hub/library/node:21.1.0-alpine3.18 as final
|
FROM registry.odit.services/hub/library/node:21.1.0-alpine3.18 AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/package.json /app/package.json
|
COPY --from=build /app/package.json /app/package.json
|
||||||
COPY --from=build /app/ormconfig.js /app/ormconfig.js
|
COPY --from=build /app/ormconfig.js /app/ormconfig.js
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ export class RunnerController {
|
|||||||
async remove(@Param("id") id: number, @QueryParam("force") force: boolean) {
|
async remove(@Param("id") id: number, @QueryParam("force") force: boolean) {
|
||||||
let runner = await this.runnerRepository.findOne({ id: id });
|
let runner = await this.runnerRepository.findOne({ id: id });
|
||||||
if (!runner) { return null; }
|
if (!runner) { return null; }
|
||||||
const responseRunner = await this.runnerRepository.findOne(runner, { relations: ['scans', 'group', 'group.parentGroup', 'scans.track', 'cards'] });
|
const responseRunner = await this.runnerRepository.findOne(runner);
|
||||||
|
|
||||||
if (!runner) {
|
if (!runner) {
|
||||||
throw new RunnerNotFoundError();
|
throw new RunnerNotFoundError();
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export class RunnerTeamController {
|
|||||||
async remove(@Param("id") id: number, @QueryParam("force") force: boolean) {
|
async remove(@Param("id") id: number, @QueryParam("force") force: boolean) {
|
||||||
let team = await this.runnerTeamRepository.findOne({ id: id });
|
let team = await this.runnerTeamRepository.findOne({ id: id });
|
||||||
if (!team) { return null; }
|
if (!team) { return null; }
|
||||||
let runnerTeam = await this.runnerTeamRepository.findOne(team, { relations: ['parentGroup', 'contact', 'runners'] });
|
let runnerTeam = await this.runnerTeamRepository.findOne(team, { relations: ['runners'] });
|
||||||
|
|
||||||
if (!force) {
|
if (!force) {
|
||||||
if (runnerTeam.runners.length != 0) {
|
if (runnerTeam.runners.length != 0) {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export class CreateSelfServiceCitizenRunner extends CreateParticipant {
|
|||||||
public async toEntity(): Promise<Runner> {
|
public async toEntity(): Promise<Runner> {
|
||||||
let newRunner: Runner = new Runner();
|
let newRunner: Runner = new Runner();
|
||||||
|
|
||||||
|
newRunner.created_via = "selfservice";
|
||||||
newRunner.firstname = this.firstname;
|
newRunner.firstname = this.firstname;
|
||||||
newRunner.middlename = this.middlename;
|
newRunner.middlename = this.middlename;
|
||||||
newRunner.lastname = this.lastname;
|
newRunner.lastname = this.lastname;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export class CreateSelfServiceRunner extends CreateParticipant {
|
|||||||
public async toEntity(group: RunnerGroup): Promise<Runner> {
|
public async toEntity(group: RunnerGroup): Promise<Runner> {
|
||||||
let newRunner: Runner = new Runner();
|
let newRunner: Runner = new Runner();
|
||||||
|
|
||||||
|
newRunner.created_via = "selfservice";
|
||||||
newRunner.firstname = this.firstname;
|
newRunner.firstname = this.firstname;
|
||||||
newRunner.middlename = this.middlename;
|
newRunner.middlename = this.middlename;
|
||||||
newRunner.lastname = this.lastname;
|
newRunner.lastname = this.lastname;
|
||||||
|
|||||||
@@ -75,6 +75,14 @@ export abstract class Participant {
|
|||||||
@IsEmail()
|
@IsEmail()
|
||||||
email?: string;
|
email?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* how the participant got into the system
|
||||||
|
*/
|
||||||
|
@Column({ nullable: true, default: "backend" })
|
||||||
|
@IsOptional()
|
||||||
|
@IsEmail()
|
||||||
|
created_via?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turns this entity into it's response class.
|
* Turns this entity into it's response class.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -50,6 +50,12 @@ export abstract class ResponseParticipant implements IResponse {
|
|||||||
@IsString()
|
@IsString()
|
||||||
email?: string;
|
email?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* how the participant got into the system
|
||||||
|
*/
|
||||||
|
@IsString()
|
||||||
|
created_via?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The participant's address.
|
* The participant's address.
|
||||||
*/
|
*/
|
||||||
@@ -64,6 +70,7 @@ export abstract class ResponseParticipant implements IResponse {
|
|||||||
public constructor(participant: Participant) {
|
public constructor(participant: Participant) {
|
||||||
this.id = participant.id;
|
this.id = participant.id;
|
||||||
this.firstname = participant.firstname;
|
this.firstname = participant.firstname;
|
||||||
|
this.created_via = participant.created_via;
|
||||||
this.middlename = participant.middlename;
|
this.middlename = participant.middlename;
|
||||||
this.lastname = participant.lastname;
|
this.lastname = participant.lastname;
|
||||||
this.phone = participant.phone;
|
this.phone = participant.phone;
|
||||||
|
|||||||
Reference in New Issue
Block a user