Skip to content

Commit

Permalink
Adding jenkins cli
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed Apr 5, 2024
1 parent 8650139 commit e5bda9a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
16 changes: 16 additions & 0 deletions jenkins/cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash -e

THIS="${0##*/}"
JAR="$TMPDIR/jenkins-cli.jar"

[ -z "$JENKINS_ADMIN_PASSWD_FILE" ] && echo "ERROR: $THIS: Please set the JENKINS_ADMIN_PASSWD_FILE environment variable" >&2 && exit 1
PASSWD="$(cat $JENKINS_ADMIN_PASSWD_FILE)"

if ! [ -r "$JAR" ]; then
pushd $TMPDIR > /dev/null
wget -q http:https://localhost:8080/jnlpJars/jenkins-cli.jar
popd > /dev/null
fi


exec java -jar "$JAR" -auth "admin:$PASSWD" "$@"
16 changes: 5 additions & 11 deletions jenkins/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
version: '3.1'
networks:
docker:
volumes:
jenkins-data:/wrk/jenkins/data
jenkins-docker-certs:/wrk/jenkins/certs

services:
jenkins:
Expand All @@ -14,10 +11,9 @@ services:
ports:
- 8080:8080
- 50000:50000
ty: true
volumes:
- jenkins-data:/var/jenkins_home
- jenkins-docker-certs:/certs/client:ro
- /wrk/jenkins/data:/var/jenkins_home
- /wrk/jenkins/certs:/certs/client:ro
- /wrk/jenkins/home:/home
environment:
- DOCKER_HOST=tcp:https://docker:2376
Expand All @@ -30,14 +26,12 @@ services:
restart: always
networks:
docker:
aliases:
- docker
hostname: docker
ports:
- 2376:2376
tty: true
volumes:
- jenkins-data:/var/jenkins_home
- jenkins-docker-certs:/certs/client
- /wrk/jenkins/data:/var/jenkins_home
- /wrk/jenkins/certs:/certs/client
- /wrk/jenkins/home:/home
environment:
- DOCKER_TLS_CERTDIR=/certs
Empty file added jenkins/ex
Empty file.

0 comments on commit e5bda9a

Please sign in to comment.