From 37e41d0c60a3df4ffaead82344febc0fa75ef1b5 Mon Sep 17 00:00:00 2001 From: edraft Date: Sat, 4 Jan 2025 14:00:01 +0100 Subject: [PATCH] Added builds --- .gitea/build dev.yaml | 63 +++++++++++++++++++++++++++++++ .gitea/build.yaml | 63 +++++++++++++++++++++++++++++++ .gitea/test_before_merge.yaml | 39 +++++++++++++++++++ api/.gitignore | 4 +- version.txt | 1 + web/src/app/app-routing.module.ts | 2 - web/src/app/app.module.ts | 2 - 7 files changed, 169 insertions(+), 5 deletions(-) create mode 100644 .gitea/build dev.yaml create mode 100644 .gitea/build.yaml create mode 100644 .gitea/test_before_merge.yaml create mode 100644 version.txt diff --git a/.gitea/build dev.yaml b/.gitea/build dev.yaml new file mode 100644 index 0000000..04fe51d --- /dev/null +++ b/.gitea/build dev.yaml @@ -0,0 +1,63 @@ +name: Build on push +run-name: Build on push +on: + push: + branches: + - master + +jobs: + build-api: + runs-on: [runner] + container: git.sh-edraft.de/sh-edraft/act-runner:latest + steps: + - name: Clone Repository + uses: https://github.com/actions/checkout@v3 + with: + token: ${{ secrets.CI_ACCESS_TOKEN }} + + - name: Build docker + run: | + docker build -t git.sh-edraft.de/sh-edraft/open-redirect-api-dev:$(cat version.txt) . + + - name: Login to registry git.sh-edraft.de + uses: https://github.com/docker/login-action@v1 + with: + registry: git.sh-edraft.de + username: ${{ secrets.CI_USERNAME }} + password: ${{ secrets.CI_ACCESS_TOKEN }} + + - name: Push image + run: | + docker push git.sh-edraft.de/sh-edraft/open-redirect-api-dev:$(cat version.txt) + + build-web: + runs-on: [runner] + container: git.sh-edraft.de/sh-edraft/act-runner:latest + steps: + - name: Clone Repository + uses: https://github.com/actions/checkout@v3 + with: + token: ${{ secrets.CI_ACCESS_TOKEN }} + + - name: Prepare web build + run: | + npm ci + + - name: Build web + run: | + npm run build + + - name: Build docker + run: | + docker build -t git.sh-edraft.de/sh-edraft/open-redirect-web:$(cat version.txt) . + + - name: Login to registry git.sh-edraft.de + uses: https://github.com/docker/login-action@v1 + with: + registry: git.sh-edraft.de + username: ${{ secrets.CI_USERNAME }} + password: ${{ secrets.CI_ACCESS_TOKEN }} + + - name: Push image + run: | + docker push git.sh-edraft.de/sh-edraft/open-redirect-web:$(cat version.txt) diff --git a/.gitea/build.yaml b/.gitea/build.yaml new file mode 100644 index 0000000..e83b063 --- /dev/null +++ b/.gitea/build.yaml @@ -0,0 +1,63 @@ +name: Build on push +run-name: Build on push +on: + push: + branches: + - master + +jobs: + build-api: + runs-on: [runner] + container: git.sh-edraft.de/sh-edraft/act-runner:latest + steps: + - name: Clone Repository + uses: https://github.com/actions/checkout@v3 + with: + token: ${{ secrets.CI_ACCESS_TOKEN }} + + - name: Build docker + run: | + docker build -t git.sh-edraft.de/sh-edraft/open-redirect-api:$(cat version.txt) . + + - name: Login to registry git.sh-edraft.de + uses: https://github.com/docker/login-action@v1 + with: + registry: git.sh-edraft.de + username: ${{ secrets.CI_USERNAME }} + password: ${{ secrets.CI_ACCESS_TOKEN }} + + - name: Push image + run: | + docker push git.sh-edraft.de/sh-edraft/open-redirect-api:$(cat version.txt) + + build-web: + runs-on: [runner] + container: git.sh-edraft.de/sh-edraft/act-runner:latest + steps: + - name: Clone Repository + uses: https://github.com/actions/checkout@v3 + with: + token: ${{ secrets.CI_ACCESS_TOKEN }} + + - name: Prepare web build + run: | + npm ci + + - name: Build web + run: | + npm run build + + - name: Build docker + run: | + docker build -t git.sh-edraft.de/sh-edraft/open-redirect-web:$(cat version.txt) . + + - name: Login to registry git.sh-edraft.de + uses: https://github.com/docker/login-action@v1 + with: + registry: git.sh-edraft.de + username: ${{ secrets.CI_USERNAME }} + password: ${{ secrets.CI_ACCESS_TOKEN }} + + - name: Push image + run: | + docker push git.sh-edraft.de/sh-edraft/open-redirect-web:$(cat version.txt) diff --git a/.gitea/test_before_merge.yaml b/.gitea/test_before_merge.yaml new file mode 100644 index 0000000..11dd123 --- /dev/null +++ b/.gitea/test_before_merge.yaml @@ -0,0 +1,39 @@ +name: Test before pr merge +run-name: Test before pr merge +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + - ready_for_review + +jobs: + test-before-merge: + runs-on: [ runner ] + container: git.sh-edraft.de/sh-edraft/act-runner:latest + steps: + - name: Clone Repository + uses: https://github.com/actions/checkout@v3 + with: + token: ${{ secrets.CI_ACCESS_TOKEN }} + + - name: Setup node + uses: https://github.com/actions/setup-node@v3 + + - name: Installing dependencies + run: npm ci + + - name: Checking eslint + run: npm run lint + + - name: Setup chrome + run: | + wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - + echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list + apt-get update + apt-get install -y google-chrome-stable xvfb + + - name: Testing + run: npm run test:ci diff --git a/api/.gitignore b/api/.gitignore index 3ae9dab..acb54d3 100644 --- a/api/.gitignore +++ b/api/.gitignore @@ -1,4 +1,6 @@ src/files/ src/logs/ -src/.env \ No newline at end of file +src/.env + +*.pyc \ No newline at end of file diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..6c6aa7c --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +0.1.0 \ No newline at end of file diff --git a/web/src/app/app-routing.module.ts b/web/src/app/app-routing.module.ts index c7191e7..40c40bb 100644 --- a/web/src/app/app-routing.module.ts +++ b/web/src/app/app-routing.module.ts @@ -4,14 +4,12 @@ import { NotFoundComponent } from "src/app/components/error/not-found/not-found. import { AuthGuard } from "src/app/core/guard/auth.guard"; import { HomeComponent } from "src/app/components/home/home.component"; import { RedirectComponent } from "src/app/components/redirect/redirect.component"; -import { LogoutComponent } from "src/app/components/logout/logout.component"; const routes: Routes = [ { path: "", component: HomeComponent, }, - { path: "logout", component: LogoutComponent }, { path: "admin", loadChildren: () => diff --git a/web/src/app/app.module.ts b/web/src/app/app.module.ts index 8d77467..8945836 100644 --- a/web/src/app/app.module.ts +++ b/web/src/app/app.module.ts @@ -23,7 +23,6 @@ import { ErrorHandlingService } from "src/app/service/error-handling.service"; import { HomeComponent } from "./components/home/home.component"; import { RedirectComponent } from "./components/redirect/redirect.component"; import { SettingsService } from "src/app/service/settings.service"; -import { LogoutComponent } from './components/logout/logout.component'; if (environment.production) { Logger.enableProductionMode(); @@ -59,7 +58,6 @@ export function appInitializerFactory( SidebarComponent, HomeComponent, RedirectComponent, - LogoutComponent, ], imports: [ BrowserModule,