Added .deb and .rpm package build step
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine 2022-07-17 13:32:58 -04:00
parent 8c36855593
commit dad3e6c1cf
7 changed files with 266 additions and 78 deletions

View File

@ -10,6 +10,14 @@ pipeline:
commands: commands:
- mvn clean compile assembly:single - mvn clean compile assembly:single
package:
image: maven:3-jdk-11
commands:
- apt update && apt install -y rpm
- mvn clean compile package
when:
event: tag
gitea_release: gitea_release:
image: plugins/gitea-release image: plugins/gitea-release
settings: settings:
@ -18,6 +26,8 @@ pipeline:
base_url: https://git.metaunix.net base_url: https://git.metaunix.net
title: "${CI_COMMIT_TAG}" title: "${CI_COMMIT_TAG}"
files: files:
- target/Dragoon-*.jar - target/dragoon-*.jar
- target/dragoon-*.deb
- target/rpm/dragoon/RPMS/noarch/dragoon-*.rpm
when: when:
event: tag event: tag

289
pom.xml
View File

@ -5,11 +5,35 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>tech.bitgoblin</groupId> <groupId>tech.bitgoblin</groupId>
<artifactId>Dragoon</artifactId> <artifactId>dragoon</artifactId>
<version>0.3.1</version> <version>0.3.1</version>
<name>Dragoon</name> <name>Dragoon</name>
<url>https://www.bitgoblin.tech</url> <url>https://www.bitgoblin.tech</url>
<description>Automated video transcoder service.</description>
<inceptionYear>2022</inceptionYear>
<organization>
<name>Bit Goblin</name>
<url>https://www.bitgoblin.tech</url>
</organization>
<developers>
<developer>
<id>gballantine</id>
<name>Gregory Ballantine</name>
<email>gballantine@bitgoblin.tech</email>
</developer>
</developers>
<licenses>
<license>
<name>BSD</name>
<url>https://opensource.org/licenses/BSD-2-Clause</url>
<distribution>repo</distribution>
<comments>Simplified BSD license.</comments>
</license>
</licenses>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -42,81 +66,192 @@
</dependencies> </dependencies>
<build> <build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> <plugins>
<plugins> <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> <plugin>
<plugin> <artifactId>maven-clean-plugin</artifactId>
<artifactId>maven-clean-plugin</artifactId> <version>3.1.0</version>
<version>3.1.0</version> </plugin>
</plugin> <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> <plugin>
<plugin> <artifactId>maven-resources-plugin</artifactId>
<artifactId>maven-resources-plugin</artifactId> <version>3.0.2</version>
<version>3.0.2</version> </plugin>
</plugin> <plugin>
<plugin> <artifactId>maven-compiler-plugin</artifactId>
<artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version>
<version>3.8.0</version> </plugin>
</plugin> <plugin>
<plugin> <artifactId>maven-surefire-plugin</artifactId>
<artifactId>maven-surefire-plugin</artifactId> <version>2.22.1</version>
<version>2.22.1</version> </plugin>
</plugin> <plugin>
<plugin> <artifactId>maven-jar-plugin</artifactId>
<artifactId>maven-jar-plugin</artifactId> <version>3.0.2</version>
<version>3.0.2</version> <configuration>
<configuration> <!-- DO NOT include log4j.properties file in your Jar -->
<!-- DO NOT include log4j.properties file in your Jar --> <excludes>
<excludes> <exclude>**/log4j.properties</exclude>
<exclude>**/log4j.properties</exclude> </excludes>
</excludes> <archive>
<archive> <manifest>
<manifest> <!-- Jar file entry point -->
<!-- Jar file entry point --> <mainClass>tech.bitgoblin.App</mainClass>
<mainClass>tech.bitgoblin.App</mainClass> </manifest>
</manifest> </archive>
</archive> </configuration>
</configuration> </plugin>
</plugin> <plugin>
<plugin> <artifactId>maven-assembly-plugin</artifactId>
<artifactId>maven-assembly-plugin</artifactId> <executions>
<executions> <execution>
<execution> <phase>package</phase>
<phase>package</phase> <goals>
<goals> <goal>single</goal>
<goal>single</goal> </goals>
</goals> </execution>
</execution> </executions>
</executions> <configuration>
<configuration> <archive>
<archive> <manifest>
<manifest> <mainClass>tech.bitgoblin.App</mainClass>
<mainClass>tech.bitgoblin.App</mainClass> </manifest>
</manifest> </archive>
</archive> <descriptorRefs>
<descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef>
<descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs>
</descriptorRefs> </configuration>
</configuration> </plugin>
</plugin> <plugin>
<plugin> <groupId>com.aerse.maven</groupId>
<artifactId>maven-install-plugin</artifactId> <artifactId>deb-maven-plugin</artifactId>
<version>2.5.2</version> <version>1.16</version>
</plugin> <executions>
<plugin> <execution>
<artifactId>maven-deploy-plugin</artifactId> <id>package</id>
<version>2.8.2</version> <phase>package</phase>
</plugin> <goals>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> <goal>package</goal>
<plugin> </goals>
<artifactId>maven-site-plugin</artifactId> </execution>
<version>3.7.1</version> </executions>
</plugin> <configuration>
<plugin> <unixUserId>dragoon</unixUserId>
<artifactId>maven-project-info-reports-plugin</artifactId> <unixGroupId>dragoon</unixGroupId>
<version>3.0.0</version> <debBaseDir>${project.basedir}/src/build/deb</debBaseDir>
</plugin> <installDir>/opt</installDir>
</plugins> <osDependencies>
</pluginManagement> <openjdk-11-jdk></openjdk-11-jdk>
<maven></maven>
<ffmpeg></ffmpeg>
</osDependencies>
<javaServiceWrapper>false</javaServiceWrapper>
<generateVersion>false</generateVersion>
<fileSets>
<fileSet>
<source>${basedir}/src/build/deb</source>
<target>/</target>
</fileSet>
<fileSet>
<source>${basedir}/target/dragoon-${project.version}-jar-with-dependencies.jar</source>
<target>/opt/dragoon/dragoon.jar</target>
</fileSet>
</fileSets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.2.0</version>
<executions>
<execution>
<id>generate-rpm</id>
<goals>
<goal>rpm</goal>
</goals>
</execution>
</executions>
<configuration>
<license>BSD 2-Clause</license>
<group>Applications/Multimedia</group>
<icon>src/main/resources/icon.gif</icon>
<packager>Bit Goblin</packager>
<prefix>/opt</prefix>
<changelogFile>${project.basedir}/src/build/changelog.txt</changelogFile>
<targetOs>linux</targetOs>
<mappings>
<mapping>
<directory>/opt/dragoon</directory>
<filemode>755</filemode>
<username>dragoon</username>
<groupname>dragoon</groupname>
</mapping>
<mapping>
<directory>/opt/dragoon/dragoon.jar</directory>
<filemode>755</filemode>
<username>dragoon</username>
<groupname>dragoon</groupname>
<sources>
<source>
<location>${basedir}/target/dragoon-${project.version}-jar-with-dependencies.jar</location>
</source>
</sources>
</mapping>
<mapping>
<directory>/etc/dragoon</directory>
<configuration>true</configuration>
<filemode>755</filemode>
<username>dragoon</username>
<groupname>dragoon</groupname>
<sources>
<source>
<location>${project.basedir}/src/build/deb/etc/dragoon</location>
</source>
</sources>
</mapping>
<mapping>
<directory>/etc/systemd/system/dragoon.service</directory>
<filemode>644</filemode>
<username>root</username>
<groupname>root</groupname>
<sources>
<source>
<location>${project.basedir}/src/build/deb/etc/systemd/system/dragoon.service</location>
</source>
</sources>
</mapping>
</mappings>
<requires>
<require>java-11-openjdk</require>
<require>ffmpeg</require>
</requires>
<preinstallScriptlet>
<script>echo "installing ${project.name} now"</script>
</preinstallScriptlet>
<postinstallScriptlet>
<scriptFile>src/build/scripts/postinstall.sh</scriptFile>
<fileEncoding>utf-8</fileEncoding>
<filter>true</filter>
</postinstallScriptlet>
</configuration>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</build> </build>
</project> </project>

