mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 02:25:18 +03:00
+jenkins.io (#4926)
* new file: projects/jenkins.io/package.yml * debug * find FREE_PORT for test * grep <html>
This commit is contained in:
parent
0d0228f300
commit
88315c364a
65
projects/jenkins.io/package.yml
Normal file
65
projects/jenkins.io/package.yml
Normal file
|
@ -0,0 +1,65 @@
|
|||
distributable:
|
||||
url: https://get.jenkins.io/war-stable/2.426.2/jenkins.war
|
||||
|
||||
versions:
|
||||
url: https://www.jenkins.io/download/
|
||||
match: /\d+\.\d+\.\d+\/jenkins\.war/
|
||||
strip: /\/jenkins\.war/
|
||||
|
||||
warnings:
|
||||
- vendored
|
||||
|
||||
dependencies:
|
||||
openjdk.org: '<20'
|
||||
|
||||
runtime:
|
||||
env:
|
||||
JENKINS_HOME: ${{prefix}}/var/jenkins
|
||||
|
||||
build:
|
||||
- run: mkdir -p libexec/lib bin var/jenkins
|
||||
working-directory: ${{prefix}}
|
||||
- jar xvf jenkins.io-{{version}}.war
|
||||
- cp -r jenkins.io-{{version}}.war {{prefix}}/libexec/lib/
|
||||
- cp -r WEB-INF/lib/* {{prefix}}/libexec/lib/
|
||||
- run: |
|
||||
cat > jenkins-lts <<EOF
|
||||
#!/bin/sh
|
||||
exec java -jar \$(dirname \$0)/../libexec/lib/jenkins.io-{{version}}.war "\$@"
|
||||
EOF
|
||||
chmod +x jenkins-lts
|
||||
working-directory: ${{prefix}}/bin
|
||||
- run: |
|
||||
cat > jenkins-lts-cli <<EOF
|
||||
#!/bin/sh
|
||||
exec java -jar \$(dirname \$0)/../libexec/lib/cli-{{version}}.jar "\$@"
|
||||
EOF
|
||||
chmod +x jenkins-lts-cli
|
||||
working-directory: ${{prefix}}/bin
|
||||
|
||||
provides:
|
||||
- bin/jenkins-lts
|
||||
- bin/jenkins-lts-cli
|
||||
|
||||
test:
|
||||
dependencies:
|
||||
curl.se: '*'
|
||||
script:
|
||||
- run: |
|
||||
for i in $(seq 1 10); do
|
||||
FREE_PORT=$((RANDOM % 10000 + 1024))
|
||||
if ! nc -z localhost $FREE_PORT; then
|
||||
echo $FREE_PORT
|
||||
fi
|
||||
done
|
||||
- mkdir -p tmp var/jenkins
|
||||
- jenkins-lts --version | grep {{version}}
|
||||
- jenkins-lts --httpPort=$FREE_PORT > var/jenkins/jenkins.log 2>&1 &
|
||||
- PID=$!
|
||||
- sleep 30
|
||||
- curl -L localhost:$FREE_PORT -o output.html
|
||||
- kill $PID || cat var/jenkins/jenkins.log # debug
|
||||
- cat output.html | grep '<html>'
|
||||
env:
|
||||
_JAVA_OPTIONS: -Djava.io.tmpdir=$PWD/tmp $_JAVA_OPTIONS
|
||||
JENKINS_HOME: $PWD/var/jenkins
|
Loading…
Reference in a new issue