Revert "Refactor fetch-sphinx-tarball to be executor safe"

This reverts commit 51a8ed8e95.

This has a typo ("exector").  The fix is obvious, but the bigger
issue is that it was not caught in testing, even though the main
purpose of the change was to re-enable tests.  We should understand
why it wasn't caught in testing and resolve that before fixing and
unreverting.

Change-Id: I3ed407546fecc52d4a039f7959c0521511e6a00b
This commit is contained in:
James E. Blair 2020-10-14 13:53:17 -07:00
parent 4b19def07d
commit 5603eb2291
5 changed files with 28 additions and 96 deletions

View File

@ -7,7 +7,6 @@ General Purpose Roles
.. zuul:autorole:: add-sshkey .. zuul:autorole:: add-sshkey
.. zuul:autorole:: bindep .. zuul:autorole:: bindep
.. zuul:autorole:: buildset-artifacts-location .. zuul:autorole:: buildset-artifacts-location
.. zuul:autorole:: clean-directory
.. zuul:autorole:: clear-firewall .. zuul:autorole:: clear-firewall
.. zuul:autorole:: configure-mirrors .. zuul:autorole:: configure-mirrors
.. zuul:autorole:: copy-build-sshkey .. zuul:autorole:: copy-build-sshkey

View File

@ -1,10 +0,0 @@
Clean a directory, but leave the directory alone
This is the equivalent of ``rm -rf *`` when run in a directory. It is
safe to run in executor context.
**Role Variables**
.. zuul:rolevar:: clean_directory_path
The directory to clean.

View File

@ -1,28 +0,0 @@
- name: Assert directory set
assert:
that: clean_directory_path is defined
fail_msg: 'Must specify clean_directory_path'
- block:
- name: Collect files
find:
paths: '{{ clean_directory_path }}'
hidden: True
recurse: True
register: _files
- name: Collect directories
find:
paths: '{{ clean_directory_path }}'
hidden: True
recurse: True
file_type: directory
register: _dirs
- name: Clean Directory
file:
path: '{{ zj_item }}'
state: absent
loop: '{{ _files.files + _dirs.files }}'
loop_control:
loop_var: zj_item

View File

@ -1,45 +1,18 @@
- name: Move artifacts and docs to logs dir - name: Move artifacts and docs to logs dir
when: zuul.change is defined when: zuul.change is defined
delegate_to: localhost delegate_to: localhost
block: shell: |
# Artifacts if [ -n "$(find {{ zuul.executor.work_root }}/{{ zj_item }} -mindepth 1)" ] ; then
- name: Check if artifacts is empty # Only create target directory if it is needed.
find: # Do not fail if it is already there.
paths: '{{ zuul.executor.work_root }}/artifacts' mkdir -p {{ zuul.executor.log_root }}/{{ zj_item }}
register: _artifacts # Leave the original directory behind so that other roles
# operating on the interface directories can simply no-op.
- name: Copy artifacts into log root mv -f {{ zuul.executor.work_root }}/{{ zj_item }}/* {{ zuul.executor.log_root }}/{{ zj_item }}
synchronize: fi
src: '{{ zuul.executor.work_root }}/artifacts/' loop:
dest: '{{ zuul.exector.log_root }}/artifacts/' - artifacts
owner: no - docs
group: no loop_control:
when: _artifacts.files loop_var: zj_item
run_once: true
- name: Clean artifacts
include_role:
name: clean-directory
vars:
clean_directory_path: '{{ zuul.executor.work_root }}/artifacts/'
when: _artifacts.files
# Docs
- name: Check if docs is empty
find:
paths: '{{ zuul.executor.work_root }}/docs'
register: _docs
- name: Copy docs into log root
synchronize:
src: '{{ zuul.executor.work_root }}/docs/'
dest: '{{ zuul.exector.log_root }}/docs/'
owner: no
group: no
when: _docs.files
- name: Clean docs
include_role:
name: clean-directory
vars:
clean_directory_path: '{{ zuul.executor.work_root }}/docs/'
when: _docs.files

View File

@ -455,19 +455,19 @@
vars: vars:
zuul_use_fetch_output: false zuul_use_fetch_output: false
- job: # Disabled because "Move artifacts and docs to logs dir" task would
name: zuul-jobs-test-fetch-sphinx-tarball-with-zuul-output # fail with "Executing local code is prohibited" during testing
description: Test the fetch-sphinx-tarball # - job:
files: # name: zuul-jobs-test-fetch-sphinx-tarball-with-zuul-output
- roles/ensure-output-dirs/.* # description: Test the fetch-sphinx-tarball
- roles/fetch-sphinx-tarball/.* # files:
- roles/fetch-output/.* # - roles/ensure-output-dirs/.*
- roles/merge-output-to-logs/.* # - roles/fetch-sphinx-tarball/.*
- roles/clean-directory/.* # - roles/fetch-output/.*
- test-playbooks/python/fetch-sphinx-tarball.yaml # run: test-playbooks/python/fetch-sphinx-tarball.yaml
run: test-playbooks/python/fetch-sphinx-tarball.yaml # voting: false
vars: # vars:
zuul_use_fetch_output: true # zuul_use_fetch_output: true
- job: - job:
name: zuul-jobs-test-fetch-sphinx-tarball-synchronize name: zuul-jobs-test-fetch-sphinx-tarball-synchronize
@ -522,7 +522,6 @@
- zuul-jobs-test-fetch-subunit-output-synchronize - zuul-jobs-test-fetch-subunit-output-synchronize
- zuul-jobs-test-fetch-sphinx-output - zuul-jobs-test-fetch-sphinx-output
- zuul-jobs-test-fetch-sphinx-output-synchronize - zuul-jobs-test-fetch-sphinx-output-synchronize
- zuul-jobs-test-fetch-sphinx-tarball-with-zuul-output
- zuul-jobs-test-fetch-sphinx-tarball-synchronize - zuul-jobs-test-fetch-sphinx-tarball-synchronize
gate: gate:
jobs: &id001 jobs: &id001
@ -564,7 +563,6 @@
- zuul-jobs-test-fetch-subunit-output-synchronize - zuul-jobs-test-fetch-subunit-output-synchronize
- zuul-jobs-test-fetch-sphinx-output - zuul-jobs-test-fetch-sphinx-output
- zuul-jobs-test-fetch-sphinx-output-synchronize - zuul-jobs-test-fetch-sphinx-output-synchronize
- zuul-jobs-test-fetch-sphinx-tarball-with-zuul-output
- zuul-jobs-test-fetch-sphinx-tarball-synchronize - zuul-jobs-test-fetch-sphinx-tarball-synchronize
periodic-weekly: periodic-weekly:
jobs: *id001 jobs: *id001