services/jenkins-scripts.git
10 years agoImproved error handling in job_mail_sender
Ed Bartosh [Mon, 14 Oct 2013 11:57:57 +0000 (14:57 +0300)]
Improved error handling in job_mail_sender

Now jobs performs sanity check for configuration parameters and returns
1 if it fails.

Fixes: #1225

Change-Id: I4c7223589ec601f22b1675f75dacaa1388e05c33
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoCreated Snapshot and Prerelease classes
Ed Bartosh [Mon, 14 Oct 2013 11:46:31 +0000 (14:46 +0300)]
Created Snapshot and Prerelease classes

Snapshot and Prerelease classes provide simple OO interface to Snapshot
and Prerelease metadata. Previously get_repo_data function was used, but
it was hard to read and snapshot and prerelease data was mixed there.
That complexity was the first reason to replace it with Snapshot and
Prerelease classes.

Another reason was snapshot increment. It would be quite hard to
implement it using functions. Object oriented approach makes it simpler
to implement and more readable.

Change-Id: I1f77e3de047cd6666df30a3f40040115a9554b1f
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFixed typo in method name
Ed Bartosh [Mon, 14 Oct 2013 11:44:22 +0000 (14:44 +0300)]
Fixed typo in method name

mailer.py: Using get method: req.req -> req.get

Change-Id: Ia53384e1af4bb2b346ffac051495b69b52b8f172
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoSupport multiply levels branch name in submit tag
Lin Yang [Mon, 14 Oct 2013 07:34:29 +0000 (15:34 +0800)]
Support multiply levels branch name in submit tag

Branch name maybe contain '/', like devel/efl. Originly, submission with tag
submit/devel/efl/20131009.205635 is treated as
submit branch: devel date: efl/20131009.205635 instead of
submit branch: devel/efl date:20131009.205635.

Fixes: #1378

Change-Id: I57abe3cf1022535ff7e77bf7cefd88a198ce262f
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoIgnore the project delete event for non-prerelease project
Hasan Wan [Fri, 11 Oct 2013 03:32:53 +0000 (06:32 +0300)]
Ignore the project delete event for non-prerelease project

Fixes: #1338

Change-Id: I10bb70260a4f04ce0cd38e69bd8759024e67d965
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
10 years agoIsolated job_submitobs to separate package
Ed Bartosh [Sun, 6 Oct 2013 17:21:09 +0000 (20:21 +0300)]
Isolated job_submitobs to separate package

This change resolves conflicting runtime dependencies:

jenkins-scripts-tzs -> jenkins-scripts-common(with job_submitobs) -> gbs
-> depanneur -> modified build and obs-server -> build

The reason of the conflict is that jenkins-scripts-tzs package has to be
installed on the same host as obs-server because tzs appliance is one
computer with all services(Jenkins, OBS, Gerrit) installed on it.

So, job_submitobs should be removed from -common to avoid conflicts
between our modified build and non-modified build, required by
obs-server.

This complicated packaging issue can be resolved by moving job_submitobs
to separate package jenkins-scripts-submitobs.

This is funny in a sense that jenkins-scripts doesn't require gbs build
functionality, which depends on depanneur and build.

Note that this is temporary solution. There are at least 2 solutions to
this issue:

1. Upgrade our build package to the version, required by obs-server
(also temporary until the time when OBS depends on newer build)

2. - Move gbs remotebuild API to separate package
   - Add dependency to gbs-remotebuid to jenkins-scripts
   - Use gbs export and gbs remotebuild API in jenkinkins scripts
   - Move job_sumbitobs back to jenkins-scripts-common

Even better would be to start using gbs service instead of gbs export in
job_submitobs. gbs remotebuild is still required, but gbs export is not
required in this case.

Change-Id: I0395e69000bc5695546c719a020cacf2bb77c3bc
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoAdded tzs appliance package
Ed Bartosh [Sun, 6 Oct 2013 16:47:17 +0000 (19:47 +0300)]
Added tzs appliance package

Added jenkins-scripts-tzs binary package. Moved scripts, used in
jenkins-scripts and jenkins-scripts-tzs to -common.

Change-Id: I526884d4ff39147c536e14deeb6ecaa4a918c2ce
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoImplemented job_create_snapshot
Ed Bartosh [Fri, 4 Oct 2013 09:11:29 +0000 (12:11 +0300)]
Implemented job_create_snapshot

Job converts live OBS repo to snapshot repo, extracts .ks files from it
and triggers images creation.

This job is a next step towards replacing repomaker. It does the same as
boss-participant-repomaker.

Change-Id: Ibfc684123acc159821e8485451f9b7b546d2b232
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFixed mistake in constructing snapshot_path
Ed Bartosh [Wed, 2 Oct 2013 10:31:35 +0000 (13:31 +0300)]
Fixed mistake in constructing snapshot_path

Fixed snapshot path generation. Repomaker now makes repo in the right
location.

Change-Id: I59ff093d02fab32d5ee98346bb1ebb4808314b13
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agojob_submit: Check if target project exists
Ed Bartosh [Tue, 1 Oct 2013 13:38:50 +0000 (16:38 +0300)]
job_submit: Check if target project exists

In snapshot mode there is no need for all target projects to exist. If
some of the projects don't exist job_submit should still be able to
submit to those projects, which exist.

In applience mode it's even more important as applience usually has only
one target project in OBS.

Change-Id: I1aee31688434a441dfa11fb9e2a0c6b55c8c04e5
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoAdded snapshot_dir to get_repo_data's return value
Ed Bartosh [Mon, 30 Sep 2013 10:40:25 +0000 (13:40 +0300)]
Added snapshot_dir to get_repo_data's return value

This field will be used by snapshot creation functionality. As
get_repo_data used in 2 places: snapshot creation and prerelease, it
should return all values used in both workflows.

Change-Id: I967ce538b5a7811bd3acf356c8249bd73bc5587a
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoMoved get_prerelease_data function
Ed Bartosh [Fri, 27 Sep 2013 14:05:53 +0000 (17:05 +0300)]
Moved get_prerelease_data function

Moved get_prerelease_data from job_pre_release_obs to common/repoutils
and renamed it to get_repo_data. The reason of this move is that this
API will be used in snapshot creation functionality, i.e. will be called
from 2 job_ scripts.

Change-Id: Ia2976f6ccf799eea1fa626b5a48c32125dd536e6
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoCreated job_submit out of job_pre_release_gerrit
Ed Bartosh [Tue, 24 Sep 2013 11:40:30 +0000 (14:40 +0300)]
Created job_submit out of job_pre_release_gerrit

job_sumbit can be run in two modes: prerelease and snapshot. In
prerelease mode it does the same as job_pre_release_gerrit was doing. In
snapshot mode it uploads package straight to target project.

Change-Id: I6714070654cd3f1196b112e3970e39e7aa77371e
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFixed wrong field name in requests/mailer code
Ed Bartosh [Fri, 4 Oct 2013 09:43:07 +0000 (12:43 +0300)]
Fixed wrong field name in requests/mailer code

Event, which comes from OBS doesn't have 'type' field. 'event_type'
should be used.

Looks like this code has never been tested and as a result caused
serious production issue: all email notifications have been lost.

Fixes: #1360

Change-Id: Ie73949d4d270219ee2261597b2418ec1a3a8b806
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFixed KeyError crash in mailer.py
Ed Bartosh [Fri, 4 Oct 2013 09:38:01 +0000 (12:38 +0300)]
Fixed KeyError crash in mailer.py

Looks like event, which comes from obs plugin doesn't have
'origintype' field.

====Notify the tag owner====================================
Traceback (most recent call last):
  File "/srv/jenkins/jenkins-scripts/job_request.py", line 315, in <module>
    sys.exit(main())
  File "/srv/jenkins/jenkins-scripts/job_request.py", line 282, in main
    notify_submiter(event_fields, data)
  File "/srv/jenkins/jenkins-scripts/job_request.py", line 261, in notify_submiter
    os.getenv('EMAIL_TEMPLATES_DIR'))
  File "/srv/jenkins/jenkins-scripts/requests/mailer.py", line 238, in mailer
    if not tri['cond'] or tri['cond'](_bs, request):
  File "/srv/jenkins/jenkins-scripts/requests/mailer.py", line 58, in <lambda>
    'cond':  lambda bs, req: req['origintype'] == 'change_devel',
KeyError: 'origintype'

Change-Id: I28f3866c3b37b7782576c9e613c8904050053526

10 years agoMoved delete_package call after pushing accepted tag
Ed Bartosh [Wed, 2 Oct 2013 15:34:17 +0000 (18:34 +0300)]
Moved delete_package call after pushing accepted tag

request_accepted funcion deletes package from OBS before making and
pushing accepted tag. As OBS operations can cause unexpected errors
it's better to delete project after making a tag. Another point is
that making a tag is more important and anything, which can prevent
this operation should be done after it.

Change-Id: I1199738a88adca26f293909645cd736b71637cf3
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoCheck if package exists before deleting it
Ed Bartosh [Wed, 2 Oct 2013 15:26:19 +0000 (18:26 +0300)]
Check if package exists before deleting it

job_request tries to delete package from source project when request
is accepted, rejected or revoked. However, in OBS 2.4 this is done by
OBS and package doesn't exist. It caused this traceback in production:
Traceback (most recent call last):
  File "/srv/jenkins/jenkins-scripts/job_request.py", line 313, in <module>
    sys.exit(main())
  File "/srv/jenkins/jenkins-scripts/job_request.py", line 306, in main
    request_accepted(data, gerrit, gitprj)
  File "/srv/jenkins/jenkins-scripts/job_request.py", line 161, in request_accepted
    delete_package(data['OBS_REQ_PRJ_SRC'], data['OBS_REQ_PKG_SRC'])
  File "/srv/jenkins/jenkins-scripts/job_request.py", line 136, in delete_package
    _bs.delete_package(prj, pkg)
  File "/srv/jenkins/jenkins-scripts/common/buildservice.py", line 383, in delete_package
    core.delete_package(self.apiurl, project, package)
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 4697, in delete_package
    http_DELETE(u)
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 2924, in http_DELETE
    def http_DELETE(*args, **kwargs): return http_request('DELETE', *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/osc/core.py", line 2909, in http_request
    fd = urllib2.urlopen(req, data=data)
  File "/usr/lib64/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/usr/lib64/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.7/urllib2.py", line 432, in error
    result = self._call_chain(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 884, in http_error_401
    url, req, headers)
  File "/usr/lib64/python2.7/urllib2.py", line 859, in http_error_auth_reqed
    response = self.retry_http_basic_auth(host, req, realm)
  File "/usr/lib64/python2.7/urllib2.py", line 872, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/usr/lib64/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.7/urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

Change-Id: I2a6b56ba40feecf83eeabb59169ae19b835231d7
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoConverted VM_CPUS and VM_MEMORY to int
Ed Bartosh [Wed, 2 Oct 2013 15:13:44 +0000 (18:13 +0300)]
Converted VM_CPUS and VM_MEMORY to int

When VM_CPUS and VM_MEMORY are taken from configuration file they have
to be converted to int to avoid this traceback:

Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/image-creator/workspace/jenkins-scripts/job_imager.py", line 142, in <module>
    sys.exit(main())
  File "/var/lib/jenkins/jobs/image-creator/workspace/jenkins-scripts/job_imager.py", line 94, in main
    os.getenv("VM_CPUS", 8), basedir)
  File "/var/lib/jenkins/jobs/image-creator/workspace/jenkins-scripts/job_imager.py", line 33, in run_inside_vm
    (vm_memory, vm_cpus, vm_image, basedir)
TypeError: %d format: a number is required, not str

