Loading service/jenkins.md +22 −19 Original line number Diff line number Diff line Loading @@ -14,25 +14,28 @@ websites and run tests from the [legacy git infrastructure](howto/git). ## Removing a job To remove a job, remove it from the YAML file (or the entire YAML file, if the file ends up empty) from [jenkins/jobs.git][] and push the result. The job will still show up in Jenkins unfortunately, and can be triggered as normal, so if you *really* want the job to disappear completely, you *also* need to remove it from there, by clicking the "Delete project" or "Delete multi-configuration project" button in the project. If you feel this might cause problems, it might be worth first disabling the job through the web interface some time before the removal, so people have time to protest. So, TL;DR: 1. warn about the job retirement 2. disable the job in the web interface 3. wait, then warn again about the job removal 4. remove the job from git 5. delete the project from the web interface To remove a job, you first need to build a list of currently available jobs on the Jenkins server: sudo -u jenkins jenkins-jobs --conf /srv/jenkins.torproject.org//etc/jenkins_jobs.ini list > jobs-before Then remove the job(s) from the YAML file (or the entire YAML file, if the file ends up empty) from [jenkins/jobs.git][] and push the result. Then, regenerate a list of jobs: sudo -u jenkins jenkins-jobs --conf /srv/jenkins.torproject.org//etc/jenkins_jobs.ini list -p . > jobs-after And generate the list of jobs that were removed: comm -23 jobs-before jobs-after Then delete those jobs: comm -23 jobs-before jobs-after | while read job; do sudo -u jenkins jenkins-jobs --conf /srv/jenkins.torproject.org//etc/jenkins_jobs.ini delete $job done ## Pager playbook Loading Loading
service/jenkins.md +22 −19 Original line number Diff line number Diff line Loading @@ -14,25 +14,28 @@ websites and run tests from the [legacy git infrastructure](howto/git). ## Removing a job To remove a job, remove it from the YAML file (or the entire YAML file, if the file ends up empty) from [jenkins/jobs.git][] and push the result. The job will still show up in Jenkins unfortunately, and can be triggered as normal, so if you *really* want the job to disappear completely, you *also* need to remove it from there, by clicking the "Delete project" or "Delete multi-configuration project" button in the project. If you feel this might cause problems, it might be worth first disabling the job through the web interface some time before the removal, so people have time to protest. So, TL;DR: 1. warn about the job retirement 2. disable the job in the web interface 3. wait, then warn again about the job removal 4. remove the job from git 5. delete the project from the web interface To remove a job, you first need to build a list of currently available jobs on the Jenkins server: sudo -u jenkins jenkins-jobs --conf /srv/jenkins.torproject.org//etc/jenkins_jobs.ini list > jobs-before Then remove the job(s) from the YAML file (or the entire YAML file, if the file ends up empty) from [jenkins/jobs.git][] and push the result. Then, regenerate a list of jobs: sudo -u jenkins jenkins-jobs --conf /srv/jenkins.torproject.org//etc/jenkins_jobs.ini list -p . > jobs-after And generate the list of jobs that were removed: comm -23 jobs-before jobs-after Then delete those jobs: comm -23 jobs-before jobs-after | while read job; do sudo -u jenkins jenkins-jobs --conf /srv/jenkins.torproject.org//etc/jenkins_jobs.ini delete $job done ## Pager playbook Loading