# Description of Changes Redesign policies backend to treat sources a lot closer to how the frontend imagined them working (they're persistent now and have an API). Then connect the portal to the sources when mocks are off to allow for source creation in the UI. It's not particularly useful to do that right now because there's no policies UI, but I've tested manually that sources set up in the UI are usable by policies created via the API. I had to change the portal so that when mocks are off, it doesn't just hard crash when attempting to connect to all the backend APIs that don't exist yet. It'll still log the errors, but just continues on rendering the UI now. I also changed all the policies backend APIs to be gated behind a flag instead of behind the SaaS profile. This is because we haven't yet got the payment model sorted, but we're going to need this stuff running self-hosted to be able to test it locally.
188 lines
6.9 KiB
YAML
188 lines
6.9 KiB
YAML
version: '3'
|
|
|
|
# Gradle invocation strategy:
|
|
# - Linux/macOS: `./gradlew` runs the POSIX shell wrapper natively.
|
|
# - Windows: `cmd /c ".\gradlew.bat ..."` invokes the .bat wrapper through
|
|
# cmd.exe so it inherits the user's Windows-side `JAVA_HOME`
|
|
# and PATH. Routing through `bash gradlew` on Windows ends up
|
|
# under WSL or Git-Bash, neither of which inherits
|
|
# Adoptium/Temurin's default Windows-only Java env - gradlew
|
|
# then errors with "JAVA_HOME is not set and no 'java' command
|
|
# could be found".
|
|
#
|
|
# The entire `.\gradlew.bat ...` payload is double-quoted so
|
|
# the leading `.\` survives mvdan/sh's POSIX backslash
|
|
# stripping; cmd.exe also requires `.\` (not bare `gradlew.bat`)
|
|
# because modern Windows excludes cwd from cmd's search path.
|
|
|
|
tasks:
|
|
dev:
|
|
desc: "Start backend dev server"
|
|
cmds:
|
|
- task: dev:proprietary
|
|
vars:
|
|
PORT: '{{.PORT}}'
|
|
AIENGINE_URL: '{{.AIENGINE_URL}}'
|
|
AIENGINE_ENABLED: '{{.AIENGINE_ENABLED}}'
|
|
AIENGINE_TIMEOUTSECONDS: '{{.AIENGINE_TIMEOUTSECONDS}}'
|
|
SECURITY_ENABLELOGIN: '{{.SECURITY_ENABLELOGIN}}'
|
|
POLICIES_ENABLED: '{{.POLICIES_ENABLED}}'
|
|
|
|
dev:proprietary:
|
|
desc: "Start backend dev server in proprietary mode"
|
|
ignore_error: true
|
|
vars:
|
|
PORT: '{{.PORT | default "8080"}}'
|
|
AIENGINE_URL: '{{.AIENGINE_URL | default ""}}'
|
|
AIENGINE_ENABLED: '{{.AIENGINE_ENABLED | default "false"}}'
|
|
AIENGINE_TIMEOUTSECONDS: '{{.AIENGINE_TIMEOUTSECONDS | default "120"}}'
|
|
SECURITY_ENABLELOGIN: '{{.SECURITY_ENABLELOGIN | default ""}}'
|
|
POLICIES_ENABLED: '{{.POLICIES_ENABLED | default ""}}'
|
|
env:
|
|
SERVER_PORT: '{{.PORT}}'
|
|
cmds:
|
|
- cmd: '{{if .AIENGINE_URL}}AIENGINE_URL={{.AIENGINE_URL}} AIENGINE_ENABLED={{.AIENGINE_ENABLED}} AIENGINE_TIMEOUTSECONDS={{.AIENGINE_TIMEOUTSECONDS}} {{end}}{{if .SECURITY_ENABLELOGIN}}SECURITY_ENABLELOGIN={{.SECURITY_ENABLELOGIN}} {{end}}{{if .POLICIES_ENABLED}}POLICIES_ENABLED={{.POLICIES_ENABLED}} {{end}}cmd /c ".\gradlew.bat :stirling-pdf:bootRun"'
|
|
platforms: [windows]
|
|
- cmd: '{{if .AIENGINE_URL}}AIENGINE_URL={{.AIENGINE_URL}} AIENGINE_ENABLED={{.AIENGINE_ENABLED}} AIENGINE_TIMEOUTSECONDS={{.AIENGINE_TIMEOUTSECONDS}} {{end}}{{if .SECURITY_ENABLELOGIN}}SECURITY_ENABLELOGIN={{.SECURITY_ENABLELOGIN}} {{end}}{{if .POLICIES_ENABLED}}POLICIES_ENABLED={{.POLICIES_ENABLED}} {{end}}./gradlew :stirling-pdf:bootRun'
|
|
platforms: [linux, darwin]
|
|
|
|
dev:bundled:
|
|
desc: "Clean + bootRun with frontend bundled into the backend (single :8080 server)"
|
|
ignore_error: true
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat clean bootRun -PbuildWithFrontend=true"
|
|
platforms: [windows]
|
|
- cmd: ./gradlew clean bootRun -PbuildWithFrontend=true
|
|
platforms: [linux, darwin]
|
|
|
|
dev:saas:
|
|
desc: "Start backend in SaaS flavor against Supabase"
|
|
# `dotenv:` reads from the root Taskfile's directory (".") because this
|
|
# subtaskfile is included with `dir: .`.
|
|
dotenv: ['app/.env.saas.local', 'app/.env.saas']
|
|
ignore_error: true
|
|
vars:
|
|
PORT: '{{.PORT | default "8080"}}'
|
|
# Override to "" to run the pure `saas` profile against your own SAAS_DB_*.
|
|
PROFILES: '{{.PROFILES | default "dev"}}'
|
|
AIENGINE_URL: '{{.AIENGINE_URL | default ""}}'
|
|
AIENGINE_ENABLED: '{{.AIENGINE_ENABLED | default "false"}}'
|
|
AIENGINE_TIMEOUTSECONDS: '{{.AIENGINE_TIMEOUTSECONDS | default "120"}}'
|
|
env:
|
|
SERVER_PORT: '{{.PORT}}'
|
|
STIRLING_FLAVOR: saas
|
|
AIENGINE_URL: '{{.AIENGINE_URL}}'
|
|
AIENGINE_ENABLED: '{{.AIENGINE_ENABLED}}'
|
|
AIENGINE_TIMEOUTSECONDS: '{{.AIENGINE_TIMEOUTSECONDS}}'
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat :stirling-pdf:bootRun {{if .PROFILES}}--args=\"--spring.profiles.include={{.PROFILES}}\"{{end}}"
|
|
platforms: [windows]
|
|
- cmd: ./gradlew :stirling-pdf:bootRun {{if .PROFILES}}--args='--spring.profiles.include={{.PROFILES}}'{{end}}
|
|
platforms: [linux, darwin]
|
|
|
|
build:
|
|
desc: "Full backend build"
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat clean build"
|
|
platforms: [windows]
|
|
- cmd: ./gradlew clean build
|
|
platforms: [linux, darwin]
|
|
|
|
build:fast:
|
|
desc: "Build without tests"
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat clean build -x test"
|
|
platforms: [windows]
|
|
- cmd: ./gradlew clean build -x test
|
|
platforms: [linux, darwin]
|
|
|
|
build:ci:
|
|
desc: "Build for CI (formatting checked separately)"
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat build -PnoSpotless"
|
|
platforms: [windows]
|
|
- cmd: ./gradlew build -PnoSpotless
|
|
platforms: [linux, darwin]
|
|
|
|
test:
|
|
desc: "Run backend tests"
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat test"
|
|
platforms: [windows]
|
|
- cmd: ./gradlew test
|
|
platforms: [linux, darwin]
|
|
|
|
format:
|
|
desc: "Auto-fix code formatting"
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat spotlessApply"
|
|
platforms: [windows]
|
|
- cmd: ./gradlew spotlessApply
|
|
platforms: [linux, darwin]
|
|
|
|
format:check:
|
|
desc: "Check code formatting"
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat spotlessCheck"
|
|
platforms: [windows]
|
|
- cmd: ./gradlew spotlessCheck
|
|
platforms: [linux, darwin]
|
|
|
|
fix:
|
|
desc: "Auto-fix backend"
|
|
cmds:
|
|
- task: format
|
|
|
|
swagger:
|
|
desc: "Generate OpenAPI docs"
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat :stirling-pdf:copySwaggerDoc"
|
|
platforms: [windows]
|
|
- cmd: ./gradlew :stirling-pdf:copySwaggerDoc
|
|
platforms: [linux, darwin]
|
|
sources:
|
|
- app/core/src/main/java/**/*.java
|
|
- app/proprietary/src/main/java/**/*.java
|
|
- app/common/src/main/java/**/*.java
|
|
generates:
|
|
- SwaggerDoc.json
|
|
|
|
check:
|
|
desc: "Backend quality gate"
|
|
cmds:
|
|
- task: format:check
|
|
- task: test
|
|
|
|
version:
|
|
desc: "Print project version"
|
|
silent: true
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat printVersion --quiet" | tail -1
|
|
platforms: [windows]
|
|
- cmd: ./gradlew printVersion --quiet | tail -1
|
|
platforms: [linux, darwin]
|
|
|
|
licenses:check:
|
|
desc: "Check dependency licenses"
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat checkLicense --no-parallel"
|
|
platforms: [windows]
|
|
- cmd: ./gradlew checkLicense --no-parallel
|
|
platforms: [linux, darwin]
|
|
|
|
licenses:generate:
|
|
desc: "Check and generate dependency license report"
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat checkLicense generateLicenseReport --no-parallel"
|
|
platforms: [windows]
|
|
- cmd: ./gradlew checkLicense generateLicenseReport --no-parallel
|
|
platforms: [linux, darwin]
|
|
|
|
clean:
|
|
desc: "Clean build artifacts"
|
|
cmds:
|
|
- cmd: cmd /c ".\gradlew.bat clean"
|
|
platforms: [windows]
|
|
- cmd: ./gradlew clean
|
|
platforms: [linux, darwin]
|