summaryrefslogtreecommitdiffstats
path: root/scripts/ci/gitlab/bitbaker.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/ci/gitlab/bitbaker.sh')
-rwxr-xr-xscripts/ci/gitlab/bitbaker.sh82
1 files changed, 82 insertions, 0 deletions
diff --git a/scripts/ci/gitlab/bitbaker.sh b/scripts/ci/gitlab/bitbaker.sh
new file mode 100755
index 0000000..7e3def1
--- /dev/null
+++ b/scripts/ci/gitlab/bitbaker.sh
@@ -0,0 +1,82 @@
1#!/bin/bash -x
2
3echo "Device --> $DEVICE"
4echo "Platform --> $PLATFORM"
5echo "Test --> $TEST"
6echo "REPO_BRANCH --> $REPO_BRANCH"
7echo "BITBAKE_CACHE -- $BITBAKE_CACHE"
8
9export DEVICE=${DEVICE:-'qemux86-64'}
10export LANG=en_US.UTF-8
11export REPO_BRANCH=${REPO_BRANCH:-'master'}
12
13repo_sync()
14{
15if [ "${PLATFORM}" == "agl" ] || [ "${PLATFORM}" == "AGL" ]
16then
17 repo init -b eel -m default.xml -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo.git
18else
19 repo init -u https://github.com/advancedtelematic/updater-repo.git
20fi
21
22echo "Manifest before update"
23REPO_MANIFEST=".repo/manifests/$REPO_BRANCH.xml"
24cat $REPO_MANIFEST
25
26METAUPDATER_REV=`git rev-parse HEAD`
27
28sed -i 's/meta-updater" remote="github" revision="'$REPO_BRANCH'"/meta-updater" remote="github" revision="'$METAUPDATER_REV'"/' $REPO_MANIFEST
29
30echo "Manifest after update"
31cat $REPO_MANIFEST
32
33repo init -m ${REPO_BRANCH}.xml
34repo sync
35
36if [ "${PLATFORM}" == "agl" ] || [ "${PLATFORM}" == "AGL" ]
37then
38 source meta-agl/scripts/aglsetup.sh -m $DEVICE agl-demo agl-appfw-smack agl-sota
39else
40 source meta-updater/scripts/envsetup.sh $DEVICE
41fi
42}
43
44customize_build()
45{
46CONF_FILE_PATH="conf/local.conf"
47if [ -f "$CONF_FILE_PATH" ]
48then
49 echo "SOTA_PACKED_CREDENTIALS = \"${CI_PROJECT_DIR}/data/credentials.zip\"" >> $CONF_FILE_PATH
50 echo 'OSTREE_BRANCHNAME = "ostree_qemu_from_gitlab"' >> $CONF_FILE_PATH
51 echo "DL_DIR = \"${BITBAKE_CACHE}\"" >> $CONF_FILE_PATH
52 echo "SSTATE_DIR = \"${BITBAKE_CACHE}\"" >> $CONF_FILE_PATH
53 echo 'IMAGE_INSTALL_append = " vim dropbear"' >> $CONF_FILE_PATH
54 echo 'SANITY_TESTED_DISTROS = ""' >> conf/local.conf
55 cat $CONF_FILE_PATH
56else
57 echo "$CONF_FILE_PATH not found."
58 exit 1
59fi
60touch conf/sanity.conf
61}
62
63run_command()
64{
65if [ "${PLATFORM}" == "agl" ] || [ "${PLATFORM}" == "AGL" ]; then
66 bitbake agl-demo-platform
67elif [ "${TEST}" == "oe-selftest" ] || [ "${TEST}" == "OE-SELFTEST" ]; then
68 oe-selftest -r updater
69elif [ "${DEVICE}" == "raspberrypi3" ]; then
70 bitbake rpi-basic-image
71elif [ "${DEVICE}" == "qemux86-64" ]; then
72 bitbake core-image-minimal
73else
74 echo "Unknown parameter provided"
75 exit 1
76fi
77}
78
79repo_sync
80customize_build
81run_command
82df -h \ No newline at end of file