Normalized spacing in build-setup.sh
Updated some comments that needed capitalization. Removed use of tabs in
the dockerfiles. Indentations should now be standardized to 2 spaces per
indent. Files preceded by an if statement will now share the indentation
with the exception of the final EOF statement. If line breaks occur in a
statement, like in the dockerfile RUN commands, the line break should
line up with its preceding command.
Change-Id: I514adcf51d64a3597ed5887cdd5c7e050982227c
Signed-off-by: Alanny Lopez <alanny.lopez@ibm.com>
diff --git a/build-setup.sh b/build-setup.sh
index da8cbc3..fad2d7b 100755
--- a/build-setup.sh
+++ b/build-setup.sh
@@ -1,14 +1,14 @@
#!/bin/bash
-# This build script is for running the Jenkins builds using docker.
+# This build script is for running the Jenkins builds using Docker.
#
# It expects a few variables which are part of Jenkins build job matrix:
# target = barreleye|palmetto|qemu
# distro = fedora|ubuntu|ubuntu:14.04|ubuntu:16.04
-# obmcdir = <name of openbmc src dir> (default openbmc)
-# WORKSPACE = <location of base openbmc/openbmc repo>
+# obmcdir = <name of OpenBMC src dir> (default openbmc)
+# WORKSPACE = <location of base OpenBMC/OpenBMC repo>
# BITBAKE_OPTS = <optional, set to "-c populate_sdk" or whatever other
-# bitbake options you'd like to pass into the build>
+# BitBake options you'd like to pass into the build>
# Trace bash processing. Set -e so when a step fails, we fail the build
set -xeo pipefail
@@ -23,9 +23,9 @@
# Determine our architecture, ppc64le or the other one
if [ $(uname -m) == "ppc64le" ]; then
- DOCKER_BASE="ppc64le/"
+ DOCKER_BASE="ppc64le/"
else
- DOCKER_BASE=""
+ DOCKER_BASE=""
fi
# Timestamp for job
@@ -33,16 +33,16 @@
# If there's no openbmc dir in WORKSPACE then just clone in master
if [ ! -d ${WORKSPACE}/${obmcdir} ]; then
- echo "Clone in openbmc master to ${WORKSPACE}/${obmcdir}"
- git clone https://github.com/openbmc/openbmc ${WORKSPACE}/${obmcdir}
+ echo "Clone in openbmc master to ${WORKSPACE}/${obmcdir}"
+ git clone https://github.com/openbmc/openbmc ${WORKSPACE}/${obmcdir}
fi
# if user just passed in ubuntu then use latest
if [[ $distro == "ubuntu" ]]; then
- distro="ubuntu:latest"
+ distro="ubuntu:latest"
fi
-# Work out what build target we should be running and set bitbake command
+# Work out what build target we should be running and set BitBake command
case ${target} in
barreleye)
BITBAKE_CMD="TEMPLATECONF=meta-openbmc-machines/meta-openpower/meta-rackspace/meta-barreleye/conf source oe-init-build-env"
@@ -76,7 +76,7 @@
;;
esac
-# Configure docker build
+# Configure Docker build
if [[ "${distro}" == fedora ]];then
if [[ -n "${http_proxy}" ]]; then
@@ -84,46 +84,46 @@
fi
Dockerfile=$(cat << EOF
-FROM ${DOCKER_BASE}fedora:latest
+ FROM ${DOCKER_BASE}fedora:latest
-${PROXY}
+ ${PROXY}
-# Set the locale
-RUN locale-gen en_US.UTF-8
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
+ # Set the locale
+ RUN locale-gen en_US.UTF-8
+ ENV LANG en_US.UTF-8
+ ENV LANGUAGE en_US:en
+ ENV LC_ALL en_US.UTF-8
-RUN dnf --refresh install -y \
- bzip2 \
- chrpath \
- cpio \
- diffstat \
- findutils \
- gcc \
- gcc-c++ \
- git \
- make \
- patch \
- perl-bignum \
- perl-Data-Dumper \
- perl-Thread-Queue \
- python-devel \
- python3-devel \
- SDL-devel \
- socat \
- subversion \
- tar \
- texinfo \
- wget \
- which
+ RUN dnf --refresh install -y \
+ bzip2 \
+ chrpath \
+ cpio \
+ diffstat \
+ findutils \
+ gcc \
+ gcc-c++ \
+ git \
+ make \
+ patch \
+ perl-bignum \
+ perl-Data-Dumper \
+ perl-Thread-Queue \
+ python-devel \
+ python3-devel \
+ SDL-devel \
+ socat \
+ subversion \
+ tar \
+ texinfo \
+ wget \
+ which
-RUN grep -q ${GROUPS} /etc/group || groupadd -g ${GROUPS} ${USER}
-RUN grep -q ${UID} /etc/passwd || useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} ${USER}
+ RUN grep -q ${GROUPS} /etc/group || groupadd -g ${GROUPS} ${USER}
+ RUN grep -q ${UID} /etc/passwd || useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} ${USER}
-USER ${USER}
-ENV HOME ${HOME}
-RUN /bin/bash
+ USER ${USER}
+ ENV HOME ${HOME}
+ RUN /bin/bash
EOF
)
@@ -133,50 +133,50 @@
fi
Dockerfile=$(cat << EOF
-FROM ${DOCKER_BASE}${distro}
+ FROM ${DOCKER_BASE}${distro}
-${PROXY}
+ ${PROXY}
-ENV DEBIAN_FRONTEND noninteractive
+ ENV DEBIAN_FRONTEND noninteractive
-# Set the locale
-RUN locale-gen en_US.UTF-8
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
+ # Set the locale
+ RUN locale-gen en_US.UTF-8
+ ENV LANG en_US.UTF-8
+ ENV LANGUAGE en_US:en
+ ENV LC_ALL en_US.UTF-8
-RUN apt-get update && apt-get install -yy \
- build-essential \
- chrpath \
- debianutils \
- diffstat \
- gawk \
- git \
- libdata-dumper-simple-perl \
- libsdl1.2-dev \
- libthread-queue-any-perl \
- python \
- python3 \
- socat \
- subversion \
- texinfo \
- cpio \
- wget
+ RUN apt-get update && apt-get install -yy \
+ build-essential \
+ chrpath \
+ debianutils \
+ diffstat \
+ gawk \
+ git \
+ libdata-dumper-simple-perl \
+ libsdl1.2-dev \
+ libthread-queue-any-perl \
+ python \
+ python3 \
+ socat \
+ subversion \
+ texinfo \
+ cpio \
+ wget
-RUN grep -q ${GROUPS} /etc/group || groupadd -g ${GROUPS} ${USER}
-RUN grep -q ${UID} /etc/passwd || useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} ${USER}
+ RUN grep -q ${GROUPS} /etc/group || groupadd -g ${GROUPS} ${USER}
+ RUN grep -q ${UID} /etc/passwd || useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} ${USER}
-USER ${USER}
-ENV HOME ${HOME}
-RUN /bin/bash
+ USER ${USER}
+ ENV HOME ${HOME}
+ RUN /bin/bash
EOF
)
fi
-# Build the docker container
+# Build the Docker container
docker build -t openbmc/${distro} - <<< "${Dockerfile}"
-# Create the docker run script
+# Create the Docker run script
export PROXY_HOST=${http_proxy/#http*:\/\/}
export PROXY_HOST=${PROXY_HOST/%:[0-9]*}
export PROXY_PORT=${http_proxy/#http*:\/\/*:}
@@ -190,7 +190,7 @@
cd ${WORKSPACE}
-# Go into the openbmc directory (the openbmc script will put us in a build subdir)
+# Go into the OpenBMC directory (the openbmc script will put us in a build subdir)
cd ${obmcdir}
# Set up proxies
@@ -200,15 +200,15 @@
mkdir -p ${WORKSPACE}/bin
-# Configure proxies for bitbake
+# Configure proxies for BitBake
if [[ -n "${http_proxy}" ]]; then
cat > ${WORKSPACE}/bin/git-proxy << \EOF_GIT
-#!/bin/bash
-# \$1 = hostname, \$2 = port
-PROXY=${PROXY_HOST}
-PROXY_PORT=${PROXY_PORT}
-exec socat STDIO PROXY:\${PROXY}:\${1}:\${2},proxyport=\${PROXY_PORT}
+ #!/bin/bash
+ # \$1 = hostname, \$2 = port
+ PROXY=${PROXY_HOST}
+ PROXY_PORT=${PROXY_PORT}
+ exec socat STDIO PROXY:\${PROXY}:\${1}:\${2},proxyport=\${PROXY_PORT}
EOF_GIT
chmod a+x ${WORKSPACE}/bin/git-proxy
@@ -218,16 +218,16 @@
mkdir -p ~/.subversion
cat > ~/.subversion/servers << EOF_SVN
-[global]
-http-proxy-host = ${PROXY_HOST}
-http-proxy-port = ${PROXY_PORT}
+ [global]
+ http-proxy-host = ${PROXY_HOST}
+ http-proxy-port = ${PROXY_PORT}
EOF_SVN
fi
# Source our build env
${BITBAKE_CMD}
-# Custom bitbake config settings
+# Custom BitBake config settings
cat >> conf/local.conf << EOF_CONF
BB_NUMBER_THREADS = "$(nproc)"
PARALLEL_MAKE = "-j$(nproc)"
@@ -246,7 +246,7 @@
chmod a+x ${WORKSPACE}/build.sh
-# Run the docker container, execute the build script we just built
+# Run the Docker container, execute the build script we just built
docker run --cap-add=sys_admin --net=host --rm=true -e WORKSPACE=${WORKSPACE} --user="${USER}" \
-w "${HOME}" -v "${HOME}":"${HOME}" -t openbmc/${distro} ${WORKSPACE}/build.sh
@@ -254,5 +254,4 @@
ln -sf ${WORKSPACE}/openbmc/build/tmp/deploy/images ${WORKSPACE}/images
# Timestamp for build
-echo "Build completed, $(date)"
-
+echo "Build completed, $(date)"
\ No newline at end of file