Skip to content

Commit

Permalink
Add automatic use docker if available in build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
stevleibelt committed Dec 12, 2024
1 parent f820ab3 commit 6cf2870
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

* Add removal of `.git` directories for all "batteries included" scripts
* Add cleanup section in build process to reduce iso size
* Add automatic usage of docker compose in `build.sh` if docker is available

### Changed in unreleased

Expand Down
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,15 @@ function _exit_if_string_is_empty ()
#####
function _main ()
{
if docker info > /dev/null 2>&1;
then
PATH_TO_THIS_SCRIPT=$(cd $(dirname "${BASH_SOURCE[0]}"); pwd)
cd "${PATH_TO_THIS_SCRIPT}" || exit 11
_echo_if_be_verbose "Starting build in dedicated docker container"
docker compose run --rm archlinux-container /app/build.sh "${@}"
exit_if_last_exit_code_is_not_zero ${?} "Could not start docker container with: docker compose run --rm archlinux-container /app/build.sh" "${@}"
cd - || exit 12
else
local BUILD_FILE_NAME
local BUILD_WAS_SUCCESSFUL
local CURRENT_WORKING_DIRECTORY
Expand Down Expand Up @@ -1184,6 +1193,7 @@ function _main ()

cd "${CURRENT_WORKING_DIRECTORY}"
#eo: code
fi
}

####
Expand Down

0 comments on commit 6cf2870

Please sign in to comment.