diff --git a/scripts/gate-check-commit.sh b/scripts/gate-check-commit.sh index b77d787cf8..ee525874f3 100755 --- a/scripts/gate-check-commit.sh +++ b/scripts/gate-check-commit.sh @@ -95,19 +95,6 @@ if [ -n "${DATA_DISK_DEVICE}" ]; then export BOOTSTRAP_OPTS="${BOOTSTRAP_OPTS} bootstrap_host_data_disk_device=${DATA_DISK_DEVICE}" fi -# Grab all the zuul environment variables that -# were exported by the jenkins user into a file. -# This is used for cross-repo testing. -if [ -f zuul.env ]; then - # The ZUUL variables we get in the file are - # not quoted, so we change the file to ensure - # that they are. We also ensure that each - # var is exported so that it's accessible in - # any subshell. - sed -i 's|\(.*\)=\(.*\)$|export \1="\2"|' zuul.env - source zuul.env -fi - # Bootstrap Ansible source "${OSA_CLONE_DIR}/scripts/bootstrap-ansible.sh" diff --git a/zuul.d/playbooks/run.yml b/zuul.d/playbooks/run.yml index f3863826ad..9d1add165b 100644 --- a/zuul.d/playbooks/run.yml +++ b/zuul.d/playbooks/run.yml @@ -1,7 +1,12 @@ - hosts: all tasks: - name: Run gate-check-commit.sh script - command: "sudo scripts/gate-check-commit.sh {{ scenario }} {{ action }}" + become: yes + become_user: root + command: "scripts/gate-check-commit.sh {{ scenario }} {{ action }}" args: chdir: "src/{{ zuul.project.canonical_name }}" - environment: '{{ zuul | zuul_legacy_vars }}' + environment: + # ZUUL_PROJECT is used by tests/get-ansible-role-requirements to + # determine when CI provided repos should be used. + ZUUL_PROJECT: "{{ zuul.project.short_name }}"