Move CI infra tizen build script (#4578)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 5 Mar 2019 10:21:00 +0000 (19:21 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 5 Mar 2019 10:21:00 +0000 (19:21 +0900)
Move CI infra tizen cross build and gbs build script from script/command

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
scripts/ci/docker_build_tizen_cross.sh [new file with mode: 0755]
scripts/ci/docker_build_tizen_gbs.sh [new file with mode: 0755]

diff --git a/scripts/ci/docker_build_tizen_cross.sh b/scripts/ci/docker_build_tizen_cross.sh
new file mode 100755 (executable)
index 0000000..8f79ecf
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ROOT_PATH="$CURRENT_PATH/../../"
+
+# prepare rootfs
+if [[ ! -d $ROOTFS_DIR ]]; then
+  echo "cannot find rootfs"
+  exit 1
+fi
+
+DOCKER_VOLUMES=" -v $ROOTFS_DIR/:/opt/rootfs"
+export DOCKER_VOLUMES
+
+# docker image name
+if [[ -z $DOCKER_IMAGE_NAME ]]; then
+  echo "It will use default docker image name"
+else
+  export DOCKER_IMAGE_NAME
+fi
+
+DOCKER_ENV_VARS=" -e TARGET_ARCH=armv7l"
+DOCKER_ENV_VARS+=" -e CROSS_BUILD=1"
+DOCKER_ENV_VARS+=" -e ROOTFS_DIR=/opt/rootfs"
+DOCKER_ENV_VARS+=" -e TARGET_OS=tizen"
+DOCKER_ENV_VARS+=" -e BUILD_TYPE=release"
+# Disable arm compute build (use rootfs)
+DOCKER_ENV_VARS+=" -e OPTIONS=-DBUILD_ARMCOMPUTE=OFF"
+
+# Mirror server setting
+if [[ -z $EXTERNAL_DOWNLOAD_SERVER ]]; then
+  echo "It will not use mirror server"
+else
+  DOCKER_ENV_VARS+=" -e EXTERNAL_DOWNLOAD_SERVER=$EXTERNAL_DOWNLOAD_SERVER"
+fi
+export DOCKER_ENV_VARS
+
+pushd $ROOT_PATH > /dev/null
+
+CMD="make && \
+     make install && \
+     make build_test_suite"
+source run docker-run-user bash -c "$CMD"
+
+popd > /dev/null
diff --git a/scripts/ci/docker_build_tizen_gbs.sh b/scripts/ci/docker_build_tizen_gbs.sh
new file mode 100755 (executable)
index 0000000..028c323
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ROOT_PATH="$CURRENT_PATH/../../"
+
+GBS_RPM_DIR=$ROOT_PATH/Product/out/rpm
+mkdir -p $GBS_RPM_DIR
+DOCKER_VOLUMES=" -v $GBS_RPM_DIR:/opt/rpm"
+export DOCKER_VOLUMES
+
+if [[ -z $DOCKER_IMAGE_NAME ]]; then
+  echo "It will use default docker image name for tizen gbs build"
+  export DOCKER_IMAGE_NAME="nnfw_docker_tizen"
+else
+  export DOCKER_IMAGE_NAME
+fi
+
+DOCKER_ENV_VARS=" --privileged"
+export DOCKER_ENV_VARS
+
+pushd $ROOT_PATH > /dev/null
+
+CMD="gbs -c $ROOT_PATH/scripts/config/gbs.conf build \
+         -A armv7l --profile=profile.tizen --clean --include-all --define '$GBS_DEFINE' && \
+     cp -rf /home/GBS-ROOT/local/repos/tizen/armv7l/RPMS/*.rpm /opt/rpm/"
+source run docker-run bash -c "$CMD"
+
+popd > /dev/null