-
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
1 parent
1459828
commit 494c1b4
Showing
3 changed files
with
92 additions
and
2 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,48 @@ | ||
name: Test Application with Gradle | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test-app-with-gradle: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
note-postgres: | ||
image: postgres:alpine | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: none | ||
POSTGRES_DB: noteapp | ||
ports: | ||
- "5100:5432" | ||
options: --name note-postgres | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
env: | ||
SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5100/noteapp | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: none | ||
POSTGRES_DB: noteapp | ||
FRONTEND_URL: http://localhost:4200 | ||
GOOGLE_CLIENT_ID: none | ||
GOOGLE_CLIENT_SECRET: none | ||
with: | ||
gradle-version: '8.2' | ||
arguments: build | ||
build-root-directory: note-app-backend |
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,13 +1,17 @@ | ||
FROM gradle:8.2-jdk17-alpine | ||
|
||
WORKDIR /home/note-app | ||
WORKDIR /home/todo-app | ||
|
||
COPY build.gradle . | ||
|
||
COPY settings.gradle . | ||
|
||
COPY src/ src/ | ||
|
||
RUN gradle build -x test | ||
|
||
RUN mv build/libs/todo-app-backend-0.0.1-SNAPSHOT.jar todo-app.jar | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["gradle", "bootRun"] | ||
ENTRYPOINT ["java", "-jar", "todo-app.jar"] |
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,38 @@ | ||
version: "3.1" | ||
|
||
services: | ||
corn-postgres: | ||
container_name: corn-postgres | ||
image: postgres:alpine | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=none | ||
- POSTGRES_DB=corn | ||
ports: | ||
- "5000:5432" | ||
corn-backend: | ||
container_name: corn-backend | ||
image: corn-backend | ||
depends_on: | ||
- corn-postgres | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=none | ||
- POSTGRES_DB=corn | ||
- SPRING_DATASOURCE_URL=jdbc:postgresql://corn-postgres:5432/corn | ||
- FRONTEND_URL=corn-frontend | ||
build: | ||
context: corn-app-backend | ||
dockerfile: Dockerfile | ||
ports: | ||
- "8080:8080" | ||
corn-frontend: | ||
container_name: corn-frontend | ||
image: corn-frontend | ||
depends_on: | ||
- corn-backend | ||
build: | ||
context: corn-app-frontend | ||
dockerfile: Dockerfile | ||
ports: | ||
- "4200:80" |