Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name: release-use-uninative-core-image-minimal-populate-sstate-mirror
- #on: [push]
- on:
- workflow_call:
- jobs:
- release-use-uninative-core-image-minimal-populate-sstate-mirror:
- runs-on: yocto-build-latest
- timeout-minutes: 1000
- # Specify location to build, this path persists across builds allowing
- # us to build incrementally
- env:
- WORK_DIR: ${{github.workspace}}/workdir
- GITEA_GIT_MIRROR: 10.0.0.182:8939
- GITEA_SERVER: 10.0.0.182:8940
- WORKFLOW_DIR: yocto-build-docker-action
- WORKFLOW_REPO: rber/${{env.WORKFLOW_DIR}}
- MANIFEST_REPO: rber/manifests -b master-action
- YP_CONFIG: multi-v7-ml-debug-training
- YP_VERSION: langdale
- ARTIFACTS_ON_SERVER: /appdata/artifacts/workspace/rber/yocto-build-docker-action/workdir/artifacts
- NO_SSTATE_MIRRORS: yes
- POPULATE_SSTATE_MIRROR: yes
- # used for local source mirror:
- USE_VAR_WWW: no
- PREP_SOURCE_MIRROR: no
- # --> only one yes, the other no
- NO_SOURCE_MIRROR: no
- USE_SOURCE_MIRROR: yes
- USE_SOURCE_MIRROR_LOCAL: no
- # <-- only one yes, the other no
- USE_BB_NO_NETWORK: no
- USE_BB_ALLOWED_NETWORKS: no
- THE_ALLOWED_NETWORKS: 10.0.0.182
- # --> only one yes, the other no
- NO_PREMIRRORS: no
- USE_PREMIRRORS: yes
- # <-- only one yes, the other no
- # --> only one yes, the other no
- BUILD_UNINATIVE_TARBALL: no
- USE_UNINATIVE_TARBALL: yes
- DONT_USE_UNINATIVE_TARBALL: no
- POPULATE_UNINATIVE_TARBALL: no
- UNINATIVE_TARBALL_VERSION: 3.7
- #BITBAKE_ZERO: uninative-tarball
- #BITBAKE_ZERO: 'uninative-tarball --runall=fetch'
- BITBAKE_ZERO: empty
- BITBAKE_ZERO_ALLOW_ERROR: no
- # <-- only one yes, the other no
- THE_UNINATIVE_URL: http://${{env.WEB_SERVER}}/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}/
- THE_SOURCE_MIRROR_URL: http://${{env.WEB_SERVER}}/source_mirror_${{env.YP_VERSION}}
- USE_PR_SERVER: yes
- PR_SERVER: 10.0.0.182:18585
- USE_HASH_SERVER: yes
- HASH_SERVER: 10.0.0.182:8687
- # lighttpd:
- WEB_SERVER: 10.0.0.182:8941
- # nginx:
- #WEB_SERVER: 10.0.0.182:8053
- BITBAKE_ONE: core-image-minimal
- #BITBAKE_ONE: 'core-image-minimal --runall=fetch'
- #BITBAKE_ONE: empty
- BITBAKE_ONE_ALLOW_ERROR: no
- BITBAKE_TWO: empty
- NOTE: use-uninative-core-image-minimal-populate-sstate-mirror
- #name: Yocto build - core-image-minimal-local-source-mirror
- steps:
- - name: Get build system info
- id: build_system
- run: |
- echo "Host: ${HOSTNAME}"
- echo "CPUs/Threads: $(grep -c ^processor /proc/cpuinfo)"
- echo "CPUs: $(grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}')"
- echo "$(free -mh)"
- - name: Get current date/time
- id: date
- run: |
- echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')"
- - name: Get gitea git mirror
- id: gitea_git_mirror
- run: |
- echo "::set-output name=gitea_git_mirror::${{env.GITEA_GIT_MIRROR}}"
- - name: Get gitea server
- id: gitea_server
- run: |
- echo "::set-output name=gitea_server::${{env.GITEA_SERVER}}"
- - name: Get workflow repo
- id: workflow_repo
- run: |
- echo "::set-output name=workflow_repo::${{env.WORKFLOW_REPO}}"
- - name: Get manifest repo
- id: manifest_repo
- run: |
- echo "::set-output name=manifest_repo::${{env.MANIFEST_REPO}}"
- - name: Get Yocto Project config
- id: yp_config
- run: |
- echo "::set-output name=yp_config::${{env.YP_CONFIG}}"
- - name: get Yocto Project version
- id: yp_version
- run: |
- echo "::set-output name=yp_version::${{env.YP_VERSION}}"
- - name: get PR server
- id: pr_server
- run: |
- echo "::set-output name=pr_server::${{env.PR_SERVER}}"
- - name: get hash server
- id: hash_server
- run: |
- echo "::set-output name=hash_server::${{env.HASH_SERVER}}"
- - name: get web server
- id: web_server
- run: |
- echo "::set-output name=web_server::${{env.WEB_SERVER}}"
- - name: get THE_UNINATIVE_URL
- id: uninative_url
- run: |
- echo "::set-output name=uninative_url::${{env.THE_UNINATIVE_URL}}"
- - name: get Note
- id: note
- run: |
- echo "::set-output name=note::${{env.NOTE}}"
- - name: Get bitbake_zero
- id: bitbake_zero
- run: |
- echo "::set-output name=bitbake_zero::${{env.BITBAKE_ZERO}}"
- - name: Get bitbake_one
- id: bitbake_one
- run: |
- echo "::set-output name=bitbake_one::${{env.BITBAKE_ONE}}"
- - name: Get bitbake_two
- id: bitbake_two
- run: |
- echo "::set-output name=bitbake_two::${{env.BITBAKE_TWO}}"
- - name: Checkout workflow repo
- run: |
- mkdir -p ${{env.WORK_DIR}}/sources
- pushd ${{env.WORK_DIR}}/sources
- git clone http://${{ steps.gitea_server.outputs.gitea_server }}/${{ steps.workflow_repo.outputs.workflow_repo }}
- ls
- popd
- - name: Checkout manifest repo
- run: |
- mkdir -p ${{env.WORK_DIR}}/sources
- pushd ${{env.WORK_DIR}}/sources
- git clone http://${{ steps.gitea_server.outputs.gitea_server }}/${{ steps.manifest_repo.outputs.manifest_repo }}
- ls
- popd
- - name: Create symlinks
- run: |
- cd ${{env.WORK_DIR}}
- ln -sf sources/manifests/resy-cooker.sh resy-cooker.sh
- ln -sf sources/manifests/killall_bitbake.sh killall_bitbake.sh
- ln -sf sources/manifests/resy-${{ steps.yp_config.outputs.yp_config }}.sh resy-${{ steps.yp_config.outputs.yp_config }}.sh
- pwd
- ls
- - name: Checkout repos for ${{ env.YP_CONFIG }}
- run: |
- pushd ${{env.WORK_DIR}}
- ls
- ./resy-${{ steps.yp_config.outputs.yp_config }}.sh
- #tree -L 1 sources
- popd
- env:
- # export WORKDIR to resy-cooker.sh script:
- WORKDIR: ${{ env.WORK_DIR }}
- WORKSPACE: "jenkins"
- - name: Fix broken links
- run: |
- pushd ${{env.WORK_DIR}}
- echo "--> broken links"
- find . -xtype l -ls
- echo "<-- broken links"
- echo "--> fix links"
- find . -xtype l -exec bash -c 'target="$(readlink "{}")"; link="{}"; target="$(echo "$target" | sed "s,/workdir,${{ env.WORK_DIR }},g")"; ln -Tfs "$target" "$link"' \;
- echo "<-- fix links"
- echo "--> broken links"
- find . -xtype l -ls
- echo "<-- broken links"
- popd
- env:
- # export WORKDIR to resy-cooker.sh script:
- WORKDIR: ${{ env.WORK_DIR }}
- WORKSPACE: "jenkins"
- - name: Fix site.conf file
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- sed -i "s,/workdir,${{ env.WORK_DIR }}," site.conf
- sed -i "s,/mirror/,/${{ steps.web_server.outputs.web_server }}/," site.conf
- sed -i "s,/mirror.res.training,/${{ steps.web_server.outputs.web_server }}/," site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - hash server
- if: ${{ env.USE_HASH_SERVER == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- sed -i "s,mirror:8687,${{ steps.hash_server.outputs.hash_server }}," site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - no SSTATE/MIRRORS,...
- if: ${{ env.NO_SSTATE_MIRRORS == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- sed -i 's/^SSTATE_MIRRORS/#&/' site.conf
- sed -i 's/^BB_HASHSERVE_UPSTREAM/#&/' site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - prep. build uninative-tarball
- if: ${{ env.BUILD_UNINATIVE_TARBALL == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- # I guess we need my uninative tarball URL to build the uninative tarball
- sed -i 's/^UNINATIVE_URL/#&/' site.conf
- echo "UNINATIVE_TARBALL=\"\"" >> site.conf
- # echo "UNINATIVE_CHECKSUM[x86_64]=\"deadbeef\"" >> site.conf
- # SRC_URI[sha256sum] = "8a6e588cc3435b9d9c87845b931ed17df7956eed29fd171aec05fbc557da6e7a"
- echo "UNINATIVE_CHECKSUM[x86_64]=\"954182f691bb2dbae157ee991654ad2fd4cb51c7f3d3ab429e9f84654c8dc990\"" >> site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - use uninative-tarball
- if: ${{ env.USE_UNINATIVE_TARBALL == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- echo "${{ steps.uninative_url.outputs.uninative_url }}/sha256sum.txt"
- time wget -t 2 -T 30 --passive-ftp "${{ steps.uninative_url.outputs.uninative_url }}/sha256sum.txt"
- cat sha256sum.txt
- UNINATIVE_SHA256SUM=$(cat sha256sum.txt)
- echo "uninative_sha256sum: ${UNINATIVE_SHA256SUM}"
- echo "UNINATIVE_CHECKSUM[x86_64]=\"${UNINATIVE_SHA256SUM}\"" >> site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - don't use uninative-tarball
- if: ${{ env.DONT_USE_UNINATIVE_TARBALL == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- sed -i 's/^UNINATIVE_URL/#&/' site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - PR server
- if: ${{ env.USE_PR_SERVER == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- sed -i "s,localhost:0,${{ steps.pr_server.outputs.pr_server }}," site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - no PREMIRRORS
- if: ${{ env.NO_PREMIRRORS == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- sed -i "/PREMIRRORS +=/,+5 s/^/#/" site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - use PREMIRRORS
- if: ${{ env.USE_PREMIRRORS == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- # we comment out the previous PREMIRRORS
- sed -i "/PREMIRRORS +=/,+5 s/^/#/" site.conf
- # we add our new PREMIRRORS
- # PREMIRRORS += " \
- # git://git.denx.de/u-boot.git git://omv-1:8939/robert.berger/u-boot.git;protocol=http \n \
- # 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 \
- # git://git.yoctoproject.org/linux-yocto.git git://omv-1.res.training:8939/robert.berger/linux-yocto.git;protocol=http \n \
- # git://git.yoctoproject.org/yocto-kernel-cache git://omv-1:8939/robert.berger/yocto-kernel-cache.git;protocol=http \n \
- # git://github.com/raspberrypi/linux.git git://omv-1:8939/robert.berger/raspberrypi-linux.git;protocol=http \n \
- #"
- echo "PREMIRRORS += \" \\" >> site.conf
- 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
- 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
- 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
- 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
- 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
- echo "\"" >> site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - no SOURCE_MIRROR
- if: ${{ env.NO_SOURCE_MIRROR == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- #sed -i 's/^BB_GENERATE_MIRROR_TARBALLS/#&/' site.conf
- sed -i 's/^SOURCE_MIRROR_URL/#&/' site.conf
- sed -i "s,own-mirrors,," site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - use SOURCE_MIRROR
- if: ${{ env.USE_SOURCE_MIRROR == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- #sed -i 's/^BB_GENERATE_MIRROR_TARBALLS/#&/' site.conf
- #sed -i 's/^SOURCE_MIRROR_URL/#&/' site.conf
- #sed -i "s,own-mirrors,," site.conf
- echo "INHERIT += \"own-mirrors\"" >> site.conf
- # SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
- echo "SOURCE_MIRROR_URL = \"http://${{env.THE_SOURCE_MIRROR_URL}}\"" >> site.conf
- echo "SRCREV:pn-ascii-invaders = \"2644be38afc06f7f7bba55034966dd66d9ad524f\"" >> site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - use SOURCE_MIRROR_LOCAL
- if: ${{ env.USE_SOURCE_MIRROR_LOCAL == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- #sed -i 's/^BB_GENERATE_MIRROR_TARBALLS/#&/' site.conf
- sed -i 's/^SOURCE_MIRROR_URL/#&/' site.conf
- #sed -i "s,own-mirrors,," site.conf
- # SOURCE_MIRROR_URL syntax:
- # SOURCE_MIRROR_URL ?= "file:///workdir/source_mirror_langdale/"
- # 3 - Three slashes
- echo "INHERIT += \"own-mirrors\"" >> site.conf
- echo "SOURCE_MIRROR_URL = \"file://${{env.WORK_DIR}}/source_mirror/\"" >> site.conf
- echo "SRCREV:pn-ascii-invaders = \"2644be38afc06f7f7bba55034966dd66d9ad524f\"" >> site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - BB_NO_NETWORK
- if: ${{ env.USE_BB_NO_NETWORK == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- echo "BB_NO_NETWORK = \"1\"" >> site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - BB_ALLOWED_NETWORKS
- if: ${{ env.USE_BB_ALLOWED_NETWORKS == 'yes' }}
- run: |
- pushd ${{env.WORK_DIR}}/sources/meta-resy/template-common
- echo "BB_ALLOWED_NETWORKS = \"${{ env.THE_ALLOWED_NETWORKS }}\"" >> site.conf
- echo "SRCREV:pn-ascii-invaders = \"2644be38afc06f7f7bba55034966dd66d9ad524f\"" >> site.conf
- cat site.conf
- popd
- - name: Fix site.conf file - VAR_WWW - BB_NO_NETWORK needed
- if: ${{ env.USE_VAR_WWW == 'yes' }}
- run: |
- mkdir -p ${{env.WORK_DIR}}/source_mirror
- pushd ${{env.WORK_DIR}}
- 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'
- tar xvf DL_DIR.tar.gz -C ${{env.WORK_DIR}}/source_mirror
- if [ ! -d ${{env.WORK_DIR}}/artifacts ];then mkdir -p ${{env.WORK_DIR}}/artifacts ; fi
- 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
- rm -f DL_DIR.tar.gz
- #echo "BB_ALLOWED_NETWORKS = \"${{ env.THE_ALLOWED_NETWORKS }}\"" >> site.conf
- #echo "SRCREV:pn-ascii-invaders = \"2644be38afc06f7f7bba55034966dd66d9ad524f\"" >> site.conf
- #cat site.conf
- popd
- # - name: Fix site.conf symlinks
- # run: |
- # pushd ${{env.WORK_DIR}}
- # popd
- # env:
- # # export WORKDIR to resy-cooker.sh script:
- # WORKDIR: ${{ env.WORK_DIR }}
- # WORKSPACE: "jenkins"
- - name: Compress Artifacts before build
- run: |
- if [ ! -d ${{env.WORK_DIR}}/artifacts ];then mkdir -p ${{env.WORK_DIR}}/artifacts ; fi
- pushd ${{env.WORK_DIR}}/artifacts
- 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
- 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
- pwd
- ls -lah ${{env.WORK_DIR}}/artifacts
- popd
- ####################### --> not supported yet ???
- # - name: Upload Artifact
- # uses: actions/upload-artifact@v3
- # with:
- # name: test
- # path: ${{env.WORK_DIR}}/artifacts
- ####################### <-- not supported yet ???
- - name: Copy artifacts before build
- uses: https://github.com/appleboy/scp-action@v0.1.4
- with:
- host: ${{ secrets.SCP_HOST }}
- username: ${{ secrets.SCP_USERNAME }}
- password: ${{ secrets.SCP_PASSWORD }}
- port: ${{ secrets.SCP_PORT }}
- source: "${{env.WORK_DIR}}/artifacts/*"
- target: /appdata/artifacts
- #######################################
- # - name: bitbake uninative-tarball
- # if: ${{ env.BUILD_UNINATIVE_TARBALL == 'yes' }}
- # run: |
- # cd ${{env.WORK_DIR}}
- # time ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} uninative-tarball
- # env:
- # # export WORKDIR to resy-cooker.sh script:
- # WORKDIR: ${{ env.WORK_DIR }}
- # WORKSPACE: "jenkins"
- #######################################
- - name: bitbake ${{ env.BITBAKE_ZERO }} - uninative-tarball?
- run: |
- if [ "$BITBAKE_ZERO" == "empty" ]; then
- echo "BITBAKE_ZERO is $BITBAKE_ZERO"
- else
- echo "BITBAKE_ZERO is $BITBAKE_ZERO"
- cd ${{env.WORK_DIR}}
- if [ "$BITBAKE_ZERO_ALLOW_ERROR" == "yes" ]; then
- # allow error:
- time ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} ${{ steps.bitbake_zero.outputs.bitbake_zero }} || true
- else
- # don't allow error:
- time ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} ${{ steps.bitbake_zero.outputs.bitbake_zero }}
- fi
- fi
- env:
- # export WORKDIR to resy-cooker.sh script:
- WORKDIR: ${{ env.WORK_DIR }}
- WORKSPACE: "jenkins"
- BITBAKE_ZERO: ${{ env.BITBAKE_ZERO }}
- BITBAKE_ZERO_ALLOW_ERROR: ${{ env.BITBAKE_ZERO_ALLOW_ERROR }}
- #######################################
- - name: bitbake ${{ env.BITBAKE_ONE }}
- run: |
- if [ "$BITBAKE_ONE" == "empty" ]; then
- echo "BITBAKE_ONE is $BITBAKE_ONE"
- else
- echo "BITBAKE_ONE is $BITBAKE_ONE"
- cd ${{env.WORK_DIR}}
- if [ "$BITBAKE_ONE_ALLOW_ERROR" == "yes" ]; then
- # allow error:
- time ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} ${{ steps.bitbake_one.outputs.bitbake_one }} || true
- else
- # don't allow error:
- time ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} ${{ steps.bitbake_one.outputs.bitbake_one }}
- fi
- fi
- env:
- # export WORKDIR to resy-cooker.sh script:
- WORKDIR: ${{ env.WORK_DIR }}
- WORKSPACE: "jenkins"
- BITBAKE_ONE: ${{ env.BITBAKE_ONE }}
- BITBAKE_ONE_ALLOW_ERROR: ${{ env.BITBAKE_ONE_ALLOW_ERROR }}
- #######################################
- - name: bitbake ${{ env.BITBAKE_TWO }}
- run: |
- if [ "$BITBAKE_TWO" == "empty" ]; then
- echo "BITBAKE_TWO is $BITBAKE_TWO"
- else
- echo "BITBAKE_TWO is $BITBAKE_TWO"
- cd ${{env.WORK_DIR}}
- time ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} ${{ steps.bitbake_two.outputs.bitbake_two }}
- fi
- env:
- # export WORKDIR to resy-cooker.sh script:
- WORKDIR: ${{ env.WORK_DIR }}
- WORKSPACE: "jenkins"
- BITBAKE_TWO: ${{ env.BITBAKE_TWO }}
- #######################################
- # - name: bitbake core-image-sato-sdk
- # run: |
- # cd ${{env.WORK_DIR}}
- # ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} core-image-sato-sdk
- # env:
- # # export WORKDIR to resy-cooker.sh script:
- # WORKDIR: ${{ env.WORK_DIR }}
- # WORKSPACE: "jenkins"
- #######################################
- # - name: bitbake 'core-image-sato-sdk -c populate_sdk'
- # run: |
- # cd ${{env.WORK_DIR}}
- # ./resy-cooker.sh ${{ steps.yp_config.outputs.yp_config }} 'core-image-sato-sdk -c populate_sdk'
- # env:
- # # export WORKDIR to resy-cooker.sh script:
- # WORKDIR: ${{ env.WORK_DIR }}
- # WORKSPACE: "jenkins"
- #######################################
- #######################################
- - name: Compress Artifacts after build
- run: |
- if [ ! -d ${{env.WORK_DIR}}/artifacts ];then mkdir -p ${{env.WORK_DIR}}/artifacts ; fi
- pushd ${{env.WORK_DIR}}/artifacts
- set +x
- 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
- 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
- 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
- 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
- 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
- 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
- pwd
- ls -lah ${{env.WORK_DIR}}/artifacts
- popd
- #######################################
- - name: Prepare source-mirror
- if: ${{ env.PREP_SOURCE_MIRROR == 'yes' }}
- run: |
- if [ ! -d ${{env.WORK_DIR}}/artifacts ];then mkdir -p ${{env.WORK_DIR}}/artifacts ; fi
- # downloads -> source_mirror
- cp -R ${{env.WORK_DIR}}/downloads_${{ steps.yp_version.outputs.yp_version }} ${{env.WORK_DIR}}/artifacts/source_mirror_${{ steps.yp_version.outputs.yp_version }}
- # cleanup source_mirror
- pushd ${{env.WORK_DIR}}/artifacts/source_mirror_${{ steps.yp_version.outputs.yp_version }}
- ${{env.WORK_DIR}}/sources/${{env.WORKFLOW_DIR}}/cleanup/cleanup.sh
- popd
- # make tarball from source_mirror
- pushd ${{env.WORK_DIR}}/artifacts
- 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 }} .
- # remove source_mirror dir
- rm -rf ${{env.WORK_DIR}}/artifacts/source_mirror_${{ steps.yp_version.outputs.yp_version }}
- popd
- #pushd ${{env.WORK_DIR}}/sources
- #ls ${{env.WORK_DIR}}/sources/${{env.WORKFLOW_DIR}}/cleanup
- #mkdir
- #popd
- ####################### --> not supported yet ???
- # - name: Upload Artifact
- # uses: actions/upload-artifact@v3
- # with:
- # name: test
- # path: ${{env.WORK_DIR}}/artifacts
- ####################### <-- not supported yet ???
- - name: Copy artifacts after build
- uses: https://github.com/appleboy/scp-action@v0.1.4
- with:
- host: ${{ secrets.SCP_HOST }}
- username: ${{ secrets.SCP_USERNAME }}
- password: ${{ secrets.SCP_PASSWORD }}
- port: ${{ secrets.SCP_PORT }}
- source: "${{env.WORK_DIR}}/artifacts/*"
- target: /appdata/artifacts
- - name: Prepare source_mirror_local on server
- if: ${{ env.PREP_SOURCE_MIRROR == 'yes' }}
- uses: https://github.com/appleboy/ssh-action@v0.1.10
- with:
- host: ${{ secrets.SCP_HOST }}
- username: ${{ secrets.SCP_USERNAME }}
- password: ${{ secrets.SCP_PASSWORD }}
- port: ${{ secrets.SCP_PORT }}
- script: |
- 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/
- pushd /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}_compressed/
- ln -sf ${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-source_mirror.tar.gz DL_DIR.tar.gz
- ls -lah
- popd
- - name: Prepare source_mirror on server
- if: ${{ env.PREP_SOURCE_MIRROR == 'yes' }}
- uses: https://github.com/appleboy/ssh-action@v0.1.10
- with:
- host: ${{ secrets.SCP_HOST }}
- username: ${{ secrets.SCP_USERNAME }}
- password: ${{ secrets.SCP_PASSWORD }}
- port: ${{ secrets.SCP_PORT }}
- script: |
- if [ -d /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}.ori ]; then
- rm -rf /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}.ori
- fi
- 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
- mkdir /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}
- 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 }}
- pushd /appdata/lighttpd/var/www/source_mirror_${{ steps.yp_version.outputs.yp_version }}
- echo "${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-source_mirror.tar.gz" > build-version.txt
- ls -lah
- popd
- - name: Populate uninative-tarball on server
- if: ${{ env.POPULATE_UNINATIVE_TARBALL == 'yes' }}
- uses: https://github.com/appleboy/ssh-action@v0.1.10
- with:
- host: ${{ secrets.SCP_HOST }}
- username: ${{ secrets.SCP_USERNAME }}
- password: ${{ secrets.SCP_PASSWORD }}
- port: ${{ secrets.SCP_PORT }}
- script: |
- if [ -d /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}.ori ]; then
- rm -rf /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}.ori
- fi
- if [ -d /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}} ]; then
- mv /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}} /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}.ori
- fi
- pushd ${{env.ARTIFACTS_ON_SERVER}}
- if [ -d deploy-temp ]; then
- rm -rf deploy-temp
- fi
- mkdir deploy-temp
- 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
- pushd deploy-temp
- mkdir -p /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}
- cp sdk/* /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}/
- pushd /appdata/lighttpd/var/www/releases/uninative/${{env.UNINATIVE_TARBALL_VERSION}}/
- ln -sf x86_64-nativesdk-libc.tar.xz x86_64-nativesdk-libc-${{env.UNINATIVE_TARBALL_VERSION}}.tar.xz
- echo "${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-deploy.tar.gz" > build-version.txt
- sha256sum=($(sha256sum x86_64-nativesdk-libc-3.7.tar.xz)) && echo ${sha256sum} > sha256sum.txt
- cat sha256sum.txt
- ls -lah
- popd
- popd
- popd
- - name: Populate sstate_mirror on server
- if: ${{ env.POPULATE_SSTATE_MIRROR == 'yes' }}
- uses: https://github.com/appleboy/ssh-action@v0.1.10
- with:
- host: ${{ secrets.SCP_HOST }}
- username: ${{ secrets.SCP_USERNAME }}
- password: ${{ secrets.SCP_PASSWORD }}
- port: ${{ secrets.SCP_PORT }}
- script: |
- if [ -d /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }}.ori ]; then
- rm -rf /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }}.ori
- fi
- if [ -d /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }} ]; then
- 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
- fi
- mkdir -p /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }}
- 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 }}
- pushd /appdata/lighttpd/var/www/sstate_mirror_${{ steps.yp_version.outputs.yp_version }}
- echo "${{ steps.date.outputs.date }}-${{ steps.note.outputs.note }}-${{ steps.yp_config.outputs.yp_config }}-SSTATE_DIR.tar.gz" > build-version.txt
- ls -lah
- popd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement