-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test with latest JJB and supported JJB
Test global-jjb with both the latest version of JJB as well as the global-jjb supported version of JJB. Also include a script to ensure that jjb/lf-ci-jobs.yaml and tox.ini define the same supported versions of JJB. Change-Id: I1a181776c6d0eef1b857ede9099d3ebb8e3ba98d Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
- Loading branch information
Showing
2 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# SPDX-License-Identifier: EPL-1.0 | ||
############################################################################## | ||
# Copyright (c) 2018 The Linux Foundation and others. | ||
# | ||
# All rights reserved. This program and the accompanying materials | ||
# are made available under the terms of the Eclipse Public License v1.0 | ||
# which accompanies this distribution, and is available at | ||
# http://www.eclipse.org/legal/epl-v10.html | ||
############################################################################## | ||
"""Ensures that the jjb-version in tox and jjb/lf-ci-jobs.yaml match.""" | ||
|
||
__author__ = 'Thanh Ha' | ||
|
||
|
||
import os | ||
import re | ||
import sys | ||
|
||
|
||
def check_jjb_version(tox_file, releng_jobs_file): | ||
with open(tox_file, 'r') as _file: | ||
for num, line in enumerate(_file, 1): | ||
if re.search('jenkins-job-builder==', line): | ||
jjb_version_tox = line.rsplit('==', 1)[1].strip() | ||
break | ||
|
||
with open(releng_jobs_file, 'r') as _file: | ||
for num, line in enumerate(_file, 1): | ||
if re.search('jjb-version: ', line): | ||
jjb_version = line.rsplit(':', 1)[1].strip() | ||
break | ||
|
||
print('JJB version in jjb/lf-ci-jobs.yaml: {}'.format(jjb_version)) | ||
print('JJB version in tox.ini: {}'.format(jjb_version_tox)) | ||
|
||
if jjb_version != jjb_version_tox: | ||
print('ERROR: JJB version in jjb/lf-ci-jobs.yaml and tox.ini MUST match.') | ||
sys.exit(1) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_jjb_version('tox.ini', os.path.join('jjb', 'lf-ci-jobs.yaml')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters