summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--pom.xml54
-rw-r--r--src/main/unix/files/app.config2
-rw-r--r--src/main/unix/files/root/bin/jenkins28
4 files changed, 85 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..eb5a316
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+target
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..e8d395f
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,54 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>io.trygvis</groupId>
+ <artifactId>trygvis-parent</artifactId>
+ <version>1</version>
+ </parent>
+ <groupId>io.trygvis.appsh.apps</groupId>
+ <artifactId>jenkins</artifactId>
+ <version>1.500</version>
+ <packaging>unix-zip</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.jenkins-ci.main</groupId>
+ <artifactId>jenkins-war</artifactId>
+ <version>1.500</version>
+ <type>war</type>
+ </dependency>
+ </dependencies>
+ <repositories>
+ <repository>
+ <id>jenkins</id>
+ <url>http://repo.jenkins-ci.org/public/</url>
+ </repository>
+ </repositories>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo.unix</groupId>
+ <artifactId>unix-maven-plugin</artifactId>
+ <version>1.0-alpha-7-SNAPSHOT</version>
+ <extensions>true</extensions>
+ <configuration>
+ <contact>Trygve Laugstol</contact>
+ <assembly>
+ <copyArtifact>
+ <artifact>org.jenkins-ci.main:jenkins-war:war</artifact>
+ <toFile>root/wars/jenkins.war</toFile>
+ </copyArtifact>
+ <setAttributes>
+ <fileAttributes>
+ <mode>0755</mode>
+ </fileAttributes>
+ <includes>
+ <include>root/bin/*</include>
+ <include>hooks/*</include>
+ </includes>
+ </setAttributes>
+ </assembly>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/src/main/unix/files/app.config b/src/main/unix/files/app.config
new file mode 100644
index 0000000..347d141
--- /dev/null
+++ b/src/main/unix/files/app.config
@@ -0,0 +1,2 @@
+jenkins.httpPort=8888
+jenkins.ajp13Port=-1
diff --git a/src/main/unix/files/root/bin/jenkins b/src/main/unix/files/root/bin/jenkins
new file mode 100644
index 0000000..750ef66
--- /dev/null
+++ b/src/main/unix/files/root/bin/jenkins
@@ -0,0 +1,28 @@
+#!/bin/bash -e
+
+set -u
+set -e
+set -x
+
+mkdir -p "$APP_HOME/logs"
+exec >> "$APP_HOME/logs/jenkins.out"
+exec 2>&1
+
+mkdir -p "$APP_HOME/jenkins-home"
+JENKINS_HOME="$APP_HOME/jenkins-home"
+export JENKINS_HOME
+
+IFS="
+"
+
+ARGS=(-jar wars/jenkins.war)
+
+# Plainly pass any argument in the "jenkins" group to Jenkins.
+for line in $(app cat-conf -g jenkins | cut -f 2- -d .)
+do
+ ARGS+=("--$line")
+done
+
+exec java "${ARGS[@]}" \
+ --logfile jenkins.log \
+ 2>&1