]> git.ipfire.org Git - people/ms/nightly-builds.git/commitdiff
Add support for multiple targets again
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Feb 2021 19:39:24 +0000 (19:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Feb 2021 19:39:24 +0000 (19:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
build.sh

index d7f97c1a9b30f4fcf7b1cad7a25e52d52b81e487..e5f5eb4700231ea726a34a237236551edc56e8ae 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -128,54 +128,54 @@ build() {
 
        local now="$(git log --format="%ci" -1 "${commit_new}")"
 
-       local target="$(git config build.target)"
-       [ -z "${target}" ] && target="$(uname -m)"
-
-       local build_path="${UPLOAD_DIR}/${branch}/${now}-${commit_new:0:8}"
-       local build="${build_path}/${target}"
-       local status="failed"
-
-       # Remove marker
-       unlink "${dir}/.force-build"
-
-       # Ready for build: Download toolchain and sources
-       local action
-       for action in clean gettoolchain downloadsrc; do
-               if ! ./make.sh --target="${target}" "${action}"; then
-                       touch "${dir}/.force-build"
-                       continue
+       local target
+       for target in $(git config build.targets); do
+               local build_path="${UPLOAD_DIR}/${branch}/${now}-${commit_new:0:8}"
+               local build="${build_path}/${target}"
+               local status="failed"
+
+               # Remove marker
+               unlink "${dir}/.force-build"
+
+               # Ready for build: Download toolchain and sources
+               local action
+               for action in clean gettoolchain downloadsrc; do
+                       if ! ./make.sh --target="${target}" "${action}"; then
+                               touch "${dir}/.force-build"
+                               continue
+                       fi
+               done
+
+               # Execute the build
+               mkdir -p "${build}"
+               ./make.sh --target="${target}" build | tee "${build}/build.log"
+               local ret=${PIPESTATUS[0]}
+
+               # Save the changelog
+               git log -50 > "${build}/changelog.txt"
+
+               # Save the result
+               if [ "${ret}" = "0" ]; then
+                       status="success"
+                       touch "${build}/.success"
+
+                       # Copy images
+                       mv -v *.iso *.img.gz *.img.xz *.tar.bz2 *.md5 packages/ "${build}"
+                       extract_installer_from_iso "${build}"
                fi
-       done
-
-       # Execute the build
-       mkdir -p "${build}"
-       ./make.sh --target="${target}" build | tee "${build}/build.log"
-       local ret=${PIPESTATUS[0]}
+               mv -v log/ "${build}"
 
-       # Save the changelog
-       git log -50 > "${build}/changelog.txt"
+               # Cleanup the build environment
+               ./make.sh --target="${target}" clean
 
-       # Save the result
-       if [ "${ret}" = "0" ]; then
-               status="success"
-               touch "${build}/.success"
-
-               # Copy images
-               mv -v *.iso *.img.gz *.img.xz *.tar.bz2 *.md5 packages/ "${build}"
-               extract_installer_from_iso "${build}"
-       fi
-       mv -v log/ "${build}"
+               # Send an email notification
+               send_email "${status}" "${target}" "${branch}" "${commit_new}" "${build}"
 
-       # Cleanup the build environment
-       ./make.sh --target="${target}" clean
+               # Upload the result
+               sync
 
-       # Send an email notification
-       send_email "${status}" "${target}" "${branch}" "${commit_new}" "${build}"
-
-       # Upload the result
-       sync
-
-       popd
+               popd
+       done
 }
 
 sync() {