Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core20 and Java 17 #34

Merged
merged 8 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions snap/scripts/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
26 changes: 15 additions & 11 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,46 @@ 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
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-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:
plugin: dump
source: snap/scripts
merlijn-sebrechts marked this conversation as resolved.
Show resolved Hide resolved