diff options
Diffstat (limited to 'ci/build.sh')
-rwxr-xr-x | ci/build.sh | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/ci/build.sh b/ci/build.sh index d7e98cad..64b862d4 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -1,5 +1,36 @@ #!/bin/bash +while getopts ":ahp:" opt; do + case $opt in + a) + echo "Build firmware images for all the platforms" + PLATFORMS="" + ;; + p) + echo "Build firmware images for the platforms: $OPTARG" + PLATFORMS=$OPTARG + ;; + h) + echo "Usage: ./ci/build.sh [options] [--]" + echo "-h Print this help and exit successfully." + echo "-a Build firmware images for all the platform defconfig's." + echo "-p List of comma separated platform names to build images for particular platforms." + echo "Example:DOCKER_PREFIX=sudo ./ci/build.sh -a" + echo -e "\tDOCKER_PREFIX=sudo ./ci/build.sh -p firestone" + echo -e "\tDOCKER_PREFIX=sudo ./ci/build.sh -p garrison,palmetto,openpower_p9_mambo" + exit 1 + ;; + \?) + echo "Invalid option: -$OPTARG" + exit 1 + ;; + :) + echo "Option -$OPTARG requires an argument." + exit 1 + ;; + esac +done + set -ex set -eo pipefail @@ -45,7 +76,7 @@ EOF ) $DOCKER_PREFIX docker build -t openpower/op-build-$distro - <<< "${Dockerfile}" mkdir -p output-images/$distro - run_docker openpower/op-build-$distro "./ci/build-all-defconfigs.sh output-images/$distro" + run_docker openpower/op-build-$distro "./ci/build-all-defconfigs.sh output-images/$distro $PLATFORMS" if [ $? = 0 ]; then mv *-images output-$distro/ else |