Browse Source

Merge "Put legacy jobs down a directory level into workspace" into feature/zuulv3

changes/28/507928/1
Zuul 5 years ago committed by Gerrit Code Review
parent
commit
d02448dff7
  1. 2
      zuul/ansible/filter/zuul_filters.py
  2. 12
      zuul/cmd/migrate.py

2
zuul/ansible/filter/zuul_filters.py

@ -25,7 +25,7 @@ def zuul_legacy_vars(zuul):
ZUUL_SHORT_PROJECT_NAME=short_name,
ZUUL_PIPELINE=zuul['pipeline'],
ZUUL_VOTING=zuul['voting'],
WORKSPACE='/home/zuul')
WORKSPACE='/home/zuul/workspace')
if 'branch' in zuul:
params['ZUUL_BRANCH'] = zuul['branch']

12
zuul/cmd/migrate.py

@ -630,7 +630,7 @@ class Job:
if scpfile.get('copy-console'):
continue
else:
src = "{{ ansible_user_dir }}/"
src = "{{ ansible_user_dir }}/workspace/"
rsync_opts = self._getRsyncOptions(scpfile['source'])
target = scpfile['target']
@ -705,6 +705,7 @@ class Job:
task['shell']['cmd'] = data
if shell:
task['shell']['executable'] = shell
task['shell']['chdir'] = '{{ ansible_user_dir }}/workspace'
if syntax_check:
# Emit a test playbook with this shell task in it then run
@ -761,6 +762,7 @@ class Job:
task = self._emitScriptContent(
builder['shell'], playbook_dir, sequence)
task['environment'] = ENVIRONMENT
return task
def _transformPublishers(self, jjb_job):
@ -806,7 +808,15 @@ class Job:
run_playbook = os.path.join(self.job_path, 'run.yaml')
post_playbook = os.path.join(self.job_path, 'post.yaml')
tasks = []
workspace_task = collections.OrderedDict()
workspace_task['name'] = "Ensure legacy workspace directory"
workspace_task['file'] = collections.OrderedDict()
workspace_task['file']['path'] = '{{ ansible_user_dir }}/workspace'
workspace_task['file']['state'] = 'directory'
tasks.append(workspace_task)
sequence = 0
for builder in self.jjb_job.get('builders', []):
if 'shell' in builder:

Loading…
Cancel
Save