-
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
6 changed files
with
92 additions
and
5 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,30 @@ | ||
name: Docker Image build | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_SECRET }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/task-tracker-scheduler:latest, ${{ secrets.DOCKER_HUB_USERNAME }}/task-tracker-scheduler:0.1-BUILD${{ github.run_number }} |
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,26 @@ | ||
FROM maven:3.9.4 AS build | ||
|
||
LABEL authors="farneser" | ||
|
||
WORKDIR /app | ||
|
||
COPY pom.xml /app | ||
|
||
RUN mvn dependency:resolve | ||
|
||
COPY src /app/src | ||
|
||
ENV RABBITMQ_HOST ${RABBITMQ_HOST} | ||
ENV RABBITMQ_PORT ${RABBITMQ_PORT} | ||
ENV RABBITMQ_USERNAME ${RABBITMQ_USERNAME} | ||
ENV RABBITMQ_PASSWORD ${RABBITMQ_PASSWORD} | ||
|
||
RUN mvn -f /app/pom.xml clean package | ||
|
||
FROM openjdk:17-jdk-slim as production | ||
|
||
COPY --from=build /app/target/task-tracker-email-sender*.jar /usr/local/lib/task-tracker-email-sender.jar | ||
|
||
EXPOSE ${SERVER_PORT} | ||
|
||
ENTRYPOINT ["java","-jar","/usr/local/lib/task-tracker-email-sender.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
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
9 changes: 5 additions & 4 deletions
9
...r/TaskTrackerSchedulerApplicationTests.kt → ...r/TaskTrackerSchedulerApplicationTests.kt
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,14 @@ | ||
package dev.farneser.tasktrackerscheduler | ||
package dev.farneser.tasktracker.scheduler | ||
|
||
import org.junit.jupiter.api.Test | ||
import org.springframework.boot.test.context.SpringBootTest | ||
import org.springframework.context.annotation.Profile | ||
|
||
@Profile("test") | ||
@SpringBootTest | ||
class TaskTrackerSchedulerApplicationTests { | ||
|
||
@Test | ||
fun contextLoads() { | ||
assert(true) | ||
} | ||
|
||
} | ||
} |
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,19 @@ | ||
# postgres | ||
spring.datasource.url=jdbc:postgresql://localhost:5432/task-tracker | ||
spring.datasource.username=postgres | ||
spring.datasource.password=postgres | ||
spring.datasource.driver-class-name=org.postgresql.Driver | ||
# jpa | ||
spring.jpa.show-sql=true | ||
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect | ||
spring.jpa.hibernate.ddl-auto=none | ||
# rabbitmq | ||
spring.rabbitmq.host=localhost | ||
spring.rabbitmq.port=5672 | ||
spring.rabbitmq.username=rabbitmq | ||
spring.rabbitmq.password=rabbitmq | ||
# scheduler | ||
# every minute | ||
scheduler.cron=* * * * * * | ||
# spring | ||
spring.profiles.active=test |