Skip to content

Commit

Permalink
build_all.sh: specify a list of projects as extra args
Browse files Browse the repository at this point in the history
Add the ability to specify a list of projects to process, instead of
processing all projects (default behaviour).

Fixes: #244

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
  • Loading branch information
marcov committed Nov 20, 2018
1 parent e5a2f4a commit 3fe90cc
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions obs-packaging/build_all.sh
Expand Up @@ -41,9 +41,13 @@ main() {
local branch="${1:-}"
[ -n "${branch}" ] || usage "missing branch" "1"

pushd "${script_dir}"
for p in "${OBS_PKGS_PROJECTS[@]}"; do
pushd "$p" >>/dev/null
shift
local projectsList=("$@")
[ "${#projectsList[@]}" = "0" ] && projectsList=("${OBS_PKGS_PROJECTS[@]}")

pushd "${script_dir}" >>/dev/null
for p in "${projectsList[@]}"; do
[ -d "$p" ] || usage "$p is not a valid project directory" "1"
update_cmd="./update.sh"
if [ -n "${PUSH}" ]; then
# push to obs
Expand All @@ -53,11 +57,13 @@ main() {
update_cmd+=" -l"
fi

echo "update ${p}"
echo "======= Updating ${p} ======="
pushd "$p" >>/dev/null
bash -c "${update_cmd} ${branch}"
popd >>/dev/null
echo ""
done
popd
popd >> /dev/null
}

main $@

0 comments on commit 3fe90cc

Please sign in to comment.