-
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.
DOKY-156 Spring Mapping for front (#102)
* DOKY-156 Spring Mapping for front Update submodule path and url for `doky-front` The submodule path of `doky-front` has been moved from `web-front/doky-front` to `server/doky-front`. Additionally, the URL for this submodule has been updated to point to a new GitHub repository. Remove `web-front` module and integrate frontend into `server` module Removed the `web-front` module and migrated its functions to the `server` module. The frontend has been successfully integrated with the server component of the project, significantly simplifying the project structure and deployment. Updated corresponding properties, configurations, and exception handling rules to accommodate these changes. Additional configuration was added to redirect to `index.html` any request that does not have a mapping in Spring Boot configuration. It allows to refresh page in browser that have frontend routing path. Update build configuration and base URL The build configuration in `server/build.gradle.kts` has been simplified by removing environment-specific arguments. In `server/doky-front/src/api/config.dev.js`, the hard-coded `BASE_URL` has been replaced with `location.origin`, making it dependent on the current location which can offer more flexibility. Remove redundant `copyFrontDist` task from build script The `copyFrontDist` task was removed from the `build.gradle.kts` file because it was redundant and unnecessary. Now, the build process only depends on the essential `copyFrontDistSrc` task that copy dist front files under resources src folder. This change simplifies the script and ensures a more efficient and streamlined build procedure. Remove git modules as it was decided merge front repository into current and have only one. It simplifies develop process for tasks that have changes in both parts - backend and frontend. As git submodule was removed, all front sources are added into current repository.
- Loading branch information
1 parent
796caa6
commit 78fb556
Showing
79 changed files
with
21,510 additions
and
507 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 |
---|---|---|
|
@@ -43,3 +43,4 @@ server/out | |
/docker-deployment/doky-server/server.jar | ||
/doky-*.env | ||
/.azure | ||
/server/src/main/resources/static/ |
This file was deleted.
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
allprojects { | ||
apply plugin: 'java' | ||
|
||
repositories { | ||
mavenCentral() | ||
|
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
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,53 @@ | ||
{ | ||
"extends": [ | ||
"plugin:react/recommended", | ||
"plugin:react-hooks/recommended" | ||
], | ||
"env": { | ||
"es6": true, | ||
"browser": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 11, | ||
"sourceType": "module" | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
}, | ||
"rules": { | ||
"no-debugger": 2, | ||
"indent": [ | ||
2, | ||
2 | ||
], | ||
"no-trailing-spaces": 2, | ||
"no-undef": 2, | ||
"eqeqeq": 2, | ||
"semi": [ | ||
2, | ||
"always" | ||
], | ||
"quotes": [ | ||
2, | ||
"single" | ||
], | ||
"prefer-const": 2, | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"vars": "all", | ||
"args": "after-used", | ||
"ignoreRestSiblings": false | ||
} | ||
], | ||
"no-return-assign": [ | ||
"error", | ||
"always" | ||
], | ||
"react/react-in-jsx-scope": 0, | ||
"react-hooks/exhaustive-deps": 2, | ||
"react/prop-types": 0 | ||
} | ||
} |
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,22 @@ | ||
name: 'Lint' | ||
|
||
on: [ push ] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install npm dependencies | ||
run: npm ci | ||
|
||
- name: 'run eslint' | ||
run: npm run lint |
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
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 @@ | ||
npm run lint |
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,102 @@ | ||
import java.time.DayOfWeek | ||
import java.time.LocalDateTime | ||
import java.time.ZoneId | ||
import java.time.ZonedDateTime | ||
import java.time.format.DateTimeFormatter | ||
import java.time.temporal.TemporalAdjusters | ||
|
||
var deploymentKey = "azure-dev-front" | ||
|
||
job("Tests for main branch") { | ||
startOn { | ||
gitPush { | ||
anyRefMatching { | ||
+"refs/heads/main" | ||
} | ||
} | ||
} | ||
|
||
host("Schedule Azure DEV Deployment") { | ||
kotlinScript { api -> | ||
val deployVersion = "Aardvark-v0.1." + api.executionNumber() + "f" | ||
api.space().projects.automation.deployments.schedule( | ||
project = api.projectIdentifier(), | ||
targetIdentifier = TargetIdentifier.Key(deploymentKey), | ||
version = deployVersion, | ||
scheduledStart = getNextSundayDate() | ||
) | ||
} | ||
} | ||
} | ||
|
||
job("Azure DEV Deployment") { | ||
startOn { | ||
// every Sunday at 11:59 pm UTC | ||
schedule { cron("59 23 * * SUN") } | ||
} | ||
|
||
host("Sync deployment status") { | ||
kotlinScript { api -> | ||
val deployVersion = api.space().projects.automation.deployments.get( | ||
project = api.projectIdentifier(), | ||
targetIdentifier = TargetIdentifier.Key(deploymentKey), | ||
deploymentIdentifier = DeploymentIdentifier.Status(DeploymentIdentifierStatus.scheduled) | ||
).version | ||
api.space().projects.automation.deployments.start( | ||
project = api.projectIdentifier(), | ||
targetIdentifier = TargetIdentifier.Key(deploymentKey), | ||
version = deployVersion, | ||
syncWithAutomationJob = true | ||
) | ||
} | ||
} | ||
|
||
val sharedBuildPath = "to-deploy" | ||
val zipFile = "dist.zip" | ||
container(displayName = "Build", image = "node:18-alpine") { | ||
shellScript { | ||
content = """ | ||
npm ci && npm run build | ||
mkdir ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedBuildPath | ||
cd dist | ||
cp -a . ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedBuildPath | ||
cd ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedBuildPath | ||
ls -la | ||
""".trimIndent() | ||
} | ||
} | ||
|
||
container(displayName = "Zip dist", image = "joshkeegan/zip") { | ||
shellScript { | ||
content = """ | ||
cd ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedBuildPath | ||
zip -r $zipFile * | ||
ls -la | ||
""".trimIndent() | ||
} | ||
} | ||
|
||
container(displayName = "Deploy to azure", "mcr.microsoft.com/azure-cli") { | ||
env["AZURE_SUBSCRIPTION"] = "{{ project:azure-subscription }}" | ||
env["AZURE_RESOURCE_GROUP"] = "{{ project:azure-resource-group }}" | ||
env["AZURE_APP_NAME"] = "{{ project:azure-app-name-front }}" | ||
env["AZURE_TENANT"] = "{{ project:azure-tenant }}" | ||
env["AZURE_CLIENT"] = "{{ project:azure-client }}" | ||
env["AZURE_AUTH_KEY"] = "{{ project:azure-auth-key }}" | ||
|
||
shellScript { | ||
content = """ | ||
az login --service-principal -t ${'$'}AZURE_TENANT -u ${'$'}AZURE_CLIENT -p ${'$'}AZURE_AUTH_KEY | ||
az webapp deployment source config-zip -g ${'$'}AZURE_RESOURCE_GROUP -n ${'$'}AZURE_APP_NAME --src ${'$'}JB_SPACE_FILE_SHARE_PATH/$sharedBuildPath/$zipFile | ||
""" | ||
} | ||
} | ||
} | ||
|
||
fun getNextSundayDate(): Instant { | ||
var date = ZonedDateTime.of(LocalDateTime.now(), ZoneId.of("UTC")) | ||
// set time to 11:59 pm UTC | ||
date = date.withHour(23).withMinute(59).withSecond(0).withNano(0) | ||
val sunday = date.with(TemporalAdjusters.nextOrSame(DayOfWeek.SUNDAY)) | ||
return Instant.parse(sunday.format(DateTimeFormatter.ISO_INSTANT)) | ||
} |
Oops, something went wrong.