mirror of
https://github.com/DreamExposure/DisCal-Discord-Bot.git
synced 2026-01-24 04:48:27 -06:00
This should allow jenkins to build the docker images with podman
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM openjdk:8-jdk
|
||||
FROM adoptopenjdk/openjdk16:alpine-jre
|
||||
MAINTAINER DreamExposure
|
||||
COPY target/DisCal-Client.jar DisCal-Client.jar
|
||||
ENTRYPOINT ["java", "-jar", "/DisCal-Client.jar"]
|
||||
|
||||
5
client/build-image.sh
Normal file
5
client/build-image.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
version=$1
|
||||
|
||||
podman build -t rg.nl-ams.scw.cloud/dreamexposure/discal-client:"$version" --file ./Dockerfile .
|
||||
|
||||
podman push rg.nl-ams.scw.cloud/dreamexposure/discal-client:"$version" --creds="$SCW_USER:$SCW_SECRET"
|
||||
@@ -68,7 +68,7 @@
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>client.properties</include>
|
||||
<include>application.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
@@ -122,4 +122,37 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>buildDockerImage-JenkinsOnly</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env.BUILD_NUMBER</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>${maven.plugin.exec.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Build and Push Docker Image</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>sh</executable>
|
||||
<commandlineArgs>build-image.sh ${revision}</commandlineArgs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
@@ -86,7 +86,6 @@ class DisCalClient {
|
||||
//Start Spring
|
||||
try {
|
||||
SpringApplicationBuilder(Application::class.java)
|
||||
.properties("spring.config.name:client")
|
||||
.profiles(BotSettings.PROFILE.get())
|
||||
.build()
|
||||
.run(*args)
|
||||
|
||||
@@ -43,15 +43,6 @@
|
||||
<build>
|
||||
<finalName>DisCal-Core</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.google.cloud.tools</groupId>
|
||||
<artifactId>jib-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
<inherited>false</inherited>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
mvn clean
|
||||
|
||||
mvn package jib:build -pl client -am
|
||||
|
||||
mvn package jib:build -pl server -am
|
||||
|
||||
mvn package jib:build -pl web -am
|
||||
51
pom.xml
51
pom.xml
@@ -52,10 +52,6 @@
|
||||
|
||||
<!--Disabled due to open bug: https://youtrack.jetbrains.com/issue/KT-45689 -->
|
||||
<kotlin.compiler.incremental>false</kotlin.compiler.incremental>
|
||||
|
||||
<!--Jib stuff-->
|
||||
<jib.plugin.version>3.1.1</jib.plugin.version>
|
||||
<image>rg.nl-ams.scw.cloud/dreamexposure/discal-${project.artifactId}:${revision}</image>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
@@ -112,7 +108,6 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<!--Kotlin!!!!-->
|
||||
<dependency>
|
||||
@@ -247,24 +242,6 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.google.cloud.tools</groupId>
|
||||
<artifactId>jib-maven-plugin</artifactId>
|
||||
<version>${jib.plugin.version}</version>
|
||||
<configuration>
|
||||
<container>
|
||||
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
|
||||
</container>
|
||||
<from>
|
||||
<image>adoptopenjdk:16-jre</image>
|
||||
</from>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
<plugins>
|
||||
<!--Kotlin plugin-->
|
||||
<plugin>
|
||||
@@ -396,33 +373,5 @@
|
||||
<discal.version.name>${revision}.d${maven.build.timestamp}</discal.version.name>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>jibAuth</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env.SCW_USER</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>com.google.cloud.tools</groupId>
|
||||
<artifactId>jib-maven-plugin</artifactId>
|
||||
<version>${jib.plugin.version}</version>
|
||||
<configuration>
|
||||
<to>
|
||||
<auth>
|
||||
<username>${env.SCW_USER}</username>
|
||||
<password>${env.SCW_SECRET}</password>
|
||||
</auth>
|
||||
</to>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM openjdk:8-jdk
|
||||
FROM adoptopenjdk/openjdk16:alpine-jre
|
||||
MAINTAINER DreamExposure
|
||||
COPY target/DisCal-Server.jar DisCal-Server.jar
|
||||
COPY server/target/DisCal-Server.jar DisCal-Server.jar
|
||||
ENTRYPOINT ["java", "-jar", "/DisCal-Server.jar"]
|
||||
|
||||
5
server/build-image.sh
Normal file
5
server/build-image.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
version=$1
|
||||
|
||||
podman build -t rg.nl-ams.scw.cloud/dreamexposure/discal-server:"$version" --file ./Dockerfile .
|
||||
|
||||
podman push rg.nl-ams.scw.cloud/dreamexposure/discal-server:"$version" --creds="$SCW_USER:$SCW_SECRET"
|
||||
@@ -93,7 +93,7 @@
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>server.properties</include>
|
||||
<include>application.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
@@ -147,4 +147,37 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>buildDockerImage-JenkinsOnly</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env.BUILD_NUMBER</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>${maven.plugin.exec.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Build and Push Docker Image</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>sh</executable>
|
||||
<commandlineArgs>build-image.sh ${revision}</commandlineArgs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
@@ -69,7 +69,6 @@ class DisCalServer(val networkInfo: NetworkInfo) : ApplicationRunner {
|
||||
//Start up spring
|
||||
try {
|
||||
SpringApplicationBuilder(Application::class.java)
|
||||
.properties("spring.config.name:server")
|
||||
.profiles(BotSettings.PROFILE.get())
|
||||
.build()
|
||||
.run(*args)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM openjdk:8-jdk
|
||||
FROM adoptopenjdk/openjdk16:alpine-jre
|
||||
MAINTAINER DreamExposure
|
||||
COPY target/DisCal-Web.jar DisCal-Web.jar
|
||||
COPY web/target/DisCal-Web.jar DisCal-Web.jar
|
||||
ENTRYPOINT ["java", "-jar", "/DisCal-Web.jar"]
|
||||
|
||||
5
web/build-image.sh
Normal file
5
web/build-image.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
version=$1
|
||||
|
||||
podman build -t rg.nl-ams.scw.cloud/dreamexposure/discal-web:"$version" --file ./Dockerfile .
|
||||
|
||||
podman push rg.nl-ams.scw.cloud/dreamexposure/discal-web:"$version" --creds="$SCW_USER:$SCW_SECRET"
|
||||
35
web/pom.xml
35
web/pom.xml
@@ -100,7 +100,7 @@
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>web.properties</include>
|
||||
<include>application.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
@@ -206,4 +206,37 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>buildDockerImage-JenkinsOnly</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env.BUILD_NUMBER</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>${maven.plugin.exec.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Build and Push Docker Image</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>sh</executable>
|
||||
<commandlineArgs>build-image.sh ${revision}</commandlineArgs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
@@ -30,7 +30,6 @@ class DisCalWeb {
|
||||
try {
|
||||
DiscordAccountHandler.init()
|
||||
SpringApplicationBuilder(Application::class.java)
|
||||
.properties("spring.config.name:web")
|
||||
.profiles(BotSettings.PROFILE.get())
|
||||
.build()
|
||||
.run(*args)
|
||||
|
||||
Reference in New Issue
Block a user