fix(jenkins) (#4970)

* fix(jenkins)

closes #4969

* use `get-port`
This commit is contained in:
Jacob Heider 2024-01-24 13:09:34 -05:00 committed by GitHub
parent e9a043112d
commit b57bb025e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -44,16 +44,16 @@ provides:
test: test:
dependencies: dependencies:
curl.se: '*' curl.se: '*'
pkgx.sh: ^1
script: script:
- run: | - FREE_PORT=$(pkgx get-port)
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 - mkdir -p tmp var/jenkins
- jenkins-lts --version | grep {{version}} - jenkins-lts --version
# version not updated in 2.426.3
- run: jenkins-lts --version | grep {{version}}
if: '<2.426.3 || >=2.426.4'
- jenkins-lts --httpPort=$FREE_PORT > var/jenkins/jenkins.log 2>&1 & - jenkins-lts --httpPort=$FREE_PORT > var/jenkins/jenkins.log 2>&1 &
- PID=$! - PID=$!
- sleep 30 - sleep 30
@ -62,4 +62,4 @@ test:
- cat output.html | grep '<html>' - cat output.html | grep '<html>'
env: env:
_JAVA_OPTIONS: -Djava.io.tmpdir=$PWD/tmp $_JAVA_OPTIONS _JAVA_OPTIONS: -Djava.io.tmpdir=$PWD/tmp $_JAVA_OPTIONS
JENKINS_HOME: $PWD/var/jenkins JENKINS_HOME: $PWD/var/jenkins