Change-Id: Ib18cbd320f013e8b3d9075dadf22840131e07bc1
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFixed wrong config parameter
Ed Bartosh [Mon, 30 Sep 2013 15:09:29 +0000 (18:09 +0300)]
Fixed wrong config parameter

Job is failing because it uses REDIS_HOSTNAME config parameter instead
of REDIS_HOST. As REDIS_HOSTNAME does not exist job crashes this way:
Traceback (most recent call last):
  File "jenkins-scripts/job_load_repos.yaml.py", line 74, in <module>
    sys.exit(main())
  File "jenkins-scripts/job_load_repos.yaml.py", line 71, in main
    return load_repos(os.path.join(prjdir, 'repos.yaml'))
  File "jenkins-scripts/job_load_repos.yaml.py", line 26, in load_repos
    int(os.getenv('REDIS_PORT')))
  File "/srv/jenkins/jobs/load-repo-conf/workspace/jenkins-scripts/common/backenddb.py", line 141, in __init__
    self._redis.exists('anything')
  File "/usr/lib/python2.7/site-packages/redis/client.py", line 465, in exists
    return self.execute_command('EXISTS', name)
  File "/usr/lib/python2.7/site-packages/redis/client.py", line 334, in execute_command
    connection.send_command(*args)
  File "/usr/lib/python2.7/site-packages/redis/connection.py", line 287, in send_command
    self.send_packed_command(self.pack_command(*args))
  File "/usr/lib/python2.7/site-packages/redis/connection.py", line 269, in send_packed_command
    self.connect()
  File "/usr/lib/python2.7/site-packages/redis/connection.py", line 214, in connect
    sock = self._connect()
  File "/usr/lib/python2.7/site-packages/redis/connection.py", line 226, in _connect
    sock.connect((self.host, self.port))
  File "/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
TypeError: coercing to Unicode: need string or buffer, NoneType found

Fixes: #1355

Change-Id: I37a60fc7b960301fe06b1cc1efc45189c471c532
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFix the issue of parse commit a tag point to test-tzs-appliance
Lin Yang [Tue, 24 Sep 2013 08:08:48 +0000 (16:08 +0800)]
Fix the issue of parse commit a tag point to

When use 'git rev-parse' to parse the commit a tag point to, it should add
^{commit} after tag name, otherwise git will return the tag SHA1.

