use https:// instead of git://
[GitLab/stricted-build/android_build.git] / .gitlab-ci.yml
CommitLineData
2573b822
S
1build:
2 variables:
3 USE_CCACHE: "1"
4 CCACHE_COMPRESS: "1"
5 # the following are added when triggered from API
6 # VERSION
7 # DEVICE
8 # TYPE
9 # OTA
10 # CLEAN
11 # REPOPICK_NUMBERS
12 # REPOPICK_TOPICS
13
14 script:
15 - |
3a8a0f86 16 sudo update-alternatives --set python /usr/bin/python3
3e12932e 17 PATH="/home/build/bin:$PATH"
2349c47d
JA
18 if [ ${VERSION} = '17.1' ]; then
19 export CCACHE_EXEC=$(which ccache)
20 export WITHOUT_CHECK_API=true
21 fi
2573b822
S
22 PATH="$HOME/bin:$PATH"
23 if [ ${OTA} = 'false' ]; then
24 export LINEAGE_VERSION_APPEND_TIME_OF_DAY=true
25 fi
2349c47d
JA
26 if [ -f ~/android/lineage/${VERSION} ]; then
27 cd ~/android/lineage/${VERSION}
28 else
29 mkdir -p ~/android/lineage/${VERSION}
30 cd ~/android/lineage/${VERSION}
31 if [ ${VERSION} = '14.1' ]; then
53bb76ef 32 repo init -u https://github.com/LineageOS/android.git -b cm-${VERSION}
2349c47d 33 else
53bb76ef 34 repo init -u https://github.com/LineageOS/android.git -b lineage-${VERSION}
2349c47d
JA
35 fi
36 fi
2573b822 37 rm -rf .repo/local_manifests/*
2349c47d 38 cp ${CI_PROJECT_DIR}/manifests/lineage-${VERSION}.xml .repo/local_manifests/roomservice.xml
2573b822
S
39 repo sync -d -c -j8 --force-sync
40 . build/envsetup.sh
41 if ! [ -z ${REPOPICK_NUMBERS} ]; then
42 for rpnum in ${REPOPICK_NUMBERS//,/ }; do
43 repopick -fr $rpnum
44 done
45 else
46 echo "No repopick numbers chosen"
47 fi
48 if ! [ -z ${REPOPICK_TOPICS} ]; then
49 for rptopic in ${REPOPICK_TOPICS//,/ }; do
50 repopick -fr -t $rptopic
51 done
52 else
53 echo "No repopick topics chosen"
54 fi
55 if [ -f device/*/${DEVICE}/patches/patch.sh ]; then
56 device/*/${DEVICE}/patches/patch.sh
57 fi
3a8a0f86
JA
58 if [ ${VERSION} = '14.1' ]; then
59 sudo update-alternatives --set python /usr/bin/python2.7
60 fi
2573b822
S
61 if [ ${CLEAN} = 'true' ]; then
62 make clean
63 else
64 echo "skip cleaning"
65 fi
66 if [ ${VERSION} = '14.1' ] || [ ${VERSION} = '15.1' ]; then
67 ./prebuilts/sdk/tools/jack-admin list-server && ./prebuilts/sdk/tools/jack-admin kill-server
68 rm -rf ~/.jack*
69 ./prebuilts/sdk/tools/jack-admin install-server ./prebuilts/sdk/tools/jack-launcher.jar ./prebuilts/sdk/tools/jack-server-*.jar
70 export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx12g"
71 ./prebuilts/sdk/tools/jack-admin start-server
72 fi
73 lunch lineage_${DEVICE}-${TYPE}
74 cmka bacon
75 if [ ${VERSION} = '14.1' ] || [ ${VERSION} = '15.1' ]; then
76 ./prebuilts/sdk/tools/jack-admin list-server && ./prebuilts/sdk/tools/jack-admin kill-server
77 fi
78 zipname=$(find out/target/product/${DEVICE}/ -name 'lineage-'${VERSION}'-*.zip' -type f -printf "%f\\n")
79 if [ ${OTA} = 'true' ]; then
80 ssh web52@stricted.net "mkdir -p /var/www/web52/htdocs/lineageos/${DEVICE}/"
81 scp out/target/product/${DEVICE}/$zipname web52@stricted.net:/var/www/web52/htdocs/lineageos/${DEVICE}/
82 ssh web52@stricted.net "cd /var/www/web52/htdocs/lineageos/${DEVICE}/ && sha256sum $zipname > $zipname.sha256sum"
83 ssh web52@stricted.net "php priv/gen_builds_json.php"
84 else
85 ssh web52@stricted.net "mkdir -p /var/www/web52/htdocs/test/${DEVICE}/"
86 scp out/target/product/${DEVICE}/$zipname web52@stricted.net:/var/www/web52/htdocs/test/${DEVICE}/
87 fi
88 only:
89 - triggers
90 - web