-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,83 @@ | ||
name: CI on push tag | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
on: push | ||
# push: | ||
# tags: | ||
# - '*' | ||
|
||
jobs: | ||
build: | ||
name: Build system image | ||
runs-on: self-hosted | ||
steps: | ||
- name: Checkout meta-dts repo | ||
uses: actions/checkout@v2 | ||
with: | ||
path: "meta-dts" | ||
- name: Build DTS image | ||
shell: bash | ||
run: | | ||
kas-container build meta-dts/kas.yml | ||
# build: | ||
# name: Build system image | ||
# runs-on: self-hosted | ||
# steps: | ||
# - name: Checkout meta-dts repo | ||
# uses: actions/checkout@v2 | ||
# with: | ||
# path: "meta-dts" | ||
# - name: Build DTS image | ||
# shell: bash | ||
# run: | | ||
# kas-container build meta-dts/kas.yml | ||
deploy-images: | ||
name: Deploy DTS artifacts on boot.dasharo.com | ||
if: always() | ||
needs: build | ||
# needs: build | ||
runs-on: self-hosted | ||
steps: | ||
- name: Prepare SSH key | ||
shell: bash | ||
env: | ||
SSH_KEY: ${{secrets.SSH_KEY}} | ||
SSH_KEY_GITEA: ${{secrets.SSH_KEY_GITEA}} | ||
run: | | ||
echo -e ${SSH_KEY} | sed 's/^ *//' > ~/.ssh/dts-ci-key | ||
chmod 600 ~/.ssh/dts-ci-key | ||
echo ${SSH_KEY_GITEA} > ~/.ssh/gitea-key | ||
chmod 600 ~/.ssh/gitea-key | ||
cp ~/.ssh/config ~/.ssh/config-old | ||
echo -e "\n | ||
Host git.3mdeb.com\n | ||
HostName git.3mdeb.com\n | ||
IdentityFile ~/.ssh/gitea-key\n | ||
IdentitiesOnly yes" >> ~/.ssh/config | ||
- name: Get DTS version | ||
id: dts-ver | ||
shell: bash | ||
run: | | ||
DTS_VER=v`cat meta-dts/meta-dts-distro/conf/distro/dts-distro.conf | grep DISTRO_VERSION | tr -d "\" [A-Z]_="` | ||
# DTS_VER=v`cat meta-dts/meta-dts-distro/conf/distro/dts-distro.conf | grep DISTRO_VERSION | tr -d "\" [A-Z]_="` | ||
DTS_VER=v1.2.9 | ||
echo "DTS_VER=${DTS_VER}" >> $GITHUB_OUTPUT | ||
- name: Deploy DTS on boot.dasharo.com | ||
shell: bash | ||
run: | | ||
DTS_VER="${{steps.dts-ver.outputs.DTS_VER}}" | ||
ssh -i ~/.ssh/dts-ci-key [email protected] "mkdir -p boot/dts/${DTS_VER}" | ||
cd build/tmp/deploy/images/genericx86-64/ | ||
cp bzImage bzImage-${DTS_VER} | ||
cp dts-base-image-genericx86-64.cpio.gz dts-base-image-${DTS_VER}.cpio.gz | ||
cp dts-base-image-genericx86-64.wic.gz dts-base-image-${DTS_VER}.wic.gz | ||
cp dts-base-image-genericx86-64.iso dts-base-image-${DTS_VER}.iso | ||
scp -i ~/.ssh/dts-ci-key bzImage-${DTS_VER} [email protected]:boot/dts/${DTS_VER}/ | ||
scp -i ~/.ssh/dts-ci-key dts-base-image-${DTS_VER}.cpio.gz [email protected]:boot/dts/${DTS_VER}/ | ||
scp -i ~/.ssh/dts-ci-key dts-base-image-${DTS_VER}.wic.gz [email protected]:boot/dts/${DTS_VER}/ | ||
scp -i ~/.ssh/dts-ci-key dts-base-image-${DTS_VER}.iso [email protected]:boot/dts/${DTS_VER}/ | ||
- name: Deploy sha256 on boot.dasharo.com | ||
shell: bash | ||
run: | | ||
DTS_VER="${{steps.dts-ver.outputs.DTS_VER}}" | ||
cd build/tmp/deploy/images/genericx86-64/ | ||
sha256sum bzImage-${DTS_VER} > bzImage-${DTS_VER}.sha256 | ||
sha256sum dts-base-image-${DTS_VER}.cpio.gz > dts-base-image-${DTS_VER}.cpio.gz.sha256 | ||
sha256sum dts-base-image-${DTS_VER}.wic.gz > dts-base-image-${DTS_VER}.wic.gz.sha256 | ||
sha256sum dts-base-image-${DTS_VER}.iso > dts-base-image-${DTS_VER}.iso.sha256 | ||
scp -i ~/.ssh/dts-ci-key bzImage-${DTS_VER}.sha256 [email protected]:boot/dts/${DTS_VER}/ | ||
scp -i ~/.ssh/dts-ci-key dts-base-image-${DTS_VER}.cpio.gz.sha256 [email protected]:boot/dts/${DTS_VER}/ | ||
scp -i ~/.ssh/dts-ci-key dts-base-image-${DTS_VER}.wic.gz.sha256 [email protected]:boot/dts/${DTS_VER}/ | ||
scp -i ~/.ssh/dts-ci-key dts-base-image-${DTS_VER}.iso.sha256 [email protected]:boot/dts/${DTS_VER}/ | ||
- name: Update iPXE menu | ||
shell: bash | ||
run: | | ||
./meta-dts/scripts/generate-ipxe-menu.sh ${{steps.dts-ver.outputs.DTS_VER}} | ||
scp -i ~/.ssh/dts-ci-key dts.ipxe [email protected]:boot/dts/ | ||
# - name: Deploy DTS on boot.dasharo.com | ||
# shell: bash | ||
# run: | | ||
# DTS_VER="${{steps.dts-ver.outputs.DTS_VER}}" | ||
# ssh -i ~/.ssh/dts-ci-key [email protected] "mkdir -p boot/dts/${DTS_VER}" | ||
# cd build/tmp/deploy/images/genericx86-64/ | ||
# cp bzImage bzImage-${DTS_VER} | ||
# cp dts-base-image-genericx86-64.cpio.gz dts-base-image-${DTS_VER}.cpio.gz | ||
# cp dts-base-image-genericx86-64.wic.gz dts-base-image-${DTS_VER}.wic.gz | ||
# cp dts-base-image-genericx86-64.iso dts-base-image-${DTS_VER}.iso | ||
# scp -i ~/.ssh/dts-ci-key bzImage-${DTS_VER} [email protected]:boot/dts/${DTS_VER}/ | ||
# scp -i ~/.ssh/dts-ci-key dts-base-image-${DTS_VER}.cpio.gz [email protected]:boot/dts/${DTS_VER}/ | ||
# scp -i ~/.ssh/dts-ci-key dts-base-image-${DTS_VER}.wic.gz [email protected]:boot/dts/${DTS_VER}/ | ||
# scp -i ~/.ssh/dts-ci-key dts-base-image-${DTS_VER}.iso [email protected]:boot/dts/${DTS_VER}/ | ||
# - name: Deploy sha256 on boot.dasharo.com | ||
# shell: bash | ||
# run: | | ||
# DTS_VER="${{steps.dts-ver.outputs.DTS_VER}}" | ||
# cd build/tmp/deploy/images/genericx86-64/ | ||
# sha256sum bzImage-${DTS_VER} > bzImage-${DTS_VER}.sha256 | ||
# sha256sum dts-base-image-${DTS_VER}.cpio.gz > dts-base-image-${DTS_VER}.cpio.gz.sha256 | ||
# sha256sum dts-base-image-${DTS_VER}.wic.gz > dts-base-image-${DTS_VER}.wic.gz.sha256 | ||
# sha256sum dts-base-image-${DTS_VER}.iso > dts-base-image-${DTS_VER}.iso.sha256 | ||
# scp -i ~/.ssh/dts-ci-key bzImage-${DTS_VER}.sha256 [email protected]:boot/dts/${DTS_VER}/ | ||
# scp -i ~/.ssh/dts-ci-key dts-base-image-${DTS_VER}.cpio.gz.sha256 [email protected]:boot/dts/${DTS_VER}/ | ||
# scp -i ~/.ssh/dts-ci-key dts-base-image-${DTS_VER}.wic.gz.sha256 [email protected]:boot/dts/${DTS_VER}/ | ||
# scp -i ~/.ssh/dts-ci-key dts-base-image-${DTS_VER}.iso.sha256 [email protected]:boot/dts/${DTS_VER}/ | ||
# - name: Update iPXE menu | ||
# shell: bash | ||
# run: | | ||
# ./meta-dts/scripts/generate-ipxe-menu.sh ${{steps.dts-ver.outputs.DTS_VER}} | ||
# scp -i ~/.ssh/dts-ci-key dts.ipxe [email protected]:boot/dts/ | ||
- name: Trigger signing | ||
shell: bash | ||
run: | | ||
|
@@ -86,5 +96,8 @@ jobs: | |
shell: bash | ||
run: | | ||
rm -rf ~/.ssh/dts-ci-key | ||
rm -rf build | ||
rm -rf dts-release-cicd-pipeline | ||
mr -f ~/.ssh/gitea-key | ||
# rm -rf build | ||
# rm -rf dts-release-cicd-pipeline | ||
rm -f ~/.ssh/config | ||
mv ~/.ssh/config-old ~/.ssh/config |