Added Maven step to compile a .jar file with all dependencies (for easy deployment); Added code to define the FFMPEG binary path and video repository through a TOML file
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
ffb7d2d9f1
commit
f861445697
21
pom.xml
21
pom.xml
@ -68,6 +68,27 @@
|
|||||||
</archive>
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<mainClass>tech.bitgoblin.App</mainClass>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
|
<descriptorRefs>
|
||||||
|
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||||
|
</descriptorRefs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-install-plugin</artifactId>
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
<version>2.5.2</version>
|
<version>2.5.2</version>
|
||||||
|
@ -15,8 +15,8 @@ public class App {
|
|||||||
// read our config file
|
// read our config file
|
||||||
Config c = new Config(configFile);
|
Config c = new Config(configFile);
|
||||||
// create new Transcoder object and start the service
|
// create new Transcoder object and start the service
|
||||||
//Transcoder t = new Transcoder("~/dragoon");
|
Transcoder t = new Transcoder(c);
|
||||||
//t.transcode();
|
t.transcode();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import tech.bitgoblin.io.IOUtils;
|
|||||||
|
|
||||||
public class Config {
|
public class Config {
|
||||||
|
|
||||||
private String configPath;
|
private final String configPath;
|
||||||
private TomlParseResult result;
|
private TomlParseResult result;
|
||||||
|
|
||||||
public Config(String path) {
|
public Config(String path) {
|
||||||
@ -18,8 +18,6 @@ public class Config {
|
|||||||
// parse config file
|
// parse config file
|
||||||
try {
|
try {
|
||||||
this.parseConfig();
|
this.parseConfig();
|
||||||
String value = this.result.getString("repo");
|
|
||||||
System.out.println(value);
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.out.println("Unable to read config file; please check that " + this.configPath + " is available.");
|
System.out.println("Unable to read config file; please check that " + this.configPath + " is available.");
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
@ -30,6 +28,10 @@ public class Config {
|
|||||||
return this.result.getString(key);
|
return this.result.getString(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean contains(String key) {
|
||||||
|
return this.result.contains(key);
|
||||||
|
}
|
||||||
|
|
||||||
private void parseConfig() throws IOException {
|
private void parseConfig() throws IOException {
|
||||||
// parse config file
|
// parse config file
|
||||||
Path source = Paths.get(this.configPath);
|
Path source = Paths.get(this.configPath);
|
||||||
|
@ -25,12 +25,9 @@ public class Transcoder {
|
|||||||
public Transcoder(Config config) {
|
public Transcoder(Config config) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.repo_dir = IOUtils.resolveTilda(config.getString("transcoder.repo_path"));
|
this.repo_dir = IOUtils.resolveTilda(config.getString("transcoder.repo_path"));
|
||||||
this.initDirectory();
|
if (this.config.contains("transcoder.ffmpeg_path")) {
|
||||||
|
this.ffmpeg_path = config.getString("transcoder.ffmpeg_path");
|
||||||
}
|
}
|
||||||
// define a custom FFMPEG binary path
|
|
||||||
public Transcoder(String repo_dir, String ffmpeg_path) {
|
|
||||||
this.repo_dir = IOUtils.resolveTilda(repo_dir);
|
|
||||||
this.ffmpeg_path = ffmpeg_path;
|
|
||||||
this.initDirectory();
|
this.initDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user