-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
18,160 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Editor configuration, see https://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.ts] | ||
quote_type = single | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"dependencyDashboard": true, | ||
"groupName": "all dependencies", | ||
"groupSlug": "all", | ||
"packageRules": [ | ||
{ | ||
"groupName": "all dependencies", | ||
"groupSlug": "all", | ||
"matchPackagePatterns": ["*"] | ||
} | ||
], | ||
"labels": ["dependencies"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Pipeline | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
concurrency: | ||
group: any | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test-e2e: | ||
env: | ||
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: npm | ||
cache-dependency-path: client/package-lock.json | ||
- uses: ankane/setup-postgres@v1 | ||
with: | ||
postgres-version: 16 | ||
- name: Check pg_dump version | ||
run: pg_dump --version | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
cache: maven | ||
cache-dependency-path: server/pom.xml | ||
- working-directory: client | ||
run: npm ci | ||
- working-directory: client | ||
run: npm run build | ||
- name: Install Chromium with dependencies for Playwright | ||
working-directory: server | ||
run: mvn test-compile exec:java -B -e -D exec.classpathScope=test -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --with-deps chromium" | ||
- working-directory: server | ||
run: mvn test -B | ||
build-images: | ||
runs-on: ubuntu-latest | ||
needs: test-e2e | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
cache: "pip" | ||
- run: pip install -r requirements.txt | ||
|
||
- run: python scripts/build_docker_image.py "${{ secrets.GITHUB_TOKEN }}" "${{ secrets.ANSIBLE_VAULT_KEY }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Update dependencies | ||
|
||
on: | ||
schedule: | ||
- cron: '7 0 * * 1' | ||
|
||
concurrency: | ||
group: any | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
update-dependencies: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write # Requires also "Allow GitHub Actions to create and approve pull requests" to be enabled in the repository settings | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
- env: | ||
LOG_LEVEL: debug | ||
run: npx renovate --token ${{ secrets.GITHUB_TOKEN }} --platform github --autodiscover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.env | ||
|
||
target | ||
|
||
screenshots | ||
|
||
.ansible/ | ||
|
||
node_modules | ||
|
||
dist | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 | ||
"recommendations": ["angular.ng-template"] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"type": "java", | ||
"name": "Spring Boot-App<postgres-backup-tool>", | ||
"request": "launch", | ||
"cwd": "${workspaceFolder}/server", | ||
"mainClass": "io.github.mucsi96.postgresbackuptool.App", | ||
"projectName": "postgres-backup-tool", | ||
"args": "" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"maven.terminal.favorites": [ | ||
{ | ||
"command": "spring-boot:run", | ||
"debug": false, | ||
} | ||
], | ||
"java.format.enabled": true, | ||
"[java]": { | ||
"editor.tabSize": 2 | ||
}, | ||
"java.format.settings.url": ".vscode/java-formatter.xml", | ||
"java.compile.nullAnalysis.mode": "disabled", | ||
"sqltools.connections": [ | ||
{ | ||
"previewLimit": 50, | ||
"server": "db", | ||
"port": 5432, | ||
"driver": "PostgreSQL", | ||
"name": "local", | ||
"database": "postgres-backup-tool", | ||
"username": "postgres", | ||
"password": "postgres" | ||
} | ||
], | ||
"python.analysis.typeCheckingMode": "basic", | ||
"python.analysis.autoImportCompletions": true, | ||
"java.configuration.updateBuildConfiguration": "interactive" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"version": "2.0.0", | ||
"osx": { | ||
"options": { | ||
"shell": { | ||
"executable": "${env:SHELL}", | ||
"args": ["--login", "--interactive", "-c"] | ||
} | ||
} | ||
}, | ||
"tasks": [ | ||
{ | ||
"type": "shell", | ||
"command": "bash", | ||
"label": "Install dependencies", | ||
"args": ["scripts/install_dependencies.sh"], | ||
"options": { | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "Build client", | ||
"command": "npm run build", | ||
"isBackground": true, | ||
"options": { | ||
"cwd": "${workspaceFolder}/client" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "Build server", | ||
"command": "mvn clean install -DskipTests", | ||
"isBackground": true, | ||
"options": { | ||
"cwd": "${workspaceFolder}/server" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "Start client", | ||
"command": "npm start", | ||
"options": { | ||
"cwd": "${workspaceFolder}/client" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "Start server", | ||
"command": "mvn spring-boot:run", | ||
"isBackground": true, | ||
"options": { | ||
"cwd": "${workspaceFolder}/server" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "Test e2e", | ||
"command": "mvn test", | ||
"isBackground": true, | ||
"options": { | ||
"cwd": "${workspaceFolder}/server" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "Compose up", | ||
"command": "node docker-compose.js | docker compose --file - up --build --force-recreate --wait --remove-orphans --pull always", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"label": "Compose down", | ||
"command": "node docker-compose.js | docker compose --file - down", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"command": "ansible-vault encrypt vars/vault.yaml --vault-password-file .ansible/vault_key", | ||
"isBackground": true, | ||
"label": "Encrypt vault", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"command": "ansible-vault decrypt vars/vault.yaml --vault-password-file .ansible/vault_key", | ||
"isBackground": true, | ||
"label": "Decrypt vault", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"command": "ansible-vault view vars/vault.yaml --vault-password-file .ansible/vault_key", | ||
"isBackground": true, | ||
"label": "view vault", | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM maven:3-eclipse-temurin-21 AS build-server | ||
|
||
WORKDIR /workspace/server | ||
|
||
COPY server/pom.xml ./ | ||
COPY server . | ||
|
||
RUN mvn package -DskipTests -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn | ||
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar) | ||
|
||
FROM node:22 AS build-client | ||
|
||
WORKDIR /workspace/client | ||
|
||
COPY client/package*.json ./ | ||
RUN npm install | ||
|
||
COPY client . | ||
RUN npm run build | ||
|
||
FROM bellsoft/liberica-openjre-alpine-musl:22 | ||
|
||
VOLUME /tmp | ||
|
||
ARG DEPENDENCY=/workspace/server/target/dependency | ||
|
||
RUN apk add postgresql15-client | ||
|
||
COPY --from=build-server ${DEPENDENCY}/BOOT-INF/lib /app/lib | ||
COPY --from=build-server ${DEPENDENCY}/META-INF /app/META-INF | ||
COPY --from=build-server ${DEPENDENCY}/BOOT-INF/classes /app | ||
COPY --from=build-client /workspace/client/dist/index.html /app/templates/index.html | ||
COPY --from=build-client /workspace/client/dist /app/static | ||
RUN rm /app/static/index.html /app/static/mockServiceWorker.js | ||
|
||
ENTRYPOINT ["java", "-cp", "app:app/lib/*", "-Dspring.profiles.active=prod", "io.github.mucsi96.postgresbackuptool.App"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Igor Bari | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.