Skip to content

Commit

Permalink
Merge pull request #34 from kz6fittycent/master
Browse files Browse the repository at this point in the history
Core20 and Java 17
  • Loading branch information
merlijn-sebrechts committed Oct 18, 2023
2 parents ed395a5 + ad4e9d3 commit 9e7bab9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
3 changes: 3 additions & 0 deletions snap/local/launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

$SNAP/usr/lib/jvm/java-17-openjdk/bin/java -DJENKINS_HOME="$SNAP_DATA" -Djava.awt.headless=true -jar $SNAP/jenkins.war
31 changes: 15 additions & 16 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: jenkins
summary: Jenkins automation server
base: core18
base: core20
description: |
Jenkins is the leading open-source automation server. Built with Java, it
provides over 1000 plugins to support automating virtually anything, so that
humans can actually spend their time doing things machines cannot.
adopt-info: jenkins

confinement: classic
Expand All @@ -15,43 +16,41 @@ apps:
environment:
XDG_DATA_HOME: "$SNAP/usr/share"
FONTCONFIG_PATH: "$SNAP/etc/fonts"
JAVA_HOME: "$SNAP/usr/lib/jvm/java-11-openjdk"
JAVA_HOME: "$SNAP/usr/lib/jvm/java-17-openjdk"
LD_LIBRARY_PATH: "$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET"
command: |
usr/lib/jvm/java-11-openjdk/bin/java -DJENKINS_HOME="$SNAP_DATA" -Djava.awt.headless=true -jar $SNAP/jenkins.war
command: launch
daemon: simple
config:
command: jenkins-config

parts:
bsi-trigger: # A non-built part, only used to trigger builds in build.snapcraft.io on upstream changes
plugin: nil
source: https://github.com/jenkinsci/jenkins.git
jenkins:
plugin: nil
source: https://github.com/jenkinsci/jenkins.git # in lieu of the BGI trigger which didn't seem to work
stage-packages:
- fonts-dejavu-core
- libfontconfig1
- openjdk-11-jre-headless
- openjdk-17-jre-headless
- ca-certificates-java
build-packages:
- curl
- unzip
- libnss3
- ca-certificates-java

override-pull: |
snapcraftctl pull
snapcraftctl set-version "$(git describe --tags | sed 's/^v//' | cut -d "-" -f2)"
override-build: |
curl -sLO http://mirrors.jenkins.io/war/latest/jenkins.war
unzip jenkins.war META-INF/MANIFEST.MF
VERSION=$(grep Jenkins-Version META-INF/MANIFEST.MF | cut -d' ' -f2 | tr -d '\r')
rm META-INF/MANIFEST.MF
mv $SNAPCRAFT_PART_INSTALL/usr/lib/jvm/java-11-openjdk-* $SNAPCRAFT_PART_INSTALL/usr/lib/jvm/java-11-openjdk
rm $SNAPCRAFT_PART_INSTALL/usr/lib/jvm/java-11-openjdk/lib/security/cacerts
cp /etc/ssl/certs/java/cacerts $SNAPCRAFT_PART_INSTALL/usr/lib/jvm/java-11-openjdk/lib/security/cacerts
mv $SNAPCRAFT_PART_INSTALL/usr/lib/jvm/java-17-openjdk-* $SNAPCRAFT_PART_INSTALL/usr/lib/jvm/java-17-openjdk
rm $SNAPCRAFT_PART_INSTALL/usr/lib/jvm/java-17-openjdk/lib/security/cacerts
cp /etc/ssl/certs/java/cacerts $SNAPCRAFT_PART_INSTALL/usr/lib/jvm/java-17-openjdk/lib/security/cacerts
cp /etc/ssl/certs/java/cacerts $SNAPCRAFT_PART_INSTALL/etc/ssl/certs/java/cacerts
mv jenkins.war $SNAPCRAFT_PART_INSTALL
snapcraftctl set-version "$VERSION"
config:
plugin: dump
source: snap/local
prime:
- jenkins-config
- launch

0 comments on commit 9e7bab9

Please sign in to comment.