Change-Id: I0791f96350b01b458417fcbc27f14b58b79c5742
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoPush accepted commit to refs/heads/accepted/*
Lin Yang [Tue, 24 Sep 2013 07:49:01 +0000 (15:49 +0800)]
Push accepted commit to refs/heads/accepted/*

To use "accepted" branches as default ref in generic manifests, push accepted
commit to specific hierarchy refs/heads/accepted/* when sr accepted to specific
project.
E.g. package accepted to Tizen:Mobile should push to branch
refs/heads/accepted/tizen/mobile.

Fixes: #1345

Change-Id: I204ffb137210f4f1b6753ee152f9f0ab3fa1c88b
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
10 years agoRepomaker: Check out wrong output archs
Ed Bartosh [Mon, 23 Sep 2013 12:40:53 +0000 (15:40 +0300)]
Repomaker: Check out wrong output archs

Check if architectures, provided to repomaker are valid ones, i.e. they
don't need to be mapped. For example, in current code i586 and i686
architectures are mapped to ia32, so both of them are not valid output
directories and repomaker throws exception if they're found in the list
of output architectures.

Change-Id: I4bee1f172f73550784e8153eaadad2b5a4626550
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFixed Tester builds of Ref Updated events
Ed Bartosh [Mon, 23 Sep 2013 12:00:03 +0000 (15:00 +0300)]
Fixed Tester builds of Ref Updated events

Added OBS and Jenkins repos to packaging/.extra-repos to fix
installation issues. This package doesn't depend on OBS, but it needs
this fix because Tester installs all packages from target repo on
RefUpdate events.

This is a first commit of this kind. The only way to test it is to
accept it and see if Tester succeeds. If it is then similar fixes should
be committed to the rest of packages.

Change-Id: Ifb3b18936406b893dce553ee5741ce51079b7272
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoStarted work for 0.15
Ed Bartosh [Mon, 23 Sep 2013 11:01:41 +0000 (14:01 +0300)]
Started work for 0.15

Updated version and .changes

Change-Id: I0eaef25f07c14161405cf37f99fe13210212cec6
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoRelease 0.14
Ed Bartosh [Mon, 23 Sep 2013 10:53:11 +0000 (13:53 +0300)]
Release 0.14

Changed versioning. Updated changelog.

Change-Id: Id26c2fe43cf246746a0970e3f401ffae8d52088b
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoSkip packages for not specified architectures
Ed Bartosh [Sun, 22 Sep 2013 12:23:46 +0000 (15:23 +0300)]
Skip packages for not specified architectures

Output architectures are passed to repomaker API from caller. Packages
with not specified architectures should not go to output repository.

Change-Id: I370e1c67542ebda45a5185b50569821d37f0ac61
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoAdded i686 packages to the repomaker test
Ed Bartosh [Sun, 22 Sep 2013 11:57:01 +0000 (14:57 +0300)]
Added i686 packages to the repomaker test

Thanks Qiang for this suggestion. Adding i686 packages improves the test
in a way that 2 mapped architectures(i586 and i686) are tested.

Change-Id: Ib32255520fdca733082f8779c3c5eb60ebe54bc5
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFixed processing of architectures in repomaker
Ed Bartosh [Thu, 19 Sep 2013 08:14:19 +0000 (11:14 +0300)]
Fixed processing of architectures in repomaker

Repomaker was getting list of architectures analyzinng packages in the
incoming repository. If repository doesn't contain some architectures
those were skipped. This was a mistake. Now repomaker gets list of
architectures as a parameter and creates output repos for all
architectures even if no packages found in incoming repo for some of
them.

Fixes: #1324

Change-Id: I2e4fa4df61ae1fcaa64d0792648391493c962001
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoOptimize updating git repo logic
Lingchaox Xin [Tue, 17 Sep 2013 05:33:49 +0000 (13:33 +0800)]
Optimize updating git repo logic

Change-Id: I3ed80bba2536a008bd225ffabb0b90094209a40a

10 years agoRenamed mic-seed to mic-appliance
Ed Bartosh [Mon, 16 Sep 2013 08:47:46 +0000 (11:47 +0300)]
Renamed mic-seed to mic-appliance

Mic-seed is less informative and straightforward name from my point of
view. It explains better what this image is for.

Change-Id: I1fae68d0fb2271c7ecd619865cb19bfa963b2064
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoRepomaker: consider noarch when collect packages
Ed Bartosh [Mon, 16 Sep 2013 21:09:45 +0000 (00:09 +0300)]
Repomaker: consider noarch when collect packages

When repomaker collects packages from live repository it should also
consider noarch packages.

Currently it skips noarch/ directories. If submission also contains
architecture-dependent packages noarch packages just silently skipped.
However, when submission contains only noarch packages then nothing is
copied and this causes image creation failure. We were 'lucky' that
submissions we've tested didn't contain noarch packages. That's why we
didn't notice this bug.

This is a serious bug and requires to be fixed also in pre_release_obs
code, where only binary architectures are processed.

This changes fixes only repomaker. With this fix repomaker is able to
collect noarch packages.

This change partly fixes issue 1324.

Change-Id: Iba6f978ef2207aa9562f4e46c1bc596142f73ef4
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
10 years agoFix updating issue when given remote url diffs origin
Lingchaox Xin [Mon, 16 Sep 2013 09:29:11 +0000 (17:29 +0800)]
Fix updating issue when given remote url diffs origin

Change-Id: Ied117af83bb4d654d03efee856f1276bbcb85f1c
Reviewed-on: https://otctools.jf.intel.com/review/6465
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoUpdate git bare repository with a graceful way
Lingchaox Xin [Fri, 13 Sep 2013 07:09:30 +0000 (15:09 +0800)]
Update git bare repository with a graceful way

Generally, `git fetch --all` will not synchronize local branches to
remote ones util maps local branches of the source to local branches of the
target. `git fetch --all` combined with `git clone --mirror`will end
this.

Change-Id: Ie799cfbf67a847b1ded54a6390844f9acd3ae342
Reviewed-on: https://otctools.jf.intel.com/review/6422
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoFix a mistake in f9a73b64c45fc9f97fb59f76f666ca8dfaecf6b0
Hasan Wan [Mon, 16 Sep 2013 07:39:38 +0000 (10:39 +0300)]
Fix a mistake in f9a73b64c45fc9f97fb59f76f666ca8dfaecf6b0

Change-Id: I011c49f2e0f6933c35c05378e705f4e2355b03a9
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6455
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoFlush stdout to make Jenkins console output better
Ed Bartosh [Sun, 15 Sep 2013 14:59:13 +0000 (17:59 +0300)]
Flush stdout to make Jenkins console output better

Without flushing output of job_imager.py comes to jenkins build
console after output of mic appliance. Flushing helps to bring output
back to chronological order.

Change-Id: I3714f172874b2b583554a51ffaf5ed11e2dbf349
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6440
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
10 years agoSet permissions after running mic appliance
Ed Bartosh [Sun, 15 Sep 2013 13:40:31 +0000 (16:40 +0300)]
Set permissions after running mic appliance

Due to the bug in Plan9 driver or in qemu permissions of files and
directories on plan9 share are set only for owner(jenkins in our case).
This makes mic/output/* unreadable after directory is rsynced to
download server. Apache raises 403 Forbidden error when
post-image-creation job tries to access build results.

Fixes: #1206

Change-Id: Id723d7323452c7d6ea4df1f131f1498351a78eb2
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6439
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
10 years agoAdd --release option to mic command line
Ed Bartosh [Sun, 15 Sep 2013 13:18:04 +0000 (16:18 +0300)]
Add --release option to mic command line

Rsync expects output results in mic/out/<build number>. Mic creates
<build number> subdirectory only when --release option is provided.

Adding extra command line options implementeed in mic appliance. Now
it's possible to provide additional options for mic in mic/out/command
file. This trick is utilized in this change.
job_imager puts '--release <build number>' to mic/out/command and mic
inside mic appliance uses it.

Change-Id: I2b83474fdacd59b9a9ff9e5c83f7ab9100e51513
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6438
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Lin A Yang <lin.a.yang@intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
10 years agoConvert the repos.yaml to adapt BOSS
Hasan Wan [Mon, 16 Sep 2013 06:16:54 +0000 (09:16 +0300)]
Convert the repos.yaml to adapt BOSS

Fixes: #1304

Change-Id: I581b835b481f15e4ba74852e88a690d7f57462bf
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6451
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoReplaced pre-release with prerelease
Ed Bartosh [Sun, 15 Sep 2013 15:35:17 +0000 (18:35 +0300)]
Replaced pre-release with prerelease

According to http://dictionary.reference.com/,
http://www.thefreedictionary.com/ and other sources of information
pre-release is incorrect word. Prerelease(without '-') should be used
instead.

Change-Id: If763bd0aea0f259a847e7b66aeba7b966633f468
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6441
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
10 years agoRe-create mic output directory
Ed Bartosh [Sun, 15 Sep 2013 13:08:19 +0000 (16:08 +0300)]
Re-create mic output directory

mic/outupt is recreated to ensure that no leftovers present there from
previous build. Workspace cleanup plugin does not always cleanup
workspaces, so it's better to double check.

Change-Id: I68eb435f2c2035f939799f415f87d439ee4e35f6
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6437
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
10 years agoRun qemu in snapshot mode to avoid unpacking
Ed Bartosh [Sun, 15 Sep 2013 13:01:08 +0000 (16:01 +0300)]
Run qemu in snapshot mode to avoid unpacking

Snapshot mode allows us to use the same mic-seed in multiple qemu
sessions as changes in snapshot mode go to snapshot. This saves time
and resouces as untarring is not needed anymore.

Change-Id: I5eced1439ea310e8d7cc025e7a8d82c1d221e9fa
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6436
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
10 years agoTrim the path defined in repos.yaml, update BOSS repos.yaml
Hasan Wan [Tue, 10 Sep 2013 08:27:24 +0000 (16:27 +0800)]
Trim the path defined in repos.yaml, update BOSS repos.yaml

Fixes: #1285

Change-Id: I54d364cf4b8013dc42b5388aa0b7b280add8ab6a
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6356
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoMake sure project exist in obs before submission
Lin Yang [Wed, 4 Sep 2013 03:34:58 +0000 (11:34 +0800)]
Make sure project exist in obs before submission

Before commit code to obs, it should check whether these target projects
specified in git-obs-mapping already exist in obs. If not, quit the submission.

Change-Id: I238cce10e04ad2b5ad7ea0348a823aa718074b67
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6123
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoOptimize job_jobs_dispatcher.py logic
Lingchaox Xin [Thu, 12 Sep 2013 08:20:18 +0000 (16:20 +0800)]
Optimize job_jobs_dispatcher.py logic

Change-Id: I81a64e371be77d3dfb2de182b4f624faa4c973c6
Reviewed-on: https://otctools.jf.intel.com/review/6405
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoSkip .ks file for invalid architectures
Ed Bartosh [Wed, 11 Sep 2013 14:26:02 +0000 (17:26 +0300)]
Skip .ks file for invalid architectures

If repository doesn't contain packages for the architecture .ks file
should be skipped from processing and image(s) should not be built for
those architectures.

Change-Id: I46447f3b7132192b62963c33f805b3057d85c185
Fixes: #1306
Reviewed-on: https://otctools.jf.intel.com/review/6390
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
10 years agoStop using --repo from .ks file
Ed Bartosh [Wed, 11 Sep 2013 14:19:36 +0000 (17:19 +0300)]
Stop using --repo from .ks file

Using --repo parameter from .ks file as a repository name is incorrect
as it doesn't point to the real repository. For example in
Tizen:Mobile porject it produces this crash:
    common.backenddb.EntityError: [Error] key repo:mobile don't exist in redis
because of --repo=mobile specified in .ks file.

The solution used in this change is to replace @BUILD_ID@ with the
current snapshot.

Fixes: #1305

Change-Id: Ic3b5b3a12b44167c48f2f8ad858629bc787a9011
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6389
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
10 years agoRemove unused script job_obsevent_dispatcher.py
Lin Yang [Tue, 10 Sep 2013 08:53:48 +0000 (16:53 +0800)]
Remove unused script job_obsevent_dispatcher.py

The new obs event dispatcher job already has been modified to call new script
job_jobs_dispatcher.py. So remove the old one.

Change-Id: Ie654e6d33625ad72b5bbf6c8bba959ac7c3f4836
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6360
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoFixed major pylint findings
Ed Bartosh [Tue, 10 Sep 2013 15:23:42 +0000 (18:23 +0300)]
Fixed major pylint findings

Change-Id: I37c39665292f32dfa03b89d787641c668dc18a4f
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6368
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
10 years agoMake error message more informative
Ed Bartosh [Tue, 10 Sep 2013 15:03:32 +0000 (18:03 +0300)]
Make error message more informative

job_pre_release_obs/make_repo: added snapshot directory path to the
error message.

Change-Id: Ia35a95b9dfdf3234dbaf1b91c15708dacadee091
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6367
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
10 years agoAdded check for required keys in Redis
Ed Bartosh [Tue, 10 Sep 2013 14:47:59 +0000 (17:47 +0300)]
Added check for required keys in Redis

job_pre_release_obs now checks for the required keys coming from
repos.yaml to Redis instead of crashing with KeyError exception.

Change-Id: I12544662d95bc63643bb51f2aa88bd478919299e
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6366
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
10 years agoImplemented running mic under VM
Ed Bartosh [Wed, 4 Sep 2013 17:39:50 +0000 (20:39 +0300)]
Implemented running mic under VM

If configuration variable USE_VM is set to 1 in jobs/configuration
job_imager will try to run qemu with -hda <mic seed image> and
accelerator choices: kvm:xen:tcg. It means that qemu will first try to
run image with kvm and then with xen if kvm is not found.

There are number of optional VM related parameters that can be set in
jobs/configuration: VM_IMAGE($JENKINS_HOME/mic-seed.tar by default),
VM_MEMORY(8Mb by default) and VM_CPUS(8 cpus by default).

mic appliance implemented in mic-seed expects configuration file in
mic/out directory. It will automatically run mic and put image and other
build results also into mic/out.

Fixes: #1146

Change-Id: I3a1fd07306372912a1909fd4774d06f5e8523f97
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6306
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
10 years agoSupport generate patches for all specfiles
Lin Yang [Thu, 5 Sep 2013 04:47:03 +0000 (12:47 +0800)]
Support generate patches for all specfiles

If specify one specfile when using gbs export, gbs will only generate patches
for this specfile. In multiply specfiles case, it will make other packages build
failed. So remove specify specfile when gbs export.

Fixes: #1276

Change-Id: I6f667a7545b2d9e9e51c6c242e7961a2dd2b390e
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6284
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoThe get_release_ids should be called
Hasan Wan [Wed, 4 Sep 2013 06:06:05 +0000 (09:06 +0300)]
The get_release_ids should be called

Fixes: #1210

Change-Id: I78ca734446ef4377e220f1b3c7767e1d3f261432
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6274
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoSet default attr of common package to jenkins
Lin Yang [Mon, 2 Sep 2013 06:15:05 +0000 (14:15 +0800)]
Set default attr of common package to jenkins

Change-Id: I89daee3c1e622a7e0a50e94aadaa3336a6437139
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6179
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoMove unnecessary modules out of common package
Lin Yang [Wed, 28 Aug 2013 07:52:40 +0000 (15:52 +0800)]
Move unnecessary modules out of common package

Several modules under common directory, like repomaker and builddata, are not
used by sync package, so remove them out of common package.

Fixes: #1129

Change-Id: I37aabcb5b17c696fe56d4cb350651c1809bf5c58
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6176
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoAdd pattern to control which project should be sync
Lin Yang [Tue, 27 Aug 2013 08:57:13 +0000 (16:57 +0800)]
Add pattern to control which project should be sync

In sync instance, it should control which project should be synced to inside
gerrit when receive a refupdate event. So add a re in jobs/configuration file,
script will read it and check.

Fixes: #1124

Change-Id: I68f6f49a71e7094096320f75f75f4614639f776a
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6148
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoFix `Can't update bare repository` bug
Lingchaox Xin [Mon, 26 Aug 2013 05:07:59 +0000 (13:07 +0800)]
Fix `Can't update bare repository` bug

Change-Id: I4a4b2bacf16c635e5724b1939db32de831727fe7
Reviewed-on: https://otctools.jf.intel.com/review/6113
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoAdded Tools repository to .extra-repos
Lin Yang [Wed, 28 Aug 2013 06:32:03 +0000 (14:32 +0800)]
Added Tools repository to .extra-repos

Add tools latest release repository to packaging/.extra-repos to provide tools,
like gbs and gbp, to match install dependency.

Change-Id: I4de7ad2619aebb8f4bd1fc31b0058f6056c3c2fe
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6170
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoMove git-obs-mapping parsing to default one
Lin Yang [Fri, 23 Aug 2013 05:05:14 +0000 (13:05 +0800)]
Move git-obs-mapping parsing to default one

Because the multiply mapping files support is not needed in near future, remove
that part and still parse git-obs-mapping from the default directory
{git_cache}/scm/git-obs-mapping.

Fixes: #1035

Change-Id: Id0ae32367184d404607658bbde1aae3932bfa608
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6086
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoRemove unnecessary parameter "bare"
Lin Yang [Thu, 22 Aug 2013 08:22:03 +0000 (16:22 +0800)]
Remove unnecessary parameter "bare"

When update local git cached repo, it should check whether local repo is bare,
not depend on the parameter.

Change-Id: I4370b039e399e9cb9796d0fbd503888f5488c552
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6068
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoRemove implicit modify dir name when git clone
Lin Yang [Thu, 22 Aug 2013 06:06:05 +0000 (14:06 +0800)]
Remove implicit modify dir name when git clone

It's not proper to implicitly modify the directory name caller specified when
clone code to this directory, so remove this part function.

Change-Id: Ia9d4ce1b1e7d1346ea7500448268a3f12794d9ca
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6050
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoRemove repositories and images when the project get deleted
Hasan Wan [Thu, 22 Aug 2013 06:25:17 +0000 (09:25 +0300)]
Remove repositories and images when the project get deleted

Fixes: #1193

Change-Id: I631793f87b457ca551b4221812774392a1d448fd
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6051
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoDo NOT create BuildService instance in for loop
Lingchaox Xin [Thu, 22 Aug 2013 03:05:03 +0000 (11:05 +0800)]
Do NOT create BuildService instance in for loop

Change-Id: Id702c71a08c1e0b83d0252d9f83fc10dd4d948c3
Reviewed-on: https://otctools.jf.intel.com/review/6048
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Lin A Yang <lin.a.yang@intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoUpdate job_pre_release_gerrit.py docstring
Lingchaox Xin [Wed, 21 Aug 2013 09:05:23 +0000 (17:05 +0800)]
Update job_pre_release_gerrit.py docstring

Change-Id: I86ea8baaeae19502d67f05722b715bd7f8a9b08b
Reviewed-on: https://otctools.jf.intel.com/review/6039
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
10 years agoRefactoring common/git.py since gbp git related changes
Lingchaox Xin [Wed, 21 Aug 2013 02:21:04 +0000 (10:21 +0800)]
Refactoring common/git.py since gbp git related changes

Change-Id: I64c4c978fc7c055b57184e5143680520017949a3
Reviewed-on: https://otctools.jf.intel.com/review/6028
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoFix the issue of messages posted to public
Hasan Wan [Tue, 20 Aug 2013 10:41:02 +0000 (13:41 +0300)]
Fix the issue of messages posted to public

Fixes: #1202

Change-Id: Ibb0bd5e5a01f55d1791adc97c63ff09a3299432d
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6010
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoStore pre-release images information into projet description
Hasan Wan [Mon, 19 Aug 2013 08:46:05 +0000 (11:46 +0300)]
Store pre-release images information into projet description

Fixes: #1179

Change-Id: Ie1b620d91d8f32150de1d54b098e7c2b85405c29
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5998
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoImplemented image creation for submit groups
Ed Bartosh [Sat, 17 Aug 2013 12:56:48 +0000 (15:56 +0300)]
Implemented image creation for submit groups

Fixes: #1189

Change-Id: If4f91ebf3907c9e52ff90e7ba89d7908a3490d08
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5985
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
10 years agoFix a require mistake
Hasan Wan [Fri, 16 Aug 2013 09:22:01 +0000 (12:22 +0300)]
Fix a require mistake

jenkins-scripts should exactly require jenkins-scripts-common in same release

Change-Id: Iaca126378b6d1caa6b5e6f6e0c4cd7f64aa58431
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5938
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agofix a typo in job_pre_release_gerrit
Hasan Wan [Fri, 16 Aug 2013 09:47:56 +0000 (12:47 +0300)]
fix a typo in job_pre_release_gerrit

Change-Id: I7a6ae4e0e98963fdb48ecb2fac68f8e312f5bc96
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5941
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoImprove feedback message about submit open change
Lin Yang [Fri, 16 Aug 2013 03:38:37 +0000 (11:38 +0800)]
Improve feedback message about submit open change

When developer submit an open change, give back a message to ask to re-trigger
submission after code passed review.

Fixes: #1184

Change-Id: I8ba1ead4e017144bb389a36adf47a33226b46716
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5929
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
Tested-by: Eduard Bartosh <eduard.bartosh@intel.com>
Conflicts:
job_submitobs.py

10 years agoAdd an arch compatible table to map different arch
Zhang Qiang [Thu, 15 Aug 2013 02:05:14 +0000 (10:05 +0800)]
Add an arch compatible table to map different arch
to one directory

Fixes: #1134

Change-Id: Ic0469470dedc3d21a3742ce8173ee6b8bcdbece0
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5903
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoClone project if it don't exist in git cache
Lin Yang [Thu, 15 Aug 2013 07:14:43 +0000 (15:14 +0800)]
Clone project if it don't exist in git cache

Generally when receive a request event, it means jenkins already handled this
project, and it should exist in git cache. But in exceptional case, git cache
don't contain such project, so clone it from remote to local workspace.

Change-Id: I292c8d028ef0277c761890c403b4f80fb7e049eb
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5907
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
Tested-by: Hasan Wan <hasan.wan@intel.com>
10 years agoFix miss gerrit project under git cache issue
Lin Yang [Thu, 15 Aug 2013 10:15:44 +0000 (18:15 +0800)]
Fix miss gerrit project under git cache issue

Because all git cache project have been changed to bare, add '.git' postfix to
fit the project path.

Change-Id: I77d8268ef0fff7feda81affccf75fcde53cc33ad
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5910
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoFix the inconsistency between project and desp, fix group submission
Hasan Wan [Tue, 13 Aug 2013 03:12:07 +0000 (06:12 +0300)]
Fix the inconsistency between project and desp, fix group submission
issues.

Fixes: #1135

Change-Id: Id4e1faf04bbeb298dae2ab26f46e1ab9b41d7ea5
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5870

10 years agoFix a potential error about git cache
Hasan Wan [Tue, 13 Aug 2013 02:27:36 +0000 (05:27 +0300)]
Fix a potential error about git cache

Fixes: #1145

Change-Id: I60c71c35ef21978695e38c16fb08b86977734835
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5857
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoFix protential error when creating pre-release project
Hasan Wan [Fri, 9 Aug 2013 05:55:54 +0000 (08:55 +0300)]
Fix protential error when creating pre-release project

Fixes: #1094

Change-Id: I14efb72930332600311294e212190b60b367f269
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5766
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoFix get_gerrit_event import error
Lingchaox Xin [Wed, 7 Aug 2013 07:45:21 +0000 (15:45 +0800)]
Fix get_gerrit_event import error

Change-Id: Ia85da46de9b7ab6e9e1e10100fd608b29f464a0d
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5791
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
10 years agoUpdate dependency of common package
Lin Yang [Mon, 5 Aug 2013 23:52:12 +0000 (07:52 +0800)]
Update dependency of common package

1. move gbs to common package dependency
2. remove createrepo from common package

Change-Id: I9a0abd296d092bb3725583475618392df55347a1
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5775
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
11 years agoImprove feedback message about no git commit issue
Lin Yang [Wed, 31 Jul 2013 02:19:32 +0000 (10:19 +0800)]
Improve feedback message about no git commit issue

Change-Id: Iced02e79f8a4d4a065aa7eff3df5dd65c8350b3f
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5701
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
11 years agoGet gerrit parent project name from global config
Lin Yang [Tue, 30 Jul 2013 07:10:09 +0000 (15:10 +0800)]
Get gerrit parent project name from global config

Change-Id: Ib29935ce9bdd38ef134b0b2724261edc7cdb4c3e
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5683

11 years agoAvoid use specific domain name in script
Lin Yang [Tue, 30 Jul 2013 07:40:44 +0000 (15:40 +0800)]
Avoid use specific domain name in script

Change-Id: Ib2616f80c50469be779140e2a7bd16e564aeabe9
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5687
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
Tested-by: Eduard Bartosh <eduard.bartosh@intel.com>
11 years agoDisable send out email if silent mode
Lin Yang [Tue, 30 Jul 2013 08:38:16 +0000 (16:38 +0800)]
Disable send out email if silent mode

Change-Id: I5f326efee984d9d5f932664c0d4511ca2b998074
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5693
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
11 years agoRemove source project check from script
Lin Yang [Tue, 30 Jul 2013 05:06:42 +0000 (13:06 +0800)]
Remove source project check from script

Which project will be synced to target gerrit should be control by
gerrit-trigger-plugins in job conf. No need to check it again.

Change-Id: I090b4ab1093077bd4e8a4821e583a271555bc791
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5680
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
11 years agoConvert global parameter GERRIT_SILENT_MODE to int
Lin Yang [Tue, 30 Jul 2013 04:43:10 +0000 (12:43 +0800)]
Convert global parameter GERRIT_SILENT_MODE to int

Because os.getenv will return string and current use 0 and 1 in configurations
to control this switch, we should convert it to int.

Change-Id: I2d68d2f188b53f476d05546c73fd07ab5608af42
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5679
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
11 years agoDelete duplicate sync git script
Lin Yang [Mon, 29 Jul 2013 04:44:36 +0000 (12:44 +0800)]
Delete duplicate sync git script

There should be no difference of sync git script between synctd and syncto
domain.

Change-Id: Ia950f2527af4691608c877af0974c064acdafc80
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5657
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
11 years agoAdded -synctd -syncto and -common binary packages
Ed Bartosh [Thu, 25 Jul 2013 22:51:33 +0000 (01:51 +0300)]
Added -synctd -syncto and -common binary packages

-synctd and --syncto are to be installed on tizendev and tizen.org
Jenkins instances. -common is to keep common APIs for all binary
packages.

Change-Id: I51256ef26f2c93ec4ca6381c2edd82752ebe64f8
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5635
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-by: Lin A Yang <lin.a.yang@intel.com>
11 years agorefined the notification msg for submission
JF Ding [Mon, 29 Jul 2013 02:01:46 +0000 (10:01 +0800)]
refined the notification msg for submission

according Anas' suggestion

Change-Id: I6d6eb4c23a70f9f8a90c32605c4aa629582f55fb
Reviewed-on: https://otctools.jf.intel.com/review/5654
Reviewed-by: Lin A Yang <lin.a.yang@intel.com>
Tested-by: Lin A Yang <lin.a.yang@intel.com>
11 years agoImplemented silent mode for gerrit review
Ed Bartosh [Fri, 26 Jul 2013 21:00:26 +0000 (00:00 +0300)]
Implemented silent mode for gerrit review

Added silent_mode parameter to Gerrit constructor. If silent_mode is
True gerrit review command is not called and review mark is not reported
back to Gerrit.

job_submitobs gets value of silent mode from GERRIT_SILENT_MODE
environment variable. This variable must be set in jobs/configuration
file for Jenkins instances, where reporting back to Gerrit is
prohibited.

Change-Id: I78a57885d3619eee01f48227bb6a299d3b1c8a06
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5651
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
11 years agoChanged pre-release project name
Ed Bartosh [Thu, 25 Jul 2013 18:31:14 +0000 (21:31 +0300)]
Changed pre-release project name

Included full tag name. Previously it was just a timestamp suffix.
Having full tag name would help RE to find tag more easy.

Change-Id: I106f4a474fcf50492cdff20a6c411a3c31930b23
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5629
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
11 years agoUsed mic directly in image-creator job
Ed Bartosh [Sun, 21 Jul 2013 22:06:51 +0000 (01:06 +0300)]
Used mic directly in image-creator job

Kvmic is a questionable solution as it's just a wrapper above mic with
it's own config. I'm considering it as a one more point of failure.

Also I failed to make it to work from sudo.

This change is a reimplementation of the job using mic.

Mic is also quite a dangerous pile of "code", but adding even more code
around it makes system even more fagile.

Change-Id: I4ed80712a049f5e5daa73360be64aec6a4cbeba3
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5545
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
11 years agoHandle gbperror when parse specfile
Lin Yang [Fri, 19 Jul 2013 09:23:37 +0000 (17:23 +0800)]
Handle gbperror when parse specfile

Change-Id: I1ec42fb401883e2efd0323c6da65b57a26ddf1d0
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5531
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
11 years agoCatch gbs export failure
Lin Yang [Fri, 19 Jul 2013 07:52:20 +0000 (15:52 +0800)]
Catch gbs export failure

Because it's not easily to call gbs export python interface, have to prepare
all export env parameters, current we still call commandline interface and
depend on return code to check result.

Change-Id: Ifc08be290449e0702b3ac84f2680086a3a8ffe2d
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Change-Id: I9764ed6e5a5955ac9e3e71a173b0beb8bdcfdf05
Reviewed-on: https://otctools.jf.intel.com/review/5527
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
11 years agoClone projects into bare repositories to save disk space
Lingchaox Xin [Tue, 16 Jul 2013 08:03:10 +0000 (16:03 +0800)]
Clone projects into bare repositories to save disk space

Change-Id: I206eeb20ee9a6bcbc68095a69dfd2527d1152d1d
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5480
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
11 years agoFix keyword missing issue after upgrade OBS to 2.4
Lin Yang [Tue, 16 Jul 2013 07:34:06 +0000 (15:34 +0800)]
Fix keyword missing issue after upgrade OBS to 2.4

In OBS 2.4 OBS_SRCSRV_REQUEST_.* event, only deletion event have 'deleteproject'
and 'deletepackage' keyword, so query it in a safe way.

Change-Id: Id14cc7ab8ba4598945430bd80ecc89db221437e5
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5479
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
11 years agoFix job_mail_sender.py logic
Lingchaox Xin [Wed, 17 Jul 2013 02:00:58 +0000 (10:00 +0800)]
Fix job_mail_sender.py logic

Change-Id: I835ad45e8bcd113e3da0eddd053bf395e6a58d31
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5498
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Lin A Yang <lin.a.yang@intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
11 years agoUpdate install dependency
Lin Yang [Thu, 11 Jul 2013 06:15:14 +0000 (14:15 +0800)]
Update install dependency

Current jenkins-scripts depends on "gbs remotebuild" and "gbs export", so it
will depend on whole gbs before seperate remotebuild to another package.

Change-Id: I306461a731563b8be36d3f81a9be991046b233c6
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5442
Reviewed-by: Hasan Wan <hasan.wan@intel.com>
Tested-by: Hasan Wan <hasan.wan@intel.com>
11 years agoRemove unused rpmlint module
Lin Yang [Thu, 11 Jul 2013 06:12:46 +0000 (14:12 +0800)]
Remove unused rpmlint module

Change-Id: I9ebc97aa017ddf2737de85c44ed893d08783e1da
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5441
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
11 years agoRemove unneeded exceptions handle and cleanups
Lingchaox Xin [Wed, 10 Jul 2013 08:21:02 +0000 (16:21 +0800)]
Remove unneeded exceptions handle and cleanups

Change-Id: Iee9fbe16a9911351f74a0b4032becaecb9211065
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5433
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Lin A Yang <lin.a.yang@intel.com>
11 years agoRemoved unused code from tempbuildpkg
Ed Bartosh [Sun, 7 Jul 2013 09:50:11 +0000 (12:50 +0300)]
Removed unused code from tempbuildpkg

Change-Id: I9cfc335980d9708b5eb5e8bde0624d06321b6dae
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/5351
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Hasan Wan <hasan.wan@intel.com>