Mount in yum_update.sh when running it

Rather than copy the ephemeral script yum_update.sh, just mount it in
during the buildah run call which runs it.

This results in one less layer, and may work around an issue seen in
the gate where the file is sometimes not in the image when expected.

Change-Id: I1303be08ed162318f4b4b8f3aabf873c13ae9b99
This commit is contained in:
Steve Baker 2019-01-24 13:15:07 +13:00
parent 8dba05a3c0
commit d7d7592dc7
1 changed files with 6 additions and 11 deletions

View File

@ -27,17 +27,6 @@
dest: "{{ yum_update.path }}"
mode: 0755
- name: Copy yum_update.sh
command: >
buildah copy
{{ from_image }}
{{ yum_update.path }} /tmp/yum_update.sh
- name: Remove temporary yum_update.sh script
file:
path: "{{ yum_update.path }}"
state: absent
- name: List file repos
shell: sed -n 's|baseurl=file://||p' *.repo
args:
@ -47,6 +36,7 @@
- name: Run yum_update.sh
command: >
buildah run
--volume {{ yum_update.path }}:/tmp/yum_update.sh
--volume {{ yum_repos_dir_path }}:/etc/yum.repos.d
{% for repo in file_repos.stdout_lines %}
{% if repo|exists %}
@ -58,6 +48,11 @@
{{ from_image }}
/tmp/yum_update.sh "{{ update_repo }}"
- name: Remove temporary yum_update.sh script
file:
path: "{{ yum_update.path }}"
state: absent
- name: Commit changes to image {{ target_image | default(source_image) }}{{ modified_append_tag }}
command: >
buildah commit