Rename outfiles to zuul- to match rollout

Turns out 99 isn't a good prefix.

Also, remove the move argument now that we're merging with the existing
projects.yaml.

Also, stop running zuul unittests on migration script changes. They are
not relevant.

Change-Id: I10ed8cae64c82ed5afd01bb03a74ffc4fd2d87ee
This commit is contained in:
Monty Taylor 2017-09-26 07:56:26 -05:00
parent d66a7391f0
commit f567193d98
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
3 changed files with 19 additions and 15 deletions

View File

@ -45,10 +45,19 @@
jobs:
- build-openstack-infra-sphinx-docs:
success-url: 'html/feature/zuulv3/'
irrelevant-files:
- zuul/cmd/migrate.py
- playbooks/zuul-migrate.yaml
- tox-cover:
irrelevant-files:
- zuul/cmd/migrate.py
- playbooks/zuul-migrate.yaml
voting: false
- tox-pep8
- tox-py35
- tox-py35:
irrelevant-files:
- zuul/cmd/migrate.py
- playbooks/zuul-migrate.yaml
- zuul-stream-functional
- zuul-migrate:
files:
@ -59,7 +68,10 @@
- build-openstack-infra-sphinx-docs:
success-url: 'html/feature/zuulv3/'
- tox-pep8
- tox-py35
- tox-py35:
irrelevant-files:
- zuul/cmd/migrate.py
- playbooks/zuul-migrate.yaml
- zuul-stream-functional
post:
jobs:

View File

@ -5,7 +5,7 @@
command: "python3 -m pip install --user src/git.openstack.org/openstack-infra/zuul[migrate]"
- name: Migrate the data
command: "python3 ../zuul/zuul/cmd/migrate.py zuul/layout.yaml jenkins/jobs nodepool/nodepool.yaml . --mapping=zuul/mapping.yaml -v -m"
command: "python3 ../zuul/zuul/cmd/migrate.py zuul/layout.yaml jenkins/jobs nodepool/nodepool.yaml . --mapping=zuul/mapping.yaml -v"
args:
chdir: src/git.openstack.org/openstack-infra/project-config

View File

@ -1085,12 +1085,11 @@ class ZuulMigrate:
log = logging.getLogger("zuul.Migrate")
def __init__(self, layout, job_config, nodepool_config,
outdir, mapping, move, syntax_check):
outdir, mapping, syntax_check):
self.layout = ordered_load(open(layout, 'r'))
self.job_config = job_config
self.outdir = outdir
self.mapping = JobMapping(nodepool_config, self.layout, mapping)
self.move = move
self.syntax_check = syntax_check
self.jobs = {}
@ -1211,18 +1210,15 @@ class ZuulMigrate:
def setupDir(self):
zuul_yaml = os.path.join(self.outdir, 'zuul.yaml')
zuul_d = os.path.join(self.outdir, 'zuul.d')
orig = os.path.join(zuul_d, '01zuul.yaml')
job_outfile = os.path.join(zuul_d, '99legacy-jobs.yaml')
job_outfile = os.path.join(zuul_d, 'zuul-legacy-jobs.yaml')
project_outfile = os.path.join(zuul_d, 'projects.yaml')
projects = []
project_template_outfile = os.path.join(
zuul_d, '99legacy-project-templates.yaml')
zuul_d, 'zuul-legacy-project-templates.yaml')
if not os.path.exists(self.outdir):
os.makedirs(self.outdir)
if not os.path.exists(zuul_d):
os.makedirs(zuul_d)
if os.path.exists(zuul_yaml) and self.move:
os.rename(zuul_yaml, orig)
elif os.path.exists(project_outfile):
projects = ordered_load(open(project_outfile, 'r'))
return dict(
@ -1543,10 +1539,6 @@ def main():
parser.add_argument(
'--syntax-check', dest='syntax_check', action='store_true',
help='Run ansible-playbook --syntax-check on generated playbooks')
parser.add_argument(
'-m', dest='move', action='store_true',
help='Move zuul.yaml to zuul.d if it exists')
args = parser.parse_args()
if args.verbose:
logging.basicConfig(level=logging.DEBUG)
@ -1554,7 +1546,7 @@ def main():
logging.basicConfig(level=logging.INFO)
ZuulMigrate(args.layout, args.job_config, args.nodepool_config,
args.outdir, args.mapping, args.move, args.syntax_check).run()
args.outdir, args.mapping, args.syntax_check).run()
if __name__ == '__main__':