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:
parent
8dba05a3c0
commit
d7d7592dc7
@ -27,17 +27,6 @@
|
|||||||
dest: "{{ yum_update.path }}"
|
dest: "{{ yum_update.path }}"
|
||||||
mode: 0755
|
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
|
- name: List file repos
|
||||||
shell: sed -n 's|baseurl=file://||p' *.repo
|
shell: sed -n 's|baseurl=file://||p' *.repo
|
||||||
args:
|
args:
|
||||||
@ -47,6 +36,7 @@
|
|||||||
- name: Run yum_update.sh
|
- name: Run yum_update.sh
|
||||||
command: >
|
command: >
|
||||||
buildah run
|
buildah run
|
||||||
|
--volume {{ yum_update.path }}:/tmp/yum_update.sh
|
||||||
--volume {{ yum_repos_dir_path }}:/etc/yum.repos.d
|
--volume {{ yum_repos_dir_path }}:/etc/yum.repos.d
|
||||||
{% for repo in file_repos.stdout_lines %}
|
{% for repo in file_repos.stdout_lines %}
|
||||||
{% if repo|exists %}
|
{% if repo|exists %}
|
||||||
@ -58,6 +48,11 @@
|
|||||||
{{ from_image }}
|
{{ from_image }}
|
||||||
/tmp/yum_update.sh "{{ update_repo }}"
|
/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 }}
|
- name: Commit changes to image {{ target_image | default(source_image) }}{{ modified_append_tag }}
|
||||||
command: >
|
command: >
|
||||||
buildah commit
|
buildah commit
|
||||||
|
Loading…
Reference in New Issue
Block a user