Skip to content

Commit

Permalink
Merge pull request #5 from bekk/heroku-deploy
Browse files Browse the repository at this point in the history
Build directly to static and added heroku deployment
  • Loading branch information
vegarrsm authored Aug 30, 2023
2 parents b7a4a1d + 97d74cb commit f5acb1b
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 12 deletions.
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
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.

0 comments on commit f5acb1b

Please sign in to comment.