From 26fb14b6c9c0b1c5827ac21f21a8748d9d5b0aed Mon Sep 17 00:00:00 2001
From: Lin Yang
Date: Wed, 26 Jun 2013 14:56:00 +0800
Subject: [PATCH] add new job config for pre-release function
Change-Id: Ib7780e6628b0de3dad41d10c449ec66d7d0485dc
Signed-off-by: Lin Yang
---
jobs/DeleteTag/config.xml | 57 ------------
jobs/SubmitToOBS_Orig/config.xml | 80 ----------------
jobs/build-check/config.xml | 69 ++++++++++++++
jobs/configuration | 17 +++-
jobs/{BuildCheck => delete-tag}/config.xml | 64 ++++++-------
jobs/image-creator/config.xml | 55 +++++++++++
jobs/mail_sender/config.xml | 16 +++-
jobs/obs-event-dispatcher/config.xml | 129 ++++++++++++++++++++++++++
jobs/{PolicyCheck => policy-check}/config.xml | 45 ++++++---
jobs/pre-release-cleanup/config.xml | 64 +++++++++++++
jobs/pre-release-create/config.xml | 82 ++++++++++++++++
jobs/pre-release-gerrit/config.xml | 88 ++++++++++++++++++
jobs/requests/config.xml | 17 +++-
jobs/ruote_workitems/config.xml | 58 ------------
jobs/{SubmitToOBS => submit-obs}/config.xml | 51 +++++++---
15 files changed, 627 insertions(+), 265 deletions(-)
delete mode 100644 jobs/DeleteTag/config.xml
delete mode 100644 jobs/SubmitToOBS_Orig/config.xml
create mode 100644 jobs/build-check/config.xml
rename jobs/{BuildCheck => delete-tag}/config.xml (55%)
create mode 100644 jobs/image-creator/config.xml
create mode 100644 jobs/obs-event-dispatcher/config.xml
rename jobs/{PolicyCheck => policy-check}/config.xml (59%)
create mode 100644 jobs/pre-release-cleanup/config.xml
create mode 100644 jobs/pre-release-create/config.xml
create mode 100644 jobs/pre-release-gerrit/config.xml
delete mode 100644 jobs/ruote_workitems/config.xml
rename jobs/{SubmitToOBS => submit-obs}/config.xml (61%)
diff --git a/jobs/DeleteTag/config.xml b/jobs/DeleteTag/config.xml
deleted file mode 100644
index 65c04be..0000000
--- a/jobs/DeleteTag/config.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
- delete all tags on gerrit abandoned commit
- false
-
-
- true
- false
- false
- false
-
-
-
-
-
- REG_EXP
- .*
-
-
- REG_EXP
- .*
-
-
-
-
- true
- true
- false
- false
- false
- true
- false
- false
- false
-
-
-
-
- {}
- {}
- {}
- 0
-
-
- true
-
-
- #!/bin/bash
-set -x
-
-${JENKINS_HOME}/jenkins-scripts/job_deletetag.sh
-
-
-
-
-
\ No newline at end of file
diff --git a/jobs/SubmitToOBS_Orig/config.xml b/jobs/SubmitToOBS_Orig/config.xml
deleted file mode 100644
index 84408c6..0000000
--- a/jobs/SubmitToOBS_Orig/config.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
- This script will submit a merged change to corresponding OBS staging project. If necessary, create SR to request merge to target OBS project.
- false
-
-
- true
- false
- false
- false
-
-
-
-
-
- REG_EXP
- .*
-
-
- REG_EXP
- .*
-
-
-
-
- true
- true
- false
- true
- true
- false
- false
- false
- false
-
-
-
-
- {}
- {}
- {}
- 0
-
-
- false
-
-
- #!/bin/bash
-set -x
-
-python ${JENKINS_HOME}/jenkins-scripts/job_submitobs_v1.py
-
-
-
-
-
-
-
-
- ${BUILD_TAG}.env
-
-
- mail_sender,
- SUCCESS
- false
-
-
-
-
-
-
-
- ${JENKINS_HOME}/jobs/configuration
- GIT_CACHE_DIR=${JENKINS_HOME}/git
- false
-
-
-
-
\ No newline at end of file
diff --git a/jobs/build-check/config.xml b/jobs/build-check/config.xml
new file mode 100644
index 0000000..a40420f
--- /dev/null
+++ b/jobs/build-check/config.xml
@@ -0,0 +1,69 @@
+
+
+
+ This job will be triggered by obs build finish event of buildcheck project in OBS, and get its build result and post it back to gerrit. If build failed, it will send out build log as mail attachment to patch owner.
+
+ 7
+ 1000
+ -1
+ -1
+
+ false
+
+
+ 100
+
+
+
+ 10
+ true
+ false
+ false
+ false
+
+ false
+
+
+ #!/bin/bash
+set -x
+
+python ${JENKINS_HOME}/jenkins-scripts/job_buildcheck_post.py
+
+
+
+
+
+ def matcher_build = manager.getLogMatcher(".*BUILD CHECK RESULT.*")
+def matcher_prj = manager.getLogMatcher(".*\"project\": \"([^\"]*)\".*")
+if(matcher_build?.matches() && matcher_prj?.matches()) {
+ manager.addShortText(matcher_prj.group(1))
+}
+ 0
+
+
+
+
+
+
+ ${BUILD_TAG}.env
+
+
+ mail_sender,
+ SUCCESS
+ false
+
+
+
+
+
+
+ false
+
+
+
+ ${JENKINS_HOME}/jobs/configuration
+ false
+
+
+
+
\ No newline at end of file
diff --git a/jobs/configuration b/jobs/configuration
index 68de9f9..9a91882 100644
--- a/jobs/configuration
+++ b/jobs/configuration
@@ -1,15 +1,24 @@
+#OBS related parameters
OBS_URL=
OBS_API_URL=
-OBS_OSCRC_PATH=
-OBS_USERNAME=
+OBS_API_USERNAME=
+OBS_API_PASSWD=
+#Gerrit related parameters
GERRIT_USERNAME=
GERRIT_HOSTNAME=
-GERRIT_SSHPORT=
+GERRIT_SSHPORT=29418
+#Host name of smtp server
SMTP_SERVER=
-NOREPLY_EMAIL_SENDER=
+#The name displayed in mail for jenkins usage
+NOREPLY_EMAIL_SENDER=noreply@tizen.org
+#Mailinglist which jenkins will send SR notification to it
MAILINGLIST=
+#Name of gerrit project to maintain git-obs-mapping and rpmlint-config
MAPPING_PRJ=scm/git-obs-mapping
RPMLINT_PRJ=scm/rpmlint-config
+
+#Jenkins local dir to cache git tree. Recommend use ${Jenkins_home}/git
+GIT_CACHE_DIR=/var/lib/jenkins/git/
diff --git a/jobs/BuildCheck/config.xml b/jobs/delete-tag/config.xml
similarity index 55%
rename from jobs/BuildCheck/config.xml
rename to jobs/delete-tag/config.xml
index 268fe87..2a012ba 100644
--- a/jobs/BuildCheck/config.xml
+++ b/jobs/delete-tag/config.xml
@@ -1,15 +1,19 @@
- Do Build check when a change is created in gerrit
+ This job will delete all tags attach to commit, which is abandoned or overwritten in gerrit.
- -1
- 20
+ 15
+ -1
-1
-1
false
-
+
+
+ 100
+
+
true
false
@@ -30,23 +34,29 @@
+
+ false
+ false
+ false
+ false
+
true
true
- true
- false
- false
- false
- false
- false
- false
+ false
- {}
- {}
- {}
- 0
+
+
+
+
+
+
+
+ false
+
+
true
@@ -55,31 +65,17 @@
#!/bin/bash
set -x
-python ${JENKINS_HOME}/jenkins-scripts/job_buildcheck.py
-
+${JENKINS_HOME}/jenkins-scripts/job_deletetag.sh
-
-
-
-
-
-
- ${BUILD_TAG}.env
-
-
- mail_sender,
- FAILED
- false
-
-
-
-
+
+
+ false
+
${JENKINS_HOME}/jobs/configuration
- GIT_CACHE_DIR=${JENKINS_HOME}/git
false
diff --git a/jobs/image-creator/config.xml b/jobs/image-creator/config.xml
new file mode 100644
index 0000000..917d96d
--- /dev/null
+++ b/jobs/image-creator/config.xml
@@ -0,0 +1,55 @@
+
+
+
+
+ false
+
+
+ 100
+
+
+
+ imager
+ false
+ false
+ false
+ false
+
+ false
+
+
+ #/bin/bash
+
+python jenkins-scripts/job_imager.py
+
+
+
+
+ if( manager.logContains("Info: Finished.*")){
+// def matcher2 = manager.getMatcher(manager.build.logFile, ".*home:/hudson:/(.*)/images.*")
+ manager.addBadge("success.gif", "") // matcher2.group(1))
+
+}else{
+ manager.addShortText("??")
+ //manager.build.delete()
+}
+ 0
+
+
+
+
+ configuration, jenkins-scripts/job_imager.py, jenkins-scripts/common/*, jenkins-scripts/repomaker/*, jenkins-scripts/images/*
+
+ false
+ false
+ false
+ userContent
+
+
+
+ ${WORKSPACE}/configuration
+ false
+
+
+
+
\ No newline at end of file
diff --git a/jobs/mail_sender/config.xml b/jobs/mail_sender/config.xml
index 0d7c703..49c5834 100644
--- a/jobs/mail_sender/config.xml
+++ b/jobs/mail_sender/config.xml
@@ -1,12 +1,22 @@
-
+ This job will be triggered by others to send out email.
+
+ 7
+ -1
+ -1
+ -1
+
false
-
+
+
+ 100
+
+
true
- false
+ true
false
false
diff --git a/jobs/obs-event-dispatcher/config.xml b/jobs/obs-event-dispatcher/config.xml
new file mode 100644
index 0000000..01c6124
--- /dev/null
+++ b/jobs/obs-event-dispatcher/config.xml
@@ -0,0 +1,129 @@
+
+
+
+
+ false
+
+
+ 100
+
+
+
+
+ event_type
+
+
+
+
+ project
+
+
+
+
+ para
+
+
+
+
+
+
+
+ true
+ false
+ false
+ false
+
+ true
+
+
+ #!/bin/bash
+
+python ${JENKINS_HOME}/jenkins-scripts/job_jobs_dispatcher.py
+
+
+
+
+
+
+
+ OBS_REPO_PUBLISHED.env
+
+
+ pre-release-create
+ ALWAYS
+ false
+ false
+
+
+
+
+
+
+
+
+
+ OBS_SRCSRV_REQUEST_*.env
+
+
+ requests
+ ALWAYS
+ false
+ false
+
+
+
+
+
+
+
+
+
+ OBS_REPO_PUBLISH_STATE.env
+
+
+ BuildCheck
+ ALWAYS
+ false
+ false
+
+
+
+
+
+
+
+
+
+ OBS_SRCSRV_REQUEST_STATECHANGE.env
+
+
+ pre-release-cleanup
+ ALWAYS
+ false
+ false
+
+
+
+
+
+
+ def matcher_trigger = manager.getLogMatcher(".*LOG:TRIGGER_NEXT:([^ ]*).*")
+if(matcher_trigger?.matches()) {
+ manager.addShortText(matcher_trigger.group(1))
+}//else{
+ //manager.build.delete()
+
+//}
+ 0
+
+
+ false
+ false
+
+
+
+
+ false
+
+
+
\ No newline at end of file
diff --git a/jobs/PolicyCheck/config.xml b/jobs/policy-check/config.xml
similarity index 59%
rename from jobs/PolicyCheck/config.xml
rename to jobs/policy-check/config.xml
index 25376e0..06aa11a 100644
--- a/jobs/PolicyCheck/config.xml
+++ b/jobs/policy-check/config.xml
@@ -1,9 +1,19 @@
- Do policy check when a change is created in gerrit
+ This job will do policy check, like rpmlint check and build check, when a change is created in gerrit.
+
+ 15
+ -1
+ -1
+ -1
+
false
-
+
+
+ 100
+
+
true
false
@@ -24,23 +34,28 @@
+
+ false
+ false
+ false
+ false
+
true
true
- true
- false
- false
- false
- false
- false
- false
+ false
- {}
- {}
- {}
- 0
+
+
+
+
+
+
+ false
+
+
true
@@ -54,10 +69,12 @@ python ${JENKINS_HOME}/jenkins-scripts/job_policycheck.py
+
+ false
+
${JENKINS_HOME}/jobs/configuration
- GIT_CACHE_DIR=${JENKINS_HOME}/git
false
diff --git a/jobs/pre-release-cleanup/config.xml b/jobs/pre-release-cleanup/config.xml
new file mode 100644
index 0000000..e4fe46c
--- /dev/null
+++ b/jobs/pre-release-cleanup/config.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+ -1
+ 1000
+ -1
+ -1
+
+ false
+
+
+ 100
+
+
+
+ 0
+ download
+ false
+ false
+ false
+ false
+
+ false
+
+
+ #!/bin/bash
+
+python ${WORKSPACE}/jenkins-scripts/job_pre_release_obs.py cleanup
+
+
+
+
+ def matcher = manager.getMatcher(manager.build.logFile, "home:hudson:prerelease:(.*)")
+if(matcher?.matches()) {
+ manager.addShortText(matcher.group(1))
+}else{
+ manager.addShortText("??")
+ //manager.build.delete()
+}
+ 0
+
+
+
+
+ false
+
+
+ configuration, jenkins-scripts/job_pre_release_obs.py, jenkins-scripts/common/*, jenkins-scripts/testprojects/*, jenkins-scripts/gitbuildsys/*
+
+ false
+ false
+ false
+ userContent
+
+
+
+ ${WORKSPACE}/configuration
+ false
+
+
+
+
\ No newline at end of file
diff --git a/jobs/pre-release-create/config.xml b/jobs/pre-release-create/config.xml
new file mode 100644
index 0000000..d40d951
--- /dev/null
+++ b/jobs/pre-release-create/config.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+ -1
+ 1000
+ -1
+ -1
+
+ false
+
+
+ 100
+
+
+
+ 0
+ download
+ false
+ false
+ false
+ false
+
+ false
+
+
+ #/bin/bash
+
+python jenkins-scripts/job_pre_release_obs.py create_images
+
+
+
+
+
+
+
+
+
+ image_trigger_*.env
+
+
+ image-creator
+ ALWAYS
+ false
+ false
+
+
+
+
+
+
+ def matcher = manager.getMatcher(manager.build.logFile, "home:hudson:prerelease:(.*)")
+if(matcher?.matches()) {
+ manager.addShortText(matcher.group(1))
+}else{
+ manager.addShortText("??")
+ //manager.build.delete()
+}
+ 0
+
+
+
+
+ false
+
+
+ configuration, jenkins-scripts/job_pre_release_obs.py, jenkins-scripts/common/*, jenkins-scripts/testprojects/*, jenkins-scripts/gitbuildsys/*
+
+ false
+ false
+ false
+ userContent
+
+
+
+ ${WORKSPACE}/configuration
+ false
+
+
+
+
\ No newline at end of file
diff --git a/jobs/pre-release-gerrit/config.xml b/jobs/pre-release-gerrit/config.xml
new file mode 100644
index 0000000..cb1399a
--- /dev/null
+++ b/jobs/pre-release-gerrit/config.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+ -1
+ 189
+ -1
+ -1
+
+ false
+
+
+ 100
+
+
+
+ true
+ false
+ false
+ false
+
+
+
+
+
+ ANT
+ **
+
+
+ ANT
+ refs/tags/submit/**
+
+
+
+
+
+ false
+ false
+ false
+ false
+
+ false
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+ false
+
+
+ #!/bin/bash
+export
+set |grep GERRIT_
+python ${JENKINS_HOME}/jenkins-scripts/job_pre_release_gerrit.py
+
+
+
+
+
+ 0
+
+
+
+
+ false
+
+
+
+ ${JENKINS_HOME}/jobs/configuration
+ MAPPING_PROJECTS=scm/git-obs-mapping
+ false
+
+
+
+
\ No newline at end of file
diff --git a/jobs/requests/config.xml b/jobs/requests/config.xml
index 392dd6d..891dfed 100644
--- a/jobs/requests/config.xml
+++ b/jobs/requests/config.xml
@@ -3,7 +3,11 @@
false
-
+
+
+ 100
+
+
true
false
@@ -26,6 +30,12 @@
{ "fields": { "obsEvent": { "type": "OBS_SRCSRV_REQUEST_CREATE" } } };
+ 127.0.0.1
+ 5672
+ boss
+ boss
+ boss
+ requests
LOGGING_NONE
@@ -54,6 +64,9 @@ python ${JENKINS_HOME}/jenkins-scripts/job_request.py
+
+ false
+
${JENKINS_HOME}/jobs/configuration
@@ -64,4 +77,4 @@ EMAIL_TEMPLATES_DIR=${JENKINS_HOME}/jenkins-scripts/requests/email_templates/
-
+
\ No newline at end of file
diff --git a/jobs/ruote_workitems/config.xml b/jobs/ruote_workitems/config.xml
deleted file mode 100644
index b12eb4a..0000000
--- a/jobs/ruote_workitems/config.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
- false
-
-
- true
- false
- false
- false
-
-
-
-
-
- REG_EXP
- { "fields": { "obsEvent": { "type": "OBS_SRCSRV_REQUEST_.*" } } };
-
-
- PLAIN
- { "fields": { "obsEvent": { "type": "OBS_REPO_PUBLISHED" } } };
-
-
- PLAIN
- { "fields": { "obsEvent": { "type": "OBS_BUILD_SUCCESS" } } };
-
-
- LOGGING_NONE
-
-
- false
-
-
- #!/bin/bash
-set -x
-
-python ${JENKINS_HOME}/jenkins-scripts/job_obsevent_dispatcher.py
-
-
-
-
-
-
- # which queue to dispatch to if received a request event
-REQUESTS_QUEUE_NAME = requests
-
-# which queue to dispatch to if received a repo published event
-REPOMAKER_QUEUE_NAME = repomaker
-
-# which queue to dispatch to if received a build success event
-BUILD_STATUS_QUEUE_NAME = build_status
-
- false
-
-
-
-
diff --git a/jobs/SubmitToOBS/config.xml b/jobs/submit-obs/config.xml
similarity index 61%
rename from jobs/SubmitToOBS/config.xml
rename to jobs/submit-obs/config.xml
index 34baaea..7db4b6e 100644
--- a/jobs/SubmitToOBS/config.xml
+++ b/jobs/submit-obs/config.xml
@@ -2,8 +2,18 @@
This script will submit a merged change to corresponding OBS staging project. If necessary, create SR to request merge to target OBS project.
+
+ 30
+ -1
+ -1
+ -1
+
false
-
+
+
+ 101
+
+
true
false
@@ -24,23 +34,29 @@
+
+ false
+ false
+ false
+ false
+
true
true
- false
- true
- true
- false
- false
- false
- false
+ false
- {}
- {}
- {}
- 0
+
+
+
+
+
+
+
+ false
+
+
false
@@ -53,6 +69,13 @@ python ${JENKINS_HOME}/jenkins-scripts/job_submitobs.py
+
+ def matcher = manager.getMatcher(manager.build.logFile, ".*Request URL:([^\"]*).*")
+if(matcher?.matches()) {
+ manager.addShortText("<a href=\"${matcher.group(1)}\">${matcher.group(1)}</a>")
+}
+ 0
+
@@ -69,10 +92,12 @@ python ${JENKINS_HOME}/jenkins-scripts/job_submitobs.py
+
+ false
+
${JENKINS_HOME}/jobs/configuration
- GIT_CACHE_DIR=${JENKINS_HOME}/git
false
--
2.7.4