d6195787 |
#!/bin/bash
# This script build the sources in openshift/origin-release image using
# the Fedora environment and Go compiler. |
614bf6cc |
function absolute_path() { |
1be11fcc |
pushd . > /dev/null
[ -d "$1" ] && cd "$1" && dirs -l +0
popd > /dev/null
}
|
b52db8df |
STARTTIME=$(date +%s) |
614bf6cc |
source "$(dirname "${BASH_SOURCE}")/lib/init.sh" |
d6195787 |
origin_path="src/github.com/openshift/origin" |
1a96a3e1 |
# TODO: Remove this check and fix the docker command instead after the
# following PR is merged: https://github.com/docker/docker/pull/5910
# should be done in docker 1.6.
if [ -d /sys/fs/selinux ]; then |
b5fbaf5a |
if ! ls --context "$(absolute_path $OS_ROOT)" | grep --quiet svirt_sandbox_file_t; then |
72a4398d |
os::text::print_red "Warning: SELinux labels are not set correctly; run chcon -Rt svirt_sandbox_file_t $(absolute_path $OS_ROOT)" |
1a96a3e1 |
exit 1
fi
fi
|
1be11fcc |
docker run -e "OWNER_GROUP=$UID:$GROUPS" --rm -v "$(absolute_path $OS_ROOT):/go/${origin_path}" openshift/origin-release /usr/bin/openshift-origin-build.sh $@ |
b52db8df |
ret=$?; ENDTIME=$(date +%s); echo "$0 took $(($ENDTIME - $STARTTIME)) seconds"; exit "$ret" |