Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build directly to static and added heroku deployment #5

Merged
merged 16 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,10 @@ jobs:
with:
name: production-files
path: db-scheduler-ui-backend/target/*.jar

- name: Deploy to Heroku
if: github.ref == 'refs/heads/main'
uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: "jobjugglerapi"
1 change: 1 addition & 0 deletions db-scheduler-ui-backend/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: java -jar target/db-scheduler-ui-backend-*.jar
32 changes: 24 additions & 8 deletions db-scheduler-ui-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,28 @@
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<verbose>true</verbose>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<version>3.0.7</version>
</plugin>
</plugins>
</build>

</project>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.github.bekk.dbscheduleruibackend.model.GetTasksResponse;
import com.github.bekk.dbscheduleruibackend.model.TaskData;
import com.github.bekk.dbscheduleruibackend.model.TaskType;
import com.github.bekk.dbscheduleruibackend.model.TaskRequestParams.TaskFilter;
import com.github.bekk.dbscheduleruibackend.util.mapper.TaskMapper;
import com.github.kagkarlsson.scheduler.ScheduledExecution;
import com.github.kagkarlsson.scheduler.Scheduler;
Expand Down Expand Up @@ -90,7 +89,7 @@ public void runAllTasks(){

public GetTasksResponse getAllTasks(TaskRequestParams params) {
List<TaskModel> tasks = TaskMapper.mapAllExecutionsToTaskModel(scheduler.getScheduledExecutions(), scheduler.getCurrentlyExecuting()).stream().filter(task -> {
if (params.getFilter() != TaskFilter.ALL) {
if (params.getFilter() != TaskRequestParams.TaskFilter.ALL) {
return switch (params.getFilter()) {
case FAILED -> task.getConsecutiveFailures() != 0;
case RUNNING -> task.isPicked();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
server.port=8081
server.port=${PORT:8081}
spring.datasource.url=jdbc:h2:file:./db-scheduler-ui-backend/test-db;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE;DEFAULT_NULL_ORDERING=HIGH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funker den H2 greia her på heroku?

spring.datasource.driver-class-name=org.h2.Driver
1 change: 1 addition & 0 deletions db-scheduler-ui-backend/system.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java.runtime.version=17
2 changes: 1 addition & 1 deletion db-scheduler-ui-frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang='en'>
<head>
<meta charset='UTF-8' />
<link rel="icon" type="image/svg+xml" href="./src/assets/src/icons/Favicon.svg" />
<link rel="icon" type="image/svg+xml" href="./public/Favicon.svg" />
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<title>JobJuggler</title>
</head>
Expand Down
19 changes: 19 additions & 0 deletions db-scheduler-ui-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.