Merge "Fix zuul-jobs-test-upload-logs-s3 job"

This commit is contained in:
Zuul 2021-11-16 16:34:48 +00:00 committed by Gerrit Code Review
commit 6ff50fb0d4
2 changed files with 11 additions and 10 deletions

View File

@ -9,6 +9,10 @@
block:
# Use chmod instead of file because ansible 2.5 file with recurse and
# follow can't really handle symlinks to .
- name: debug var
debug:
msg: "log_root {{ zuul.executor.log_root }}"
- name: Ensure logs are readable before uploading
delegate_to: "{{ _undocumented_test_worker_node_ | default('localhost') }}"
command: "chmod -R u=rwX,g=rX,o=rX {{ zuul.executor.log_root }}/"

View File

@ -30,9 +30,14 @@
aws_access_key: "{{ zuul_log_aws_access_key }}"
aws_secret_key: "{{ zuul_log_aws_secret_key }}"
- name: Create tempdir to upload to s3
tempfile:
- name: Create Logdir
become: true
file:
state: directory
path: "{{ zuul.executor.log_root }}"
mode: "0755"
group: "zuul"
owner: "zuul"
register: fake_zuul_logdir
- name: Add content to tempfile
@ -40,19 +45,11 @@
content: "{{ test_content }}"
dest: "{{ fake_zuul_logdir.path }}/testfile"
- name: Save zuul variables
set_fact:
old_zuul: "{{ zuul }}"
- name: Set simulated zuul variables
set_fact:
new_zuul: "{{ old_zuul | combine({'executor': {'log_root': fake_zuul_logdir.path}}, recursive=True) }}"
- name: Upload file to s3
include_role:
name: upload-logs-s3
vars:
upload_logs_s3_endpoint: 'http://localhost:9000'
zuul: "{{ new_zuul }}"
- name: Download mc
get_url: