Skip to content

Commit 951ce1a

Browse files
committed
Github Action fix?
1 parent 21c9d64 commit 951ce1a

File tree

4 files changed

+124
-28
lines changed

4 files changed

+124
-28
lines changed

.github/workflows/ai-toolbox-image.yaml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,37 @@ jobs:
2222
uses: actions/checkout@v3
2323
- name: Buildah configuration
2424
run: |
25-
export STORAGE_DRIVER=overlay
26-
export STORAGE_ROOT=/mnt/containers/storage
27-
sudo mkdir -p "$STORAGE_ROOT"
28-
sudo chown -R "$(id -u):$(id -g)" "$STORAGE_ROOT"
29-
echo "STORAGE_DRIVER=$STORAGE_DRIVER" >> $GITHUB_ENV
30-
echo "STORAGE_ROOT=$STORAGE_ROOT" >> $GITHUB_ENV
31-
df -h
25+
#!/usr/bin/env bash
26+
set -euo pipefail
27+
28+
conf=/etc/containers/storage.conf
29+
target=/mnt/containers/storage
30+
31+
sudo mkdir -p "$target"
32+
sudo chown -R "$(id -u):$(id -g)" /mnt
33+
34+
sudo awk -v g="$target" '
35+
BEGIN { s=0 }
36+
/^\[storage\]/ { s=1; print; next }
37+
s && /^graphroot/ { print "graphroot = \"" g "\""; s=0; next }
38+
s && /^driver/ { print "driver = \"overlay\""; next }
39+
s && /^runroot/ { print "runroot = \"/run/containers/storage\""; next }
40+
{ print }
41+
END {
42+
if (!s) next
43+
if (!seen) {
44+
print "driver = \"overlay\""
45+
print "runroot = \"/run/containers/storage\""
46+
print "graphroot = \"" g "\""
47+
}
48+
}
49+
' "$conf" 2>/dev/null | sudo tee "$conf" >/dev/null || sudo tee "$conf" >/dev/null <<EOF
50+
[storage]
51+
driver = "overlay"
52+
runroot = "/run/containers/storage"
53+
graphroot = "$target"
54+
EOF
55+
cat $conf
3256
- name: Set versioned tag
3357
id: versioned-tag
3458
run: |

.github/workflows/microshift.yaml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,37 @@ jobs:
3333
echo "VERSIONED_TAG=${VERSIONED_TAG}" >> $GITHUB_OUTPUT
3434
- name: Buildah configuration
3535
run: |
36-
export STORAGE_DRIVER=overlay
37-
export STORAGE_ROOT=/mnt/containers/storage
38-
sudo mkdir -p "$STORAGE_ROOT"
39-
sudo chown -R "$(id -u):$(id -g)" "$STORAGE_ROOT"
40-
echo "STORAGE_DRIVER=$STORAGE_DRIVER" >> $GITHUB_ENV
41-
echo "STORAGE_ROOT=$STORAGE_ROOT" >> $GITHUB_ENV
42-
df -h
36+
#!/usr/bin/env bash
37+
set -euo pipefail
38+
39+
conf=/etc/containers/storage.conf
40+
target=/mnt/containers/storage
41+
42+
sudo mkdir -p "$target"
43+
sudo chown -R "$(id -u):$(id -g)" /mnt
44+
45+
sudo awk -v g="$target" '
46+
BEGIN { s=0 }
47+
/^\[storage\]/ { s=1; print; next }
48+
s && /^graphroot/ { print "graphroot = \"" g "\""; s=0; next }
49+
s && /^driver/ { print "driver = \"overlay\""; next }
50+
s && /^runroot/ { print "runroot = \"/run/containers/storage\""; next }
51+
{ print }
52+
END {
53+
if (!s) next
54+
if (!seen) {
55+
print "driver = \"overlay\""
56+
print "runroot = \"/run/containers/storage\""
57+
print "graphroot = \"" g "\""
58+
}
59+
}
60+
' "$conf" 2>/dev/null | sudo tee "$conf" >/dev/null || sudo tee "$conf" >/dev/null <<EOF
61+
[storage]
62+
driver = "overlay"
63+
runroot = "/run/containers/storage"
64+
graphroot = "$target"
65+
EOF
66+
cat $conf
4367
- name: Build OS content
4468
uses: redhat-actions/buildah-build@v2
4569
id: build-image

.github/workflows/os-content.yaml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,37 @@ jobs:
2727
uses: actions/checkout@v3
2828
- name: Buildah configuration
2929
run: |
30-
export STORAGE_DRIVER=overlay
31-
export STORAGE_ROOT=/mnt/containers/storage
32-
sudo mkdir -p "$STORAGE_ROOT"
33-
sudo chown -R "$(id -u):$(id -g)" "$STORAGE_ROOT"
34-
echo "STORAGE_DRIVER=$STORAGE_DRIVER" >> $GITHUB_ENV
35-
echo "STORAGE_ROOT=$STORAGE_ROOT" >> $GITHUB_ENV
36-
df -h
30+
#!/usr/bin/env bash
31+
set -euo pipefail
32+
33+
conf=/etc/containers/storage.conf
34+
target=/mnt/containers/storage
35+
36+
sudo mkdir -p "$target"
37+
sudo chown -R "$(id -u):$(id -g)" /mnt
38+
39+
sudo awk -v g="$target" '
40+
BEGIN { s=0 }
41+
/^\[storage\]/ { s=1; print; next }
42+
s && /^graphroot/ { print "graphroot = \"" g "\""; s=0; next }
43+
s && /^driver/ { print "driver = \"overlay\""; next }
44+
s && /^runroot/ { print "runroot = \"/run/containers/storage\""; next }
45+
{ print }
46+
END {
47+
if (!s) next
48+
if (!seen) {
49+
print "driver = \"overlay\""
50+
print "runroot = \"/run/containers/storage\""
51+
print "graphroot = \"" g "\""
52+
}
53+
}
54+
' "$conf" 2>/dev/null | sudo tee "$conf" >/dev/null || sudo tee "$conf" >/dev/null <<EOF
55+
[storage]
56+
driver = "overlay"
57+
runroot = "/run/containers/storage"
58+
graphroot = "$target"
59+
EOF
60+
cat $conf
3761
- name: Set versioned tag
3862
id: versioned-tag
3963
run: |

.github/workflows/toolbox-image.yaml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,37 @@ jobs:
2222
uses: actions/checkout@v3
2323
- name: Buildah configuration
2424
run: |
25-
export STORAGE_DRIVER=overlay
26-
export STORAGE_ROOT=/mnt/containers/storage
27-
sudo mkdir -p "$STORAGE_ROOT"
28-
sudo chown -R "$(id -u):$(id -g)" "$STORAGE_ROOT"
29-
echo "STORAGE_DRIVER=$STORAGE_DRIVER" >> $GITHUB_ENV
30-
echo "STORAGE_ROOT=$STORAGE_ROOT" >> $GITHUB_ENV
31-
df -h
25+
#!/usr/bin/env bash
26+
set -euo pipefail
27+
28+
conf=/etc/containers/storage.conf
29+
target=/mnt/containers/storage
30+
31+
sudo mkdir -p "$target"
32+
sudo chown -R "$(id -u):$(id -g)" /mnt
33+
34+
sudo awk -v g="$target" '
35+
BEGIN { s=0 }
36+
/^\[storage\]/ { s=1; print; next }
37+
s && /^graphroot/ { print "graphroot = \"" g "\""; s=0; next }
38+
s && /^driver/ { print "driver = \"overlay\""; next }
39+
s && /^runroot/ { print "runroot = \"/run/containers/storage\""; next }
40+
{ print }
41+
END {
42+
if (!s) next
43+
if (!seen) {
44+
print "driver = \"overlay\""
45+
print "runroot = \"/run/containers/storage\""
46+
print "graphroot = \"" g "\""
47+
}
48+
}
49+
' "$conf" 2>/dev/null | sudo tee "$conf" >/dev/null || sudo tee "$conf" >/dev/null <<EOF
50+
[storage]
51+
driver = "overlay"
52+
runroot = "/run/containers/storage"
53+
graphroot = "$target"
54+
EOF
55+
cat $conf
3256
- name: Set versioned tag
3357
id: versioned-tag
3458
run: |

0 commit comments

Comments
 (0)