diff --git a/README.md b/README.md index 537639f..108ee9b 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,43 @@ # Jenkins jobs configuration This repository manages the jenkins jobs configuration. A [jenkins jobs] applies the configuration on jenkins when a commit is done in this repository [jenkins jobs]: https://jenkins.softwareheritage.org/job/jenkins-tools/job/swh-jenkins-job-builder # Testing To test locally the configuration , simply run ``tox``: ``` tox ``` The output displays the jenkins configuration files as they will be applied on the server. # Run on docker Jenkins jobs configuration can be tested on a local temporary Jenkins instance executed in a docker container. The local ``swh-jenkins-jobs`` repository will be mounted as a volume and cloned by Jenkins so do not forget to commit the changes you want to test. - Launch jenkins ``` docker-compose build docker-compose up ``` -- Get the admin password in the logs Connect to localhost:8080, then within the jenkins ui: -- Change the `admin` password to `admin123` - Create a jenkins folder `jenkins-tools` - Create a new `free-style` job named `job-builder` inside the `jenkins-tools` targeting this git repository `file:///opt/swh-jenkins-jobs` - Configure the branch (e.g. `*/master`) - Add a `build` step `Execute shell` with this content ``` -tox update -- --delete-old +tox -- update --delete-old ``` - Save your build configuration - Trigger a build \o/ diff --git a/docker-compose.yml b/docker-compose.yml index 7c517f1..abb8254 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,22 +1,24 @@ version: '3' volumes: jenkins_data: services: jenkins: image: swh-jenkins:latest build: ./docker volumes: - jenkins_data:/var/jenkins_home - /var/run/docker.sock:/var/run/docker.sock - .:/opt/swh-jenkins-jobs - ./docker:/docker - ./docker/jenkins_jobs.ini:/etc/jenkins_jobs/jenkins_jobs.ini environment: - PLUGINS_FORCE_UPGRADE=true - - JAVA_OPTS=-Dhudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true + - > + JAVA_OPTS=-Dhudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true + -Djenkins.install.runSetupWizard=false ports: - 8080:8080 entrypoint: /docker/entrypoint.sh diff --git a/docker/jenkins_jobs.ini b/docker/jenkins_jobs.ini index abfa258..e1d7e17 100644 --- a/docker/jenkins_jobs.ini +++ b/docker/jenkins_jobs.ini @@ -1,14 +1,12 @@ [job_builder] ignore_cache=True keep_descriptions=False #include_path=.:scripts:~/git/ #exclude=.*:manual:./development recursive=False allow_duplicates=False update=all [jenkins] -user=admin -password=admin123 url=http://localhost:8080 query_plugins_info=False