1
src/build/changelog.txt Normal file
View File

@ -0,0 +1 @@
# Check https://git.metaunix.net/bitgoblin/dragoon/releases for the current changelog

View File

@ -0,0 +1,8 @@
# This example transcodes footage to DNxHD 1080p60 for use in video editors like DaVinci Resolve.
[transcoder]
repo_path = '~/videos' # location of the videos to transcode
video_format = 'mov' # video container format
video_codec = 'dnxhd' # video codec to use
video_parameters = 'scale=1920x1080,fps=60,format=yuv422p' # video extra format parameters flag - this will be broken later into separate attributes
video_profile = 'dnxhr_hq' # DNxHD has multiple presets for various video qualities
audio_codec = 'pcm_s16le' # audio codec to use

View File

@ -0,0 +1,11 @@
[Unit]
Description=Dragoon video transcoder service
[Service]
User=dragoon
Group=dragoon
ExecStart=/usr/bin/java -jar '/opt/dragoon/dragoon.jar'
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,23 @@
#!/bin/sh
GETENT_USER=$(getent passwd dragoon)
GETENT_GROUP=$(getent group dragoon)
# Create the dragoon user if it doesn't already exist
if [ "$GETENT_USER" = "" ]; then
useradd -r dragoon
else
echo "The 'dragoon' user already exists, skipping creation."
fi
# Create the dragoon group if it doesn't already exist
if [ "$GETENT_GROUP" = "" ]; then
groupadd dragoon
usermod -aG dragoon dragoon
else
echo "The 'dragoon' group already exists, skipping creation."
fi
# Change the directory ownership of /opt and /etc
chown -R dragoon:dragoon /etc/dragoon
chown -R dragoon:dragoon /opt/dragoon

BIN
src/main/resources/icon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB