-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
105 lines (101 loc) · 3.88 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
stages:
- build
.build-oe:
image: $CI_REGISTRY/lpt/containers/common-oe-builder:1-0-2
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_DEPTH: 100
GITPORT: 22
ELP_GITLAB: git@gitlab.elpitech.ru
ELP_BITBAKE_URL: ${ELP_GITLAB}:distro/yocto/bitbake.git
ELP_BITBAKE_BRANCH: honister-elp
ELP_BITBAKE_REF: c2d8f9b2137bd4a98eb0f51519493131773e7517
ELP_BAIKAL_T_URL: ${ELP_GITLAB}:distro/yocto/meta-baikal-t.git
ELP_BAIKAL_T_BRANCH: honister-elp
ELP_BAIKAL_T_REF: fc64c701fe84253393fe8257191a04df87657336
ELP_RECOVERY_URL: ${ELP_GITLAB}:distro/yocto/meta-recovery.git
ELP_RECOVERY_BRANCH: honister-elp
ELP_RECOVERY_REF: f0c0ab88fbd61768a3f272e0594fc5faf5d6001b
ELP_OPENEMBEDDED_URL: ${ELP_GITLAB}:distro/yocto/meta-openembedded.git
ELP_OPENEMBEDDED_BRANCH: honister-elp
ELP_OPENEMBEDDED_REF: 0e6c34f82ca4d43cbca3754c5fe37c5b3bdd0f37
ELP_MICROPYTHON_URL: ${ELP_GITLAB}:distro/yocto/meta-micropython.git
ELP_MICROPYTHON_BRANCH: honister-elp
ELP_MICROPYTHON_REF: 856a0bd3302eb27cd530b988721d12eabe0eb4b7
cache:
key: baikal-t-recovery
paths:
- sstate/
script:
- mkdir -p ~/.ssh
- cat $deploy_id | base64 --decode > ~/.ssh/id_rsa
- chmod 700 ~/.ssh/ -R
- chmod 600 ~/.ssh/*
- eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/id_rsa
- ssh-keyscan -p $GITPORT -H "${CI_SERVER_HOST}" >> ~/.ssh/known_hosts
- echo "Prepare bitbake"
- git clone ${ELP_BITBAKE_URL} -b ${ELP_BITBAKE_BRANCH} bitbake
- cd bitbake; git checkout ${ELP_BITBAKE_REF}; cd ../
- echo "Prepare meta-baikal-t"
- git clone ${ELP_BAIKAL_T_URL} -b ${ELP_BAIKAL_T_BRANCH} meta-baikal-t
- cd meta-baikal-t; git checkout ${ELP_BAIKAL_T_REF}; cd ../
- echo "Prepare meta-recovery"
- git clone ${ELP_RECOVERY_URL} -b ${ELP_RECOVERY_BRANCH} meta-recovery
- cd meta-recovery; git checkout ${ELP_RECOVERY_REF}; cd ../
- echo "Prepare meta-openembedded"
- git clone ${ELP_OPENEMBEDDED_URL} -b ${ELP_OPENEMBEDDED_BRANCH} meta-openembedded
- cd meta-openembedded; git checkout ${ELP_OPENEMBEDDED_REF}; cd ../
- echo "Prepare meta-micropython"
- git clone ${ELP_MICROPYTHON_URL} -b ${ELP_MICROPYTHON_BRANCH} meta-micropython
- cd meta-micropython; git checkout ${ELP_MICROPYTHON_REF}; cd ../
- echo "Download cached sources"
- wget -q http://192.168.11.250/dl.tar
- tar xf dl.tar
- PROJECT_DIR=$(pwd)
- DL_DIR="${PROJECT_DIR}/dl"
- echo "Set env"
- export MACHINE=${MACHINE}
- export TEMPLATECONF=meta-recovery/conf
- export BB_NUMBER_THREADS=$(nproc)
- export PARALLEL_MAKE="-j ${BB_NUMBER_THREADS}"
- source oe-init-build-env
- echo "Set path to cached sources"
- |
echo "DL_DIR=\"${DL_DIR}\"" >> conf/local.conf
echo "SSTATE_DIR ?= \"${PROJECT_DIR}/sstate\"" >> conf/local.conf
cat conf/local.conf
- bitbake baikal-image-recovery
- |
BRANCH=""
if [ "$CI_COMMIT_BRANCH" != "$CI_DEFAULT_BRANCH" ]; then
if [ -n "${CI_COMMIT_BRANCH}" ]; then
BRANCH="${CI_COMMIT_BRANCH}_"
fi
fi
VERSION=$(git describe --tags)
echo "Uploading version ${VERSION}"
echo " branch ${BRANCH}"
echo " machine ${MACHINE}"
GIT_TAG=$(git describe --tags --no-abbrev)
FULL_PATH="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/oe-image/${GIT_TAG}/${BRANCH}${MACHINE}_${VERSION}"
echo "Full path: ${FULL_PATH}"
BUILD_DIR=$(pwd)
cd tmp/deploy/images/${MACHINE}/;
ROM=$(ls recovery-${MACHINE}-*.rom)
echo "ROM: ${ROM}"
cd ${BUILD_DIR}
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file tmp/deploy/images/${MACHINE}/${ROM} ${FULL_PATH}.rom
build-mitx:
extends: .build-oe
variables:
MACHINE: mitx
build-et402:
extends: .build-oe
variables:
MACHINE: et402
build-et412:
extends: .build-oe
variables:
MACHINE: et412