From 442795ef39cc32b5e9b8a31bec22be2097e64c6f Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 3 Nov 2012 14:24:06 +0100 Subject: initial (test-)configuration for jenkins-job-builder --- TODO | 14 +++++++++++++- job-cfg/d-i.yaml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ job-cfg/general.yaml | 9 +++++++++ update_jdn.sh | 11 +++++++++-- 4 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 job-cfg/d-i.yaml create mode 100644 job-cfg/general.yaml diff --git a/TODO b/TODO index 1530214f..7272d10f 100644 --- a/TODO +++ b/TODO @@ -18,10 +18,10 @@ About jenkins.debian.net == General todo +* use https://github.com/openstack*ci/jenkins*job*builder to create _all_ job configurations (if possible, else mix with job*dsl*plugin or https://github.com/JoelJ/Templating.git * mail notifications (to where?) * proper backup (=daily), see bottom of this document for what to backup * more tests (see below) -* use https://github.com/openstack*ci/jenkins*job*builder to create _all_ job configurations (if possible, else mix with job*dsl*plugin or https://github.com/JoelJ/Templating.git === Minor stuff @@ -60,7 +60,19 @@ About jenkins.debian.net ** update_jdn.sh is available in the git repo * package configuration is kept in git and deployed by update_jdn.sh as well +=== installing jenkins-job-builder +* rebuild python-jenkinsapi from sid for wheezy +* pip install python-jenkins +* git clone https://github.com/openstack-ci/jenkins-job-builder ; cd jenkins-job-builder ; python setup.py install + +=== using jenkins-job-builder + +* then run 'cd /srv/jenkins/job-cfg ; jenkins-jobs update .' to update jobs + +* testing: 'cd /srv/jenkins/job-cfg ; rm test-output/ -r ; mkdir test-output ; jenkins-jobs test . -o test-output/ ; ls test-output/' + == To backup + * /etc/.git * /var/lib/jenkins/job/*/config.xml * /var/lib/jenkins/config.xml as well as its plugins etc diff --git a/job-cfg/d-i.yaml b/job-cfg/d-i.yaml new file mode 100644 index 00000000..5e8fc182 --- /dev/null +++ b/job-cfg/d-i.yaml @@ -0,0 +1,52 @@ +- job-template: + name: '{name}-manual' + + scm: + - svn: + url: svn://svn.debian.org/svn/d-i/trunk + basedir: . + workspaceupdater: update + # repositorybrowser missing: + # + # + # + # true + # true + # /srv/jenkins/logparse/debian.rules + # + # + +- job-template: + name: '{name}-parse-build-logs' + + builders: + - shell: '/srv/jenkins/bin/parse_d-i_logs.sh http://d-i.debian.org/daily-images/build-logs.html' + + triggers: + - timed: "0 5 * * *" + # publisher: logparse also missing + # publisher: build-logs.html "daily d-i build logs" + +- project: + name: testjob_d-i + + jobs: + - '{name}-manual' + - '{name}-parse-build-logs' + + + diff --git a/job-cfg/general.yaml b/job-cfg/general.yaml new file mode 100644 index 00000000..1d70c158 --- /dev/null +++ b/job-cfg/general.yaml @@ -0,0 +1,9 @@ +- defaults: + name: global + description: 'configured by jenkins-job-builder, do not edit this job through the web UI.' + project-type: freestyle + logrotate: + daysToKeep: 90 + numToKeep: 25 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 diff --git a/update_jdn.sh b/update_jdn.sh index c15a19c0..79ee43c5 100755 --- a/update_jdn.sh +++ b/update_jdn.sh @@ -14,7 +14,7 @@ done # # install the heart of jenkins.debian.net # -cp -r bin logparse /srv/jenkins/ +cp -r bin logparse job-cfg /srv/jenkins/ cp -r userContent/* /var/lib/jenkins/userContent/ asciidoc -a numbered -a data-uri -a iconsdir=/etc/asciidoc/images/icons -a scriptsdir=/etc/asciidoc/javascripts -a imagesdir=./ -b html5 -a toc -a toclevels=4 -a icons -o about.html TODO && cp about.html /var/lib/jenkins/userContent/ @@ -24,7 +24,7 @@ asciidoc -a numbered -a data-uri -a iconsdir=/etc/asciidoc/images/icons -a scrip # sudo apt-get install vim screen less etckeeper curl mtr-tiny dstat devscripts bash-completion shorewall shorewall6 cron-apt apt-listchanges \ build-essential python-setuptools \ - debootstrap sudo figlet graphviz apache2 python-yaml + debootstrap sudo figlet graphviz apache2 python-yaml python-pip mr subversion subversion-tools # # deploy package configuration in /etc @@ -42,3 +42,10 @@ sudo chown root.root /etc/sudoers.d/jenkins ; sudo chmod 700 /etc/sudoers.d/jenk sudo ln -sf /etc/apache2/sites-available/jenkins.debian.net /etc/apache2/sites-enabled/000-default sudo service apache2 reload +# +# run jenkins-job-builder to update jobs if needed +# (using sudo because /etc/jenkins_jobs is root:root 700) +# +cd /srv/jenkins/job-cfg +sudo jenkins-jobs update . + -- cgit v1.2.3-70-g09d2