From 2573b822866e6235ef139c983c57a8a7b252ca87 Mon Sep 17 00:00:00 2001 From: Stricted Date: Fri, 9 Nov 2018 21:40:28 +0100 Subject: [PATCH 1/1] initial build script Change-Id: I73f348947ed16d5e1427ad02293a4729f1f76186 --- .gitlab-ci.yml | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..1e93bdf --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,71 @@ +build: + variables: + USE_CCACHE: "1" + CCACHE_COMPRESS: "1" + # the following are added when triggered from API + # VERSION + # DEVICE + # TYPE + # OTA + # CLEAN + # REPOPICK_NUMBERS + # REPOPICK_TOPICS + + script: + - | + PATH="$HOME/bin:$PATH" + if [ ${OTA} = 'false' ]; then + export LINEAGE_VERSION_APPEND_TIME_OF_DAY=true + fi + cd ~/android/lineage/${VERSION} + rm -rf .repo/local_manifests/* + cp ${CI_PROJECT_DIR}/manifests/lineage-${VERSION}-${DEVICE}.xml .repo/local_manifests/roomservice.xml + repo sync -d -c -j8 --force-sync + . build/envsetup.sh + if ! [ -z ${REPOPICK_NUMBERS} ]; then + for rpnum in ${REPOPICK_NUMBERS//,/ }; do + repopick -fr $rpnum + done + else + echo "No repopick numbers chosen" + fi + if ! [ -z ${REPOPICK_TOPICS} ]; then + for rptopic in ${REPOPICK_TOPICS//,/ }; do + repopick -fr -t $rptopic + done + else + echo "No repopick topics chosen" + fi + if [ -f device/*/${DEVICE}/patches/patch.sh ]; then + device/*/${DEVICE}/patches/patch.sh + fi + if [ ${CLEAN} = 'true' ]; then + make clean + else + echo "skip cleaning" + fi + if [ ${VERSION} = '14.1' ] || [ ${VERSION} = '15.1' ]; then + ./prebuilts/sdk/tools/jack-admin list-server && ./prebuilts/sdk/tools/jack-admin kill-server + rm -rf ~/.jack* + ./prebuilts/sdk/tools/jack-admin install-server ./prebuilts/sdk/tools/jack-launcher.jar ./prebuilts/sdk/tools/jack-server-*.jar + export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx12g" + ./prebuilts/sdk/tools/jack-admin start-server + fi + lunch lineage_${DEVICE}-${TYPE} + cmka bacon + if [ ${VERSION} = '14.1' ] || [ ${VERSION} = '15.1' ]; then + ./prebuilts/sdk/tools/jack-admin list-server && ./prebuilts/sdk/tools/jack-admin kill-server + fi + zipname=$(find out/target/product/${DEVICE}/ -name 'lineage-'${VERSION}'-*.zip' -type f -printf "%f\\n") + if [ ${OTA} = 'true' ]; then + ssh web52@stricted.net "mkdir -p /var/www/web52/htdocs/lineageos/${DEVICE}/" + scp out/target/product/${DEVICE}/$zipname web52@stricted.net:/var/www/web52/htdocs/lineageos/${DEVICE}/ + ssh web52@stricted.net "cd /var/www/web52/htdocs/lineageos/${DEVICE}/ && sha256sum $zipname > $zipname.sha256sum" + ssh web52@stricted.net "php priv/gen_builds_json.php" + else + ssh web52@stricted.net "mkdir -p /var/www/web52/htdocs/test/${DEVICE}/" + scp out/target/product/${DEVICE}/$zipname web52@stricted.net:/var/www/web52/htdocs/test/${DEVICE}/ + fi + only: + - triggers + - web -- 2.20.1