Code Review
/
ta
/
build-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix DIB in SELinux permissive hosts
[ta/build-tools.git]
/
build_images.sh
diff --git
a/build_images.sh
b/build_images.sh
index
9d94f59
..
bbaaf00
100755
(executable)
--- a/
build_images.sh
+++ b/
build_images.sh
@@
-14,15
+14,16
@@
# limitations under the License.
set -x
# limitations under the License.
set -x
-set -eu
+set -e
+set -o pipefail
usage() {
usage() {
- echo "Usage: $0 -m <manifest-
path> -w <work-dir-path>
"
+ echo "Usage: $0 -m <manifest-
dir> -w <work-dir> [-r <rpmbuilder-dir> -p <rpm-create-search-dir>]
"
exit 1
}
exit 1
}
-[ "$#" -ne 4 ] && usage
-while getopts "m:w:" OPT; do
+rpm_search_paths=""
+while getopts "m:w:
p:r:
" OPT; do
case $OPT in
m)
export MANIFEST_PATH=$(readlink -f $OPTARG)
case $OPT in
m)
export MANIFEST_PATH=$(readlink -f $OPTARG)
@@
-30,20
+31,40
@@
while getopts "m:w:" OPT; do
w)
export WORK=$OPTARG
;;
w)
export WORK=$OPTARG
;;
+ r)
+ export RPMBUILDER_PATH=$(readlink -f $OPTARG)
+ ;;
+ p)
+ rpm_search_paths+=" $OPTARG"
+ ;;
*)
usage
;;
esac
done
*)
usage
;;
esac
done
+[ -z "$MANIFEST_PATH" ] && usage
+[ -z "$WORK" ] && usage
+[ -n "$rpm_search_paths" -a -z "$RPMBUILDER_PATH" ] && usage
+shift "$((OPTIND-1))"
+[ "$#" -ne 0 ] && usage
+
scriptdir="$(dirname $(readlink -f ${BASH_SOURCE[0]}))"
source $scriptdir/lib.sh
_initialize_work_dirs
scriptdir="$(dirname $(readlink -f ${BASH_SOURCE[0]}))"
source $scriptdir/lib.sh
_initialize_work_dirs
+docker build -f $scriptdir/docker-context/Dockerfile-dib -t dib $scriptdir/docker-context
+docker build -f $scriptdir/docker-context/Dockerfile-buildtools -t buildtools $scriptdir/docker-context
+
# Create manifest RPM
$LIBDIR/create_manifest_rpm.sh
# Create manifest RPM
$LIBDIR/create_manifest_rpm.sh
+# Create RPMs
+if [ -n "$rpm_search_paths" ]; then
+ $LIBDIR/build_rpms.sh $rpm_search_paths
+fi
+
# Create repo config
$LIBDIR/build_step_create_yum_repo_files.sh
# Create repo config
$LIBDIR/build_step_create_yum_repo_files.sh