Skip to content

Attempt to create dockerized Jenkins master template that can be used for testing upgrade procedures.

Notifications You must be signed in to change notification settings

2fd5/jenkins-master-template

Repository files navigation

Jenkins-master-template

Build

docker build . --tag jenkins-master-template:0.0.1

Tag

docker tag jenkins-master-template:0.0.1 organization.azurecr.io/as-jenkins-master-template:0.0.1

Push

docker login organization.azurecr.io
docker push organization.azurecr.io/as-jenkins-master-template:0.0.1

Start

with docker compose it is just

docker-compose up -d && docker-compose logs -f

Access Jenkins

http://localhost:$HOST_HTTP_PORT defaults to http://localhost:28080

Default settings

Default settings for docker-compose are located in .env file.

Set JENKINS_URL post deployment

Base on discussion in JENKINS-28466

Requirements: _JENKINS_URL have to be set on jenkins master. Potentially groovy script could just pass desired value instead of relaying on environment variable state.

curl --user 'username:api_key' --data-urlencode script="$(< ./post-deployment-groovy/jenkins-url.groovy)" http://localhost:28080/scriptText

Also update_jenkins_url.sh "new-hostname.com:8080" can be used.

To get plugins list

JENKINS_HOST=username:password@myhost.com:port
curl -sSL "http://$JENKINS_HOST/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins" | perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)()(<\/\w+>)+/\1 \2\n/g'|sed 's/ /:/'

About

Attempt to create dockerized Jenkins master template that can be used for testing upgrade procedures.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published