Browse Source

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
changes/32/632832/1
Steve Baker 4 months ago
parent
commit
d7d7592dc7
1 changed files with 6 additions and 11 deletions
  1. 6
    11
      tasks/yum_update_buildah.yml

+ 6
- 11
tasks/yum_update_buildah.yml View File

@@ -27,17 +27,6 @@
27 27
     dest: "{{ yum_update.path }}"
28 28
     mode: 0755
29 29
 
30
-- name: Copy yum_update.sh
31
-  command: >
32
-    buildah copy
33
-      {{ from_image }}
34
-      {{ yum_update.path }} /tmp/yum_update.sh
35
-
36
-- name: Remove temporary yum_update.sh script
37
-  file:
38
-    path: "{{ yum_update.path }}"
39
-    state: absent
40
-
41 30
 - name: List file repos
42 31
   shell: sed -n 's|baseurl=file://||p' *.repo
43 32
   args:
@@ -47,6 +36,7 @@
47 36
 - name: Run yum_update.sh
48 37
   command: >
49 38
     buildah run
39
+      --volume {{ yum_update.path }}:/tmp/yum_update.sh
50 40
       --volume {{ yum_repos_dir_path }}:/etc/yum.repos.d
51 41
       {% for repo in file_repos.stdout_lines %}
52 42
         {% if repo|exists %}
@@ -58,6 +48,11 @@
58 48
       {{ from_image }}
59 49
       /tmp/yum_update.sh "{{ update_repo }}"
60 50
 
51
+- name: Remove temporary yum_update.sh script
52
+  file:
53
+    path: "{{ yum_update.path }}"
54
+    state: absent
55
+
61 56
 - name: Commit changes to image {{ target_image | default(source_image) }}{{ modified_append_tag }}
62 57
   command: >
63 58
     buildah commit

Loading…
Cancel
Save