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

Improvement/adding auto restart #166

Merged
merged 4 commits into from
Sep 7, 2020
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
4 changes: 2 additions & 2 deletions Core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Gaps</artifactId>
<groupId>com.jasonhhouse</groupId>
<version>0.7.3</version>
<version>0.7.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -15,7 +15,7 @@
<dependency>
<groupId>com.jasonhhouse</groupId>
<artifactId>Plex</artifactId>
<version>0.7.3</version>
<version>0.7.4</version>
</dependency>

<dependency>
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM adoptopenjdk/openjdk11-openj9:jre-11.0.7_10_openj9-0.20.0
FROM adoptopenjdk/openjdk11-openj9:jre-11.0.8_10_openj9-0.21.0

LABEL maintainer="[email protected]"
LABEL name="Jason House"
Expand All @@ -24,7 +24,7 @@ RUN mkdir -p /usr/app && chmod 777 /usr/data

WORKDIR /usr/app

COPY GapsWeb/target/GapsWeb-0.7.3.jar /usr/app/gaps.jar
COPY GapsWeb/target/GapsWeb-0.7.4.jar /usr/app/gaps.jar

COPY start.sh /usr/app/

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN mkdir -p /usr/app && chmod 777 /usr/data

WORKDIR /usr/app

COPY GapsWeb/target/GapsWeb-0.7.3.jar /usr/app/gaps.jar
COPY GapsWeb/target/GapsWeb-0.7.4.jar /usr/app/gaps.jar

COPY start.sh /usr/app/

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN mkdir -p /usr/app && chmod 777 /usr/data

WORKDIR /usr/app

COPY GapsWeb/target/GapsWeb-0.7.3.jar /usr/app/gaps.jar
COPY GapsWeb/target/GapsWeb-0.7.4.jar /usr/app/gaps.jar

COPY start.sh /usr/app/

Expand Down
2 changes: 1 addition & 1 deletion GapsOnWindows/gaps.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ RMDIR /r $INSTDIR
SectionEnd

# name the installer
OutFile "gaps-0.7.3-installer.exe"
OutFile "gaps-0.7.4-installer.exe"
6 changes: 3 additions & 3 deletions GapsWeb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Gaps</artifactId>
<groupId>com.jasonhhouse</groupId>
<version>0.7.3</version>
<version>0.7.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -21,13 +21,13 @@
<dependency>
<groupId>com.jasonhhouse</groupId>
<artifactId>Core</artifactId>
<version>0.7.3</version>
<version>0.7.4</version>
</dependency>

<dependency>
<groupId>com.jasonhhouse</groupId>
<artifactId>Plex</artifactId>
<version>0.7.3</version>
<version>0.7.4</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@

import java.util.concurrent.Executor;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down
42 changes: 42 additions & 0 deletions GapsWeb/src/main/java/com/jasonhhouse/gaps/RestartMonitor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2020 Jason H House
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/

package com.jasonhhouse.gaps;

import com.jasonhhouse.gaps.service.SchedulerService;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class RestartMonitor {

private static final Logger LOGGER = LoggerFactory.getLogger(RestartMonitor.class);

private final SchedulerService schedulerService;

public RestartMonitor(SchedulerService schedulerService) {
this.schedulerService = schedulerService;
}

@PostConstruct
public void init() {
LOGGER.info("init()");
final Schedule schedule = schedulerService.getRawSchedule();
if (schedule != null) {
LOGGER.info("Setting saved schedule to cron job");
final SchedulePayload schedulePayload = new SchedulePayload(schedule.getId(), schedule.getEnabled());
schedulerService.setSchedule(schedulePayload);
}
}

}
2 changes: 1 addition & 1 deletion GapsWeb/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ info:
app:
name: Gaps
description: Gaps searches through your Plex Server or local folders for all movies, then queries for known movies in the same collection. If those movies don't exist in your library, Gaps will recommend getting those movies, legally of course.
version: 0.7.3
version: 0.7.4
storageFolder: /usr/data
properties:
rssFeed: rssFeed.json
Expand Down
2 changes: 1 addition & 1 deletion GapsWeb/src/main/resources/templates/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<img src="/images/final-2.svg" alt="Gaps Logo" style="width:50%;height:50%;" class="center">

<h3 class="top-margin">About</h3>
<h4 class="top-margin text-primary">v0.7.3</h4>
<h4 class="top-margin text-primary">v0.7.4</h4>

<p class="text-muted">Gaps searches through your Plex Server. It then queries
for known
Expand Down
2 changes: 1 addition & 1 deletion GapsWeb/src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<div class="container bottom-margin">
<img src="/images/final-2.svg" alt="Gaps Logo" style="width:50%;height:50%;" class="center">

<h3 class="top-margin">v0.7.3</h3>
<h3 class="top-margin">v0.7.4</h3>

<p class="text-muted">Gaps searches through your Plex Server. It then queries
for known
Expand Down
6 changes: 6 additions & 0 deletions GapsWeb/src/main/resources/templates/updates.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
<img src="/images/final-2.svg" alt="Gaps Logo" style="width:50%;height:50%;" class="center">

<h3 class="top-margin">Updates</h3>
<h4 class="top-margin text-primary">v0.7.4</h4>
<ul class="text-muted">
<li>Added auto restart to scheduler</li>
<li>Updated x86 Docker version to adoptopenjdk/openjdk11-openj9:jre-11.0.8_10_openj9-0.21.0</li>
</ul>

<h4 class="top-margin text-primary">v0.7.3</h4>
<ul class="text-muted">
<li>Changing how properties are saved and loaded for better exception handling</li>
Expand Down
2 changes: 1 addition & 1 deletion GapsWeb/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ info:
app:
name: Gaps
description: Gaps searches through your Plex Server or local folders for all movies, then queries for known movies in the same collection. If those movies don't exist in your library, Gaps will recommend getting those movies, legally of course.
version: 0.7.3
version: 0.7.4
loginEnabled: false
storageFolder: /usr/data
properties:
Expand Down
2 changes: 1 addition & 1 deletion Plex/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>Gaps</artifactId>
<groupId>com.jasonhhouse</groupId>
<version>0.7.3</version>
<version>0.7.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
22 changes: 2 additions & 20 deletions build
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
#!/bin/bash
VERSION=0.7.3
VERSION=0.7.4
JAR_VERSION="GapsWeb/target/GapsWeb-$VERSION.jar"
ZIP_VERSION="Gaps-$VERSION.zip"
npm run minify-input-css
npm run uglifyjs-index-js
npm run uglifyjs-configuration-js
npm run uglifyjs-libraries-js
npm run uglifyjs-recommended-js
npm run uglifyjs-common-js
npm run uglifyjs-payload-js
npm run uglifyjs-mislabeled-js
npm run uglifyjs-alerts-manager-js
npm run uglifyjs-notification-types-js
npm run uglifyjs-telegram-notifications-js
npm run uglifyjs-slack-notifications-js
npm run uglifyjs-push-bullet-notifications-js
npm run uglifyjs-gotify-notifications-js
npm run uglifyjs-email-notifications-js
npm run uglifyjs-push-over-notifications-js
npm run uglifyjs-schedule-js
./minify
mvn clean install deploy
#docker build -f Dockerfile -t $DOCKER_LATEST .
#cypress run
docker buildx build --platform linux/ppc64le,linux/s390x,linux/amd64 -t housewrecker/gaps:latest -f Dockerfile --push .
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t housewrecker/gaps:arm-latest -f Dockerfile.arm64 --push .
mkdir -p GapsOnWindows
Expand Down
2 changes: 1 addition & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ call npm run uglifyjs-schedule-js
call mvn clean install
del GapsOnWindows\*.jar
del GapsOnWindows\README.md
copy GapsWeb\target\GapsWeb-0.7.3.jar GapsOnWindows\gaps.jar
copy GapsWeb\target\GapsWeb-0.7.4.jar GapsOnWindows\gaps.jar
copy README.md GapsOnWindows\
cd GapsOnWindows
makensis gaps.nsi
4 changes: 3 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"projectId": "3c7d5r",
"baseUrl": "http://localhost:8484"
"baseUrl": "http://localhost:8484",
"videoUploadOnPasses": false,
"videoCompression": false
}
2 changes: 1 addition & 1 deletion cypress/integration/about/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('Verify About Page', function () {
.should('have.text', 'About');

cy.get('.container > :nth-child(3)')
.should('have.text', 'v0.7.3');
.should('have.text', 'v0.7.4');

cy.get('.container > :nth-child(6)')
.should('have.text', 'Software');
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gaps",
"version": "0.7.3",
"version": "0.7.4",
"description": "Gaps searches through your Plex Server or local folders for all movies, then queries for known movies in the same collection. If those movies don't exist in your library, Gaps will recommend getting those movies, legally of course.",
"main": "/",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</parent>
<groupId>com.jasonhhouse</groupId>
<artifactId>Gaps</artifactId>
<version>0.7.3</version>
<version>0.7.4</version>
<name>Gaps</name>
<description>Demo project for Spring Boot</description>

Expand Down
4 changes: 2 additions & 2 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ else
if [ $ENABLE_LOGIN == true ]; then
java -jar -Dspring.profiles.active=no-ssl $JAR_FILE
else
#java -jar -Dspring.profiles.active=no-ssl-no-login $JAR_FILE
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -jar -Dspring.profiles.active=no-ssl-no-login $JAR_FILE
java -jar -Dspring.profiles.active=no-ssl-no-login $JAR_FILE
#java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -jar -Dspring.profiles.active=no-ssl-no-login $JAR_FILE
fi
fi

Expand Down