Advertisement
RobertBerger

03-use-uninative-core-image-minimal-populate-sstate-mirror.yml

Jun 18th, 2023
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.03 KB | None | 0 0
  1. name: release-use-uninative-core-image-minimal-populate-sstate-mirror
  2.  
  3. #on: [push]
  4.  
  5. on:
  6. workflow_call:
  7.  
  8. jobs:
  9. release-use-uninative-core-image-minimal-populate-sstate-mirror:
  10. runs-on: yocto-build-latest
  11. timeout-minutes: 1000
  12. # Specify location to build, this path persists across builds allowing
  13. # us to build incrementally
  14. env:
  15. WORK_DIR: ${{github.workspace}}/workdir
  16. GITEA_GIT_MIRROR: 10.0.0.182:8939
  17. GITEA_SERVER: 10.0.0.182:8940
  18. WORKFLOW_DIR: yocto-build-docker-action
  19. WORKFLOW_REPO: rber/${{env.WORKFLOW_DIR}}
  20. MANIFEST_REPO: rber/manifests -b master-action
  21. YP_CONFIG: multi-v7-ml-debug-training
  22. YP_VERSION: langdale
  23. ARTIFACTS_ON_SERVER: /appdata/artifacts/workspace/rber/yocto-build-docker-action/workdir/artifacts
  24. NO_SSTATE_MIRRORS: yes
  25. POPULATE_SSTATE_MIRROR: yes
  26. # used for local source mirror:
  27. USE_VAR_WWW: no
  28. PREP_SOURCE_MIRROR: no
  29. # --> only one yes, the other no
  30. NO_SOURCE_MIRROR: no
  31. USE_SOURCE_MIRROR: yes
  32. USE_SOURCE_MIRROR_LOCAL: no
  33. # <-- only one yes, the other no
  34. USE_BB_NO_NETWORK: no
  35. USE_BB_ALLOWED_NETWORKS: no
  36. THE_ALLOWED_NETWORKS: 10.0.0.182
  37. # --> only one yes, the other no
  38. NO_PREMIRRORS: no
  39. USE_PREMIRRORS: yes
  40. # <-- only one yes, the other no
  41. # --> only one yes, the other no
  42. BUILD_UNINATIVE_TARBALL: no
  43. USE_UNINATIVE_TARBALL: yes
  44. DONT_USE_UNINATIVE_TARBALL: no
  45. POPULATE_UNINATIVE_TARBALL: no
  46. UNINATIVE_TARBALL_VERSION: 3.7
  47. #BITBAKE_ZERO: uninative-tarball
  48. #BITBAKE_ZERO: 'uninative-tarball --runall=fetch'
  49. BITBAKE_ZERO: empty
  50. BITBAKE_ZERO_ALLOW_ERROR: no
  51. # <-- only one yes, the other no
  52. THE_UNINATIVE_URL: http://${{env.WEB_SERVER}}/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}/
  53. THE_SOURCE_MIRROR_URL: http://${{env.WEB_SERVER}}/source_mirror_${{env.YP_VERSION}}
  54. USE_PR_SERVER: yes
  55. PR_SERVER: 10.0.0.182:18585
  56. USE_HASH_SERVER: yes
  57. HASH_SERVER: 10.0.0.182:8687
  58. # lighttpd:
  59. WEB_SERVER: 10.0.0.182:8941
  60. # nginx:
  61. #WEB_SERVER: 10.0.0.182:8053
  62. BITBAKE_ONE: core-image-minimal
  63. #BITBAKE_ONE: 'core-image-minimal --runall=fetch'
  64. #BITBAKE_ONE: empty
  65. BITBAKE_ONE_ALLOW_ERROR: no
  66. BITBAKE_TWO: empty
  67. NOTE: use-uninative-core-image-minimal-populate-sstate-mirror
  68. #name: Yocto build - core-image-minimal-local-source-mirror
  69. steps:
  70. - name: Get build system info
  71. id: build_system
  72. run: |
  73. echo "Host: ${HOSTNAME}"
  74. echo "CPUs/Threads: $(grep -c ^processor /proc/cpuinfo)"
  75. echo "CPUs: $(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')"
  76. echo "$(free -mh)"
  77. - name: Get current date/time
  78. id: date
  79. run: |
  80. echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')"
  81. - name: Get gitea git mirror
  82. id: gitea_git_mirror
  83. run: |
  84. echo "::set-output name=gitea_git_mirror::${{env.GITEA_GIT_MIRROR}}"
  85. - name: Get gitea server
  86. id: gitea_server
  87. run: |
  88. echo "::set-output name=gitea_server::${{env.GITEA_SERVER}}"
  89. - name: Get workflow repo
  90. id: workflow_repo
  91. run: |
  92. echo "::set-output name=workflow_repo::${{env.WORKFLOW_REPO}}"
  93. - name: Get manifest repo
  94. id: manifest_repo
  95. run: |
  96. echo "::set-output name=manifest_repo::${{env.MANIFEST_REPO}}"
  97. - name: Get Yocto Project config
  98. id: yp_config
  99. run: |
  100. echo "::set-output name=yp_config::${{env.YP_CONFIG}}"
  101. - name: get Yocto Project version
  102. id: yp_version
  103. run: |
  104. echo "::set-output name=yp_version::${{env.YP_VERSION}}"
  105. - name: get PR server
  106. id: pr_server
  107. run: |
  108. echo "::set-output name=pr_server::${{env.PR_SERVER}}"
  109. - name: get hash server
  110. id: hash_server
  111. run: |
  112. echo "::set-output name=hash_server::${{env.HASH_SERVER}}"
  113. - name: get web server
  114. id: web_server
  115. run: |
  116. echo "::set-output name=web_server::${{env.WEB_SERVER}}"
  117. - name: get THE_UNINATIVE_URL
  118. id: uninative_url
  119. run: |
  120. echo "::set-output name=uninative_url::${{env.THE_UNINATIVE_URL}}"
  121. - name: get Note
  122. id: note
  123. run: |
  124. echo "::set-output name=note::${{env.NOTE}}"
  125. - name: Get bitbake_zero
  126. id: bitbake_zero
  127. run: |
  128. echo "::set-output name=bitbake_zero::${{env.BITBAKE_ZERO}}"
  129. - name: Get bitbake_one
  130. id: bitbake_one
  131. run: |
  132. echo "::set-output name=bitbake_one::${{env.BITBAKE_ONE}}"
  133. - name: Get bitbake_two
  134. id: bitbake_two
  135. run: |
  136. echo "::set-output name=bitbake_two::${{env.BITBAKE_TWO}}"
  137. - name: Checkout workflow repo
  138. run: |
  139. mkdir -p ${{env.WORK_DIR}}/sources
  140. pushd ${{env.WORK_DIR}}/sources
  141. git clone http://${{ steps.gitea_server.outputs.gitea_server }}/${{ steps.workflow_repo.outputs.workflow_repo }}
  142. ls
  143. popd
  144. - name: Checkout manifest repo
  145. run: |
  146. mkdir -p ${{env.WORK_DIR}}/sources
  147. pushd ${{env.WORK_DIR}}/sources
  148. git clone http://${{ steps.gitea_server.outputs.gitea_server }}/${{ steps.manifest_repo.outputs.manifest_repo }}
  149. ls
  150. popd
  151. - name: Create symlinks
  152. run: |
  153. cd ${{env.WORK_DIR}}
  154. ln -sf sources/manifests/resy-cooker.sh resy-cooker.sh
  155. ln -sf sources/manifests/killall_bitbake.sh killall_bitbake.sh
  156. ln -sf sources/manifests/resy-${{ steps.yp_config.outputs.yp_config }}.sh resy-${{ steps.yp_config.outputs.yp_config }}.sh
  157. pwd
  158. ls
  159. - name: Checkout repos for ${{ env.YP_CONFIG }}
  160. run: |
  161. pushd ${{env.WORK_DIR}}
  162. ls
  163. ./resy-${{ steps.yp_config.outputs.yp_config }}.sh
  164. #tree -L 1 sources
  165. popd
  166. env:
  167. # export WORKDIR to resy-cooker.sh script:
  168. WORKDIR: ${{ env.WORK_DIR }}
  169. WORKSPACE: "jenkins"
  170. - name: Fix broken links
  171. run: |
  172. pushd ${{env.WORK_DIR}}
  173. echo "--> broken links"
  174. find . -xtype l -ls
  175. echo "<-- broken links"
  176. echo "--> fix links"
  177. find . -xtype l -exec bash -c 'target="$(readlink "{}")"; link="{}"; target="$(echo "$target" | sed "s,/workdir,${{ env.WORK_DIR }},g")"; ln -Tfs "$target" "$link"' \;
  178. echo "<-- fix links"
  179. echo "--> broken links"
  180. find . -xtype l -ls
  181. echo "<-- broken links"
  182. popd
  183. env:
  184. # export WORKDIR to resy-cooker.sh script:
  185. WORKDIR: ${{ env.WORK_DIR }}
  186. WORKSPACE: "jenkins"
  187. - name: Fix site.conf file
  188. run: |
  189. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  190. sed -i "s,/workdir,${{ env.WORK_DIR }}," site.conf
  191. sed -i "s,/mirror/,/${{ steps.web_server.outputs.web_server }}/," site.conf
  192. sed -i "s,/mirror.res.training,/${{ steps.web_server.outputs.web_server }}/," site.conf
  193. cat site.conf
  194. popd
  195. - name: Fix site.conf file - hash server
  196. if: ${{ env.USE_HASH_SERVER == 'yes' }}
  197. run: |
  198. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  199. sed -i "s,mirror:8687,${{ steps.hash_server.outputs.hash_server }}," site.conf
  200. cat site.conf
  201. popd
  202. - name: Fix site.conf file - no SSTATE/MIRRORS,...
  203. if: ${{ env.NO_SSTATE_MIRRORS == 'yes' }}
  204. run: |
  205. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  206. sed -i 's/^SSTATE_MIRRORS/#&/' site.conf
  207. sed -i 's/^BB_HASHSERVE_UPSTREAM/#&/' site.conf
  208. cat site.conf
  209. popd
  210. - name: Fix site.conf file - prep. build uninative-tarball
  211. if: ${{ env.BUILD_UNINATIVE_TARBALL == 'yes' }}
  212. run: |
  213. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  214. # I guess we need my uninative tarball URL to build the uninative tarball
  215. sed -i 's/^UNINATIVE_URL/#&/' site.conf
  216. echo "UNINATIVE_TARBALL=\"\"" >> site.conf
  217. # echo "UNINATIVE_CHECKSUM[x86_64]=\"deadbeef\"" >> site.conf
  218. # SRC_URI[sha256sum] = "8a6e588cc3435b9d9c87845b931ed17df7956eed29fd171aec05fbc557da6e7a"
  219. echo "UNINATIVE_CHECKSUM[x86_64]=\"954182f691bb2dbae157ee991654ad2fd4cb51c7f3d3ab429e9f84654c8dc990\"" >> site.conf
  220. cat site.conf
  221. popd
  222. - name: Fix site.conf file - use uninative-tarball
  223. if: ${{ env.USE_UNINATIVE_TARBALL == 'yes' }}
  224. run: |
  225. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  226. echo "${{ steps.uninative_url.outputs.uninative_url }}/sha256sum.txt"
  227. time wget -t 2 -T 30 --passive-ftp "${{ steps.uninative_url.outputs.uninative_url }}/sha256sum.txt"
  228. cat sha256sum.txt
  229. UNINATIVE_SHA256SUM=$(cat sha256sum.txt)
  230. echo "uninative_sha256sum: ${UNINATIVE_SHA256SUM}"
  231. echo "UNINATIVE_CHECKSUM[x86_64]=\"${UNINATIVE_SHA256SUM}\"" >> site.conf
  232. cat site.conf
  233. popd
  234. - name: Fix site.conf file - don't use uninative-tarball
  235. if: ${{ env.DONT_USE_UNINATIVE_TARBALL == 'yes' }}
  236. run: |
  237. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  238. sed -i 's/^UNINATIVE_URL/#&/' site.conf
  239. cat site.conf
  240. popd
  241. - name: Fix site.conf file - PR server
  242. if: ${{ env.USE_PR_SERVER == 'yes' }}
  243. run: |
  244. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  245. sed -i "s,localhost:0,${{ steps.pr_server.outputs.pr_server }}," site.conf
  246. cat site.conf
  247. popd
  248. - name: Fix site.conf file - no PREMIRRORS
  249. if: ${{ env.NO_PREMIRRORS == 'yes' }}
  250. run: |
  251. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  252. sed -i "/PREMIRRORS +=/,+5 s/^/#/" site.conf
  253. cat site.conf
  254. popd
  255. - name: Fix site.conf file - use PREMIRRORS
  256. if: ${{ env.USE_PREMIRRORS == 'yes' }}
  257. run: |
  258. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  259. # we comment out the previous PREMIRRORS
  260. sed -i "/PREMIRRORS +=/,+5 s/^/#/" site.conf
  261. # we add our new PREMIRRORS
  262. # PREMIRRORS += " \
  263. # git://git.denx.de/u-boot.git git://omv-1:8939/robert.berger/u-boot.git;protocol=http \n \
  264. # git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git git://omv-1:8939/robert.berger/linux-stable.git;protocol=http \n \
  265. # git://git.yoctoproject.org/linux-yocto.git git://omv-1.res.training:8939/robert.berger/linux-yocto.git;protocol=http \n \
  266. # git://git.yoctoproject.org/yocto-kernel-cache git://omv-1:8939/robert.berger/yocto-kernel-cache.git;protocol=http \n \
  267. # git://github.com/raspberrypi/linux.git git://omv-1:8939/robert.berger/raspberrypi-linux.git;protocol=http \n \
  268. #"
  269. echo "PREMIRRORS += \" \\" >> site.conf
  270. echo "git://git.denx.de/u-boot.git git://${{ steps.gitea_git_mirror.outputs.gitea_git_mirror }}/robert.berger/u-boot.git;protocol=http \\n \\" >> site.conf
  271. echo "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git git://${{ steps.gitea_git_mirror.outputs.gitea_git_mirror }}/robert.berger/linux-stable.git;protocol=http \\n \\" >> site.conf
  272. echo "git://git.yoctoproject.org/linux-yocto.git git://${{ steps.gitea_git_mirror.outputs.gitea_git_mirror }}/robert.berger/linux-yocto.git;protocol=http \\n \\" >> site.conf
  273. echo "git://git.yoctoproject.org/yocto-kernel-cache git://${{ steps.gitea_git_mirror.outputs.gitea_git_mirror }}/robert.berger/yocto-kernel-cache.git;protocol=http \\n \\" >> site.conf
  274. echo "git://github.com/raspberrypi/linux.git git://${{ steps.gitea_git_mirror.outputs.gitea_git_mirror }}/robert.berger/raspberrypi-linux.git;protocol=http \\n \\" >> site.conf
  275. echo "\"" >> site.conf
  276. cat site.conf
  277. popd
  278. - name: Fix site.conf file - no SOURCE_MIRROR
  279. if: ${{ env.NO_SOURCE_MIRROR == 'yes' }}
  280. run: |
  281. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  282. #sed -i 's/^BB_GENERATE_MIRROR_TARBALLS/#&/' site.conf
  283. sed -i 's/^SOURCE_MIRROR_URL/#&/' site.conf
  284. sed -i "s,own-mirrors,," site.conf
  285. cat site.conf
  286. popd
  287. - name: Fix site.conf file - use SOURCE_MIRROR
  288. if: ${{ env.USE_SOURCE_MIRROR == 'yes' }}
  289. run: |
  290. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  291. #sed -i 's/^BB_GENERATE_MIRROR_TARBALLS/#&/' site.conf
  292. #sed -i 's/^SOURCE_MIRROR_URL/#&/' site.conf
  293. #sed -i "s,own-mirrors,," site.conf
  294. echo "INHERIT += \"own-mirrors\"" >> site.conf
  295. # SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
  296. echo "SOURCE_MIRROR_URL = \"http://${{env.THE_SOURCE_MIRROR_URL}}\"" >> site.conf
  297. echo "SRCREV:pn-ascii-invaders = \"2644be38afc06f7f7bba55034966dd66d9ad524f\"" >> site.conf
  298. cat site.conf
  299. popd
  300. - name: Fix site.conf file - use SOURCE_MIRROR_LOCAL
  301. if: ${{ env.USE_SOURCE_MIRROR_LOCAL == 'yes' }}
  302. run: |
  303. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  304. #sed -i 's/^BB_GENERATE_MIRROR_TARBALLS/#&/' site.conf
  305. sed -i 's/^SOURCE_MIRROR_URL/#&/' site.conf
  306. #sed -i "s,own-mirrors,," site.conf
  307. # SOURCE_MIRROR_URL syntax:
  308. # SOURCE_MIRROR_URL ?= "file:///workdir/source_mirror_langdale/"
  309. # 3 - Three slashes
  310. echo "INHERIT += \"own-mirrors\"" >> site.conf
  311. echo "SOURCE_MIRROR_URL = \"file://${{env.WORK_DIR}}/source_mirror/\"" >> site.conf
  312. echo "SRCREV:pn-ascii-invaders = \"2644be38afc06f7f7bba55034966dd66d9ad524f\"" >> site.conf
  313. cat site.conf
  314. popd
  315. - name: Fix site.conf file - BB_NO_NETWORK
  316. if: ${{ env.USE_BB_NO_NETWORK == 'yes' }}
  317. run: |
  318. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  319. echo "BB_NO_NETWORK = \"1\"" >> site.conf
  320. cat site.conf
  321. popd
  322. - name: Fix site.conf file - BB_ALLOWED_NETWORKS
  323. if: ${{ env.USE_BB_ALLOWED_NETWORKS == 'yes' }}
  324. run: |
  325. pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
  326. echo "BB_ALLOWED_NETWORKS = \"${{ env.THE_ALLOWED_NETWORKS }}\"" >> site.conf
  327. echo "SRCREV:pn-ascii-invaders = \"2644be38afc06f7f7bba55034966dd66d9ad524f\"" >> site.conf
  328. cat site.conf
  329. popd
  330. - name: Fix site.conf file - VAR_WWW - BB_NO_NETWORK needed
  331. if: ${{ env.USE_VAR_WWW == 'yes' }}
  332. run: |
  333. mkdir -p ${{env.WORK_DIR}}/source_mirror
  334. pushd ${{env.WORK_DIR}}
  335. time wget -t 2 -T 30 --passive-ftp 'http://${{ steps.web_server.outputs.web_server }}/source_mirror_${{ steps.yp_version.outputs.yp_version }}_compressed/DL_DIR.tar.gz'
  336. tar xvf DL_DIR.tar.gz -C ${{env.WORK_DIR}}/source_mirror
  337. if [ ! -d ${{env.WORK_DIR}}/artifacts ];then mkdir -p ${{env.WORK_DIR}}/artifacts ; fi
  338. cp DL_DIR.tar.gz ${{env.WORK_DIR}}/artifacts/${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-source_mirror_${{ steps.yp_version.outputs.yp_version }}_compressed.tar.gz
  339. rm -f DL_DIR.tar.gz
  340. #echo "BB_ALLOWED_NETWORKS = \"${{ env.THE_ALLOWED_NETWORKS }}\"" >> site.conf
  341. #echo "SRCREV:pn-ascii-invaders = \"2644be38afc06f7f7bba55034966dd66d9ad524f\"" >> site.conf
  342. #cat site.conf
  343. popd
  344. # - name: Fix site.conf symlinks
  345. # run: |
  346. # pushd ${{env.WORK_DIR}}
  347. # popd
  348. # env:
  349. # # export WORKDIR to resy-cooker.sh script:
  350. # WORKDIR: ${{ env.WORK_DIR }}
  351. # WORKSPACE: "jenkins"
  352. - name: Compress Artifacts before build
  353. run: |
  354. if [ ! -d ${{env.WORK_DIR}}/artifacts ];then mkdir -p ${{env.WORK_DIR}}/artifacts ; fi
  355. pushd ${{env.WORK_DIR}}/artifacts
  356. if [ -d ${{env.WORK_DIR}}/sources/meta-resy/template-common ];then tar -czvf ${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-meta-resy-template-common.tar.gz -C ${{env.WORK_DIR}}/sources/meta-resy/template-common .; fi
  357. if [ -d ${{env.WORK_DIR}}/sources ]; then tar -czvf ${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-sources.tar.gz -C ${{env.WORK_DIR}}/sources .; fi
  358. pwd
  359. ls -lah ${{env.WORK_DIR}}/artifacts
  360. popd
  361. ####################### --> not supported yet ???
  362. # - name: Upload Artifact
  363. # uses: actions/upload-artifact@v3
  364. # with:
  365. # name: test
  366. # path: ${{env.WORK_DIR}}/artifacts
  367. ####################### <-- not supported yet ???
  368. - name: Copy artifacts before build
  369. uses: https://github.com/appleboy/scp-action@v0.1.4
  370. with:
  371. host: ${{ secrets.SCP_HOST }}
  372. username: ${{ secrets.SCP_USERNAME }}
  373. password: ${{ secrets.SCP_PASSWORD }}
  374. port: ${{ secrets.SCP_PORT }}
  375. source: "${{env.WORK_DIR}}/artifacts/*"
  376. target: /appdata/artifacts
  377. #######################################
  378. # - name: bitbake uninative-tarball
  379. # if: ${{ env.BUILD_UNINATIVE_TARBALL == 'yes' }}
  380. # run: |
  381. # cd ${{env.WORK_DIR}}
  382. # time ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} uninative-tarball
  383. # env:
  384. # # export WORKDIR to resy-cooker.sh script:
  385. # WORKDIR: ${{ env.WORK_DIR }}
  386. # WORKSPACE: "jenkins"
  387. #######################################
  388. - name: bitbake ${{ env.BITBAKE_ZERO }} - uninative-tarball?
  389. run: |
  390. if [ "$BITBAKE_ZERO" == "empty" ]; then
  391. echo "BITBAKE_ZERO is $BITBAKE_ZERO"
  392. else
  393. echo "BITBAKE_ZERO is $BITBAKE_ZERO"
  394. cd ${{env.WORK_DIR}}
  395. if [ "$BITBAKE_ZERO_ALLOW_ERROR" == "yes" ]; then
  396. # allow error:
  397. time ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} ${{ steps.bitbake_zero.outputs.bitbake_zero }} || true
  398. else
  399. # don't allow error:
  400. time ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} ${{ steps.bitbake_zero.outputs.bitbake_zero }}
  401. fi
  402. fi
  403. env:
  404. # export WORKDIR to resy-cooker.sh script:
  405. WORKDIR: ${{ env.WORK_DIR }}
  406. WORKSPACE: "jenkins"
  407. BITBAKE_ZERO: ${{ env.BITBAKE_ZERO }}
  408. BITBAKE_ZERO_ALLOW_ERROR: ${{ env.BITBAKE_ZERO_ALLOW_ERROR }}
  409. #######################################
  410. - name: bitbake ${{ env.BITBAKE_ONE }}
  411. run: |
  412. if [ "$BITBAKE_ONE" == "empty" ]; then
  413. echo "BITBAKE_ONE is $BITBAKE_ONE"
  414. else
  415. echo "BITBAKE_ONE is $BITBAKE_ONE"
  416. cd ${{env.WORK_DIR}}
  417. if [ "$BITBAKE_ONE_ALLOW_ERROR" == "yes" ]; then
  418. # allow error:
  419. time ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} ${{ steps.bitbake_one.outputs.bitbake_one }} || true
  420. else
  421. # don't allow error:
  422. time ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} ${{ steps.bitbake_one.outputs.bitbake_one }}
  423. fi
  424. fi
  425. env:
  426. # export WORKDIR to resy-cooker.sh script:
  427. WORKDIR: ${{ env.WORK_DIR }}
  428. WORKSPACE: "jenkins"
  429. BITBAKE_ONE: ${{ env.BITBAKE_ONE }}
  430. BITBAKE_ONE_ALLOW_ERROR: ${{ env.BITBAKE_ONE_ALLOW_ERROR }}
  431. #######################################
  432. - name: bitbake ${{ env.BITBAKE_TWO }}
  433. run: |
  434. if [ "$BITBAKE_TWO" == "empty" ]; then
  435. echo "BITBAKE_TWO is $BITBAKE_TWO"
  436. else
  437. echo "BITBAKE_TWO is $BITBAKE_TWO"
  438. cd ${{env.WORK_DIR}}
  439. time ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} ${{ steps.bitbake_two.outputs.bitbake_two }}
  440. fi
  441. env:
  442. # export WORKDIR to resy-cooker.sh script:
  443. WORKDIR: ${{ env.WORK_DIR }}
  444. WORKSPACE: "jenkins"
  445. BITBAKE_TWO: ${{ env.BITBAKE_TWO }}
  446. #######################################
  447. # - name: bitbake core-image-sato-sdk
  448. # run: |
  449. # cd ${{env.WORK_DIR}}
  450. # ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} core-image-sato-sdk
  451. # env:
  452. # # export WORKDIR to resy-cooker.sh script:
  453. # WORKDIR: ${{ env.WORK_DIR }}
  454. # WORKSPACE: "jenkins"
  455. #######################################
  456. # - name: bitbake 'core-image-sato-sdk -c populate_sdk'
  457. # run: |
  458. # cd ${{env.WORK_DIR}}
  459. # ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} 'core-image-sato-sdk -c populate_sdk'
  460. # env:
  461. # # export WORKDIR to resy-cooker.sh script:
  462. # WORKDIR: ${{ env.WORK_DIR }}
  463. # WORKSPACE: "jenkins"
  464. #######################################
  465. #######################################
  466. - name: Compress Artifacts after build
  467. run: |
  468. if [ ! -d ${{env.WORK_DIR}}/artifacts ];then mkdir -p ${{env.WORK_DIR}}/artifacts ; fi
  469. pushd ${{env.WORK_DIR}}/artifacts
  470. set +x
  471. if [ -d ${{env.WORK_DIR}}/build/${{ steps.yp_config.outputs.yp_config }}/conf ]; then tar -czvf ${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-conf.tar.gz -C ${{env.WORK_DIR}}/build/${{ steps.yp_config.outputs.yp_config }}/conf .; fi
  472. if [ -d ${{env.WORK_DIR}}/build/${{ steps.yp_config.outputs.yp_config }}/tmp/deploy ]; then tar -czvf ${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-deploy.tar.gz -C ${{env.WORK_DIR}}/build/${{ steps.yp_config.outputs.yp_config }}/tmp/deploy .; fi
  473. if [ -d ${{env.WORK_DIR}}/build/${{ steps.yp_config.outputs.yp_config }}/buildhistory ]; then tar -czvf ${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-buildhistory.tar.gz -C ${{env.WORK_DIR}}/build/${{ steps.yp_config.outputs.yp_config }}/buildhistory .; fi
  474. if [ -d ${{env.WORK_DIR}}/downloads_${{ steps.yp_version.outputs.yp_version }} ]; then tar -czvf ${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-DL_DIR.tar.gz -C ${{env.WORK_DIR}}/downloads_${{ steps.yp_version.outputs.yp_version }} .; fi
  475. if [ -d ${{env.WORK_DIR}}/sstate_${{ steps.yp_version.outputs.yp_version }} ]; then tar -czvf ${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-SSTATE_DIR.tar.gz -C ${{env.WORK_DIR}}/sstate_${{ steps.yp_version.outputs.yp_version }} .; fi
  476. if [ -d ${{env.WORK_DIR}}/persistent_${{ steps.yp_version.outputs.yp_version }} ]; then tar -czvf ${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-PERSISTENT_DIR.tar.gz -C ${{env.WORK_DIR}}/persistent_${{ steps.yp_version.outputs.yp_version }} .; fi
  477. pwd
  478. ls -lah ${{env.WORK_DIR}}/artifacts
  479. popd
  480. #######################################
  481. - name: Prepare source-mirror
  482. if: ${{ env.PREP_SOURCE_MIRROR == 'yes' }}
  483. run: |
  484. if [ ! -d ${{env.WORK_DIR}}/artifacts ];then mkdir -p ${{env.WORK_DIR}}/artifacts ; fi
  485. # downloads -> source_mirror
  486. cp -R ${{env.WORK_DIR}}/downloads_${{ steps.yp_version.outputs.yp_version }} ${{env.WORK_DIR}}/artifacts/source_mirror_${{ steps.yp_version.outputs.yp_version }}
  487. # cleanup source_mirror
  488. pushd ${{env.WORK_DIR}}/artifacts/source_mirror_${{ steps.yp_version.outputs.yp_version }}
  489. ${{env.WORK_DIR}}/sources/${{env.WORKFLOW_DIR}}/cleanup/cleanup.sh
  490. popd
  491. # make tarball from source_mirror
  492. pushd ${{env.WORK_DIR}}/artifacts
  493. tar -czvf ${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-source_mirror.tar.gz -C ${{env.WORK_DIR}}/artifacts/source_mirror_${{ steps.yp_version.outputs.yp_version }} .
  494. # remove source_mirror dir
  495. rm -rf ${{env.WORK_DIR}}/artifacts/source_mirror_${{ steps.yp_version.outputs.yp_version }}
  496. popd
  497. #pushd ${{env.WORK_DIR}}/sources
  498. #ls ${{env.WORK_DIR}}/sources/${{env.WORKFLOW_DIR}}/cleanup
  499. #mkdir
  500. #popd
  501. ####################### --> not supported yet ???
  502. # - name: Upload Artifact
  503. # uses: actions/upload-artifact@v3
  504. # with:
  505. # name: test
  506. # path: ${{env.WORK_DIR}}/artifacts
  507. ####################### <-- not supported yet ???
  508. - name: Copy artifacts after build
  509. uses: https://github.com/appleboy/scp-action@v0.1.4
  510. with:
  511. host: ${{ secrets.SCP_HOST }}
  512. username: ${{ secrets.SCP_USERNAME }}
  513. password: ${{ secrets.SCP_PASSWORD }}
  514. port: ${{ secrets.SCP_PORT }}
  515. source: "${{env.WORK_DIR}}/artifacts/*"
  516. target: /appdata/artifacts
  517. - name: Prepare source_mirror_local on server
  518. if: ${{ env.PREP_SOURCE_MIRROR == 'yes' }}
  519. uses: https://github.com/appleboy/ssh-action@v0.1.10
  520. with:
  521. host: ${{ secrets.SCP_HOST }}
  522. username: ${{ secrets.SCP_USERNAME }}
  523. password: ${{ secrets.SCP_PASSWORD }}
  524. port: ${{ secrets.SCP_PORT }}
  525. script: |
  526. cp ${{env.ARTIFACTS_ON_SERVER}}/${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-source_mirror.tar.gz /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}_compressed/
  527. pushd /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}_compressed/
  528. ln -sf ${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-source_mirror.tar.gz DL_DIR.tar.gz
  529. ls -lah
  530. popd
  531. - name: Prepare source_mirror on server
  532. if: ${{ env.PREP_SOURCE_MIRROR == 'yes' }}
  533. uses: https://github.com/appleboy/ssh-action@v0.1.10
  534. with:
  535. host: ${{ secrets.SCP_HOST }}
  536. username: ${{ secrets.SCP_USERNAME }}
  537. password: ${{ secrets.SCP_PASSWORD }}
  538. port: ${{ secrets.SCP_PORT }}
  539. script: |
  540. if [ -d /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}.ori ]; then
  541. rm -rf /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}.ori
  542. fi
  543. mv /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }} /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}.ori
  544. mkdir /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}
  545. tar -xzf ${{env.ARTIFACTS_ON_SERVER}}/${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-source_mirror.tar.gz -C /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}
  546. pushd /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}
  547. echo "${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-source_mirror.tar.gz" > build-version.txt
  548. ls -lah
  549. popd
  550. - name: Populate uninative-tarball on server
  551. if: ${{ env.POPULATE_UNINATIVE_TARBALL == 'yes' }}
  552. uses: https://github.com/appleboy/ssh-action@v0.1.10
  553. with:
  554. host: ${{ secrets.SCP_HOST }}
  555. username: ${{ secrets.SCP_USERNAME }}
  556. password: ${{ secrets.SCP_PASSWORD }}
  557. port: ${{ secrets.SCP_PORT }}
  558. script: |
  559. if [ -d /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}.ori ]; then
  560. rm -rf /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}.ori
  561. fi
  562. if [ -d /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}} ]; then
  563. mv /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}} /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}.ori
  564. fi
  565. pushd ${{env.ARTIFACTS_ON_SERVER}}
  566. if [ -d deploy-temp ]; then
  567. rm -rf deploy-temp
  568. fi
  569. mkdir deploy-temp
  570. tar -xzf ${{env.ARTIFACTS_ON_SERVER}}/${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-deploy.tar.gz -C ${{env.ARTIFACTS_ON_SERVER}}/deploy-temp
  571. pushd deploy-temp
  572. mkdir -p /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}
  573. cp sdk/* /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}/
  574. pushd /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}/
  575. ln -sf x86_64-nativesdk-libc.tar.xz x86_64-nativesdk-libc-${{env.UNINATIVE_TARBALL_VERSION}}.tar.xz
  576. echo "${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-deploy.tar.gz" > build-version.txt
  577. sha256sum=($(sha256sum x86_64-nativesdk-libc-3.7.tar.xz)) && echo ${sha256sum} > sha256sum.txt
  578. cat sha256sum.txt
  579. ls -lah
  580. popd
  581. popd
  582. popd
  583. - name: Populate sstate_mirror on server
  584. if: ${{ env.POPULATE_SSTATE_MIRROR == 'yes' }}
  585. uses: https://github.com/appleboy/ssh-action@v0.1.10
  586. with:
  587. host: ${{ secrets.SCP_HOST }}
  588. username: ${{ secrets.SCP_USERNAME }}
  589. password: ${{ secrets.SCP_PASSWORD }}
  590. port: ${{ secrets.SCP_PORT }}
  591. script: |
  592. if [ -d /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }}.ori ]; then
  593. rm -rf /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }}.ori
  594. fi
  595. if [ -d /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }} ]; then
  596. mv /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }} /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }}.ori
  597. fi
  598. mkdir -p /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }}
  599. tar -xzf ${{env.ARTIFACTS_ON_SERVER}}/${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-SSTATE_DIR.tar.gz -C /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }}
  600. pushd /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }}
  601. echo "${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-SSTATE_DIR.tar.gz" > build-version.txt
  602. ls -lah
  603. popd
  604.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement