Skip to content

Commit 06c54bf

Browse files
committed
workflows: Simplify shell syntax
Improve logging with set -x in all shells; lose an useless subshell and a level of indentation. Signed-off-by: Loïc Minier <[email protected]>
1 parent 66b52c7 commit 06c54bf

File tree

1 file changed

+31
-33
lines changed

1 file changed

+31
-33
lines changed

.github/workflows/debos.yml

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -62,48 +62,46 @@ jobs:
6262
# operating system from the github runner one; install debos
6363
- name: Setup build environment
6464
run: |
65-
set -x
66-
# privileged container as debos will use mounts
67-
sudo incus init "${INCUS_IMAGE}" "${INCUS_NAME}" \
68-
-c security.privileged=true -c security.nesting=true
69-
sudo incus start "${INCUS_NAME}"
70-
# wait for network to be up (prior to running apt)
71-
sudo incus exec "${INCUS_NAME}" \
65+
set -x
66+
# privileged container as debos will use mounts
67+
sudo incus init "${INCUS_IMAGE}" "${INCUS_NAME}" \
68+
-c security.privileged=true -c security.nesting=true
69+
sudo incus start "${INCUS_NAME}"
70+
# wait for network to be up (prior to running apt)
71+
sudo incus exec "${INCUS_NAME}" \
7272
/usr/lib/systemd/systemd-networkd-wait-online
73-
(
74-
# these commands are run inside the container
75-
cat <<EOF
76-
apt update
77-
apt -y upgrade
78-
apt -y full-upgrade
79-
apt -y install debos
80-
EOF
81-
) | sudo incus exec "${INCUS_NAME}" -- sh
73+
74+
# commands are piped to be run inside the container
75+
sudo incus exec "${INCUS_NAME}" -- sh -e -x <<EOF
76+
apt update
77+
apt -y upgrade
78+
apt -y full-upgrade
79+
apt -y install debos
80+
EOF
8281
8382
- name: Build debos recipe
8483
run: |
8584
set -x
8685
# mount current directory under /build
8786
sudo incus config device add "${INCUS_NAME}" build-dir \
8887
disk "source=${PWD}" path=/build shift=true
89-
(
90-
# these commands are run inside the container
91-
cat <<EOF
92-
cd /build
93-
# start by building the root filesystem
94-
debos qualcomm-linux-debian-rootfs.yaml
95-
# debos tries KVM and UML as backends, and falls back to building
96-
# directly on the host, but that requires loop devices; use
97-
# qemu backend explicitly even if it's slower
98-
# qemu backend also requires to set scratchsize, otherwise
99-
# the whole build is done from memory and the out of memory
100-
# killer gets triggered
101-
debos -b qemu --scratchsize 4GiB -t imagetype:ufs \
102-
qualcomm-linux-debian-image.yaml
103-
debos -b qemu --scratchsize 4GiB -t imagetype:sdcard \
104-
qualcomm-linux-debian-image.yaml
88+
89+
# commands are piped to be run inside the container
90+
sudo incus exec "${INCUS_NAME}" -- sh -e -x <<EOF
91+
cd /build
92+
# start by building the root filesystem
93+
debos qualcomm-linux-debian-rootfs.yaml
94+
# debos tries KVM and UML as backends, and falls back to
95+
# building directly on the host, but that requires loop
96+
# devices; use qemu backend explicitly even if it's slower
97+
# qemu backend also requires to set scratchsize, otherwise the
98+
# whole build is done from memory and the out of memory killer
99+
# gets triggered
100+
debos -b qemu --scratchsize 4GiB -t imagetype:ufs \
101+
qualcomm-linux-debian-image.yaml
102+
debos -b qemu --scratchsize 4GiB -t imagetype:sdcard \
103+
qualcomm-linux-debian-image.yaml
105104
EOF
106-
) | sudo incus exec "${INCUS_NAME}" -- sh
107105
108106
- name: Upload artifacts to fileserver
109107
run: |

0 commit comments

Comments
 (0)