From 50e125d59d3931225ca4c154c7cb0f32dc308663 Mon Sep 17 00:00:00 2001 From: Nadezhda Fedorova Date: Mon, 11 Nov 2024 18:58:45 +0300 Subject: [PATCH] run all wf wf with alt-sisyphus --- .../{wf_full_sis.yaml => wf_full.yaml} | 18 ++- .gitea/workflows/wf_full_p10.yaml | 133 ------------------ .gitea/workflows/wf_full_p11.yaml | 133 ------------------ .gitea/workflows/wf_single.yaml | 4 +- 4 files changed, 15 insertions(+), 273 deletions(-) rename .gitea/workflows/{wf_full_sis.yaml => wf_full.yaml} (86%) delete mode 100644 .gitea/workflows/wf_full_p10.yaml delete mode 100644 .gitea/workflows/wf_full_p11.yaml diff --git a/.gitea/workflows/wf_full_sis.yaml b/.gitea/workflows/wf_full.yaml similarity index 86% rename from .gitea/workflows/wf_full_sis.yaml rename to .gitea/workflows/wf_full.yaml index 7f47744..3ab9785 100644 --- a/.gitea/workflows/wf_full_sis.yaml +++ b/.gitea/workflows/wf_full.yaml @@ -2,7 +2,7 @@ name: Full building alt images on: push: tags: - - 'sisyphus_*' + - '*_*' jobs: build-process: @@ -25,6 +25,13 @@ jobs: env: GU: ${{ gitea.server_url }} GR: ${{ gitea.repository }} + - name: Set repo for c10f2 (Temporary) + if: ${{ contains(github.ref_name, 'c10f2') }} + run: | + echo "event tag=${{ github.ref_name }}" + echo "10.4.0.3 update.altsp.su" >> /etc/hosts + echo "cat /etc/hosts" + cat /etc/hosts - name: Update apt uses: actions/init-alt-env@v1 - name: Install requires @@ -54,10 +61,11 @@ jobs: - name: Run building script id: build-script run: | - build_args="-b $BR -o $ORG --skip-images alt/distroless-devel --arches amd64 386 arm64 loong64" - if [[ $ORG == 'k8s' ]]; then build_args="$build_args --overwrite-organization $ORG-$BR --package-versions {\"k8s/kube-apiserver\":\"1.31\",\"k8s/kube-scheduler\":\"1.31\",\"k8s/kube-controller-manager\":\"1.31\",\"k8s/kube-proxy\":\"1.31\",\"k8s/coredns\":\"1.11.3\",\"k8s/kubelet\":\"1.31\"}"; fi - echo "build.py $build_args" - ${{ gitea.workspace }}/build.py $build_args + build_args="-b $BR -o $ORG --skip-images alt/distroless-devel" + if [[ "$BR" == "sisyphus" ]]; then arches="--arches amd64 386 arm64 loong64"; else arches="--arches amd64 386 arm64"; fi + if [[ "$ORG" == "k8s" ]]; then build_args="$build_args --overwrite-organization $ORG-$BR --package-versions {\"k8s/kube-apiserver\":\"1.31\",\"k8s/kube-scheduler\":\"1.31\",\"k8s/kube-controller-manager\":\"1.31\",\"k8s/kube-proxy\":\"1.31\",\"k8s/coredns\":\"1.11.3\",\"k8s/kubelet\":\"1.31\"}"; fi + echo "build.py $build_args $arches" + ${{ gitea.workspace }}/build.py $build_args $arches env: ORG: ${{ env.ORG }} BR: ${{ env.BRANCH }} diff --git a/.gitea/workflows/wf_full_p10.yaml b/.gitea/workflows/wf_full_p10.yaml deleted file mode 100644 index a5581a9..0000000 --- a/.gitea/workflows/wf_full_p10.yaml +++ /dev/null @@ -1,133 +0,0 @@ -name: Full building alt images -on: - push: - tags: - - '*10*_*' - -jobs: - build-process: - runs-on: alt-p10 - outputs: - branch: ${{ env.BRANCH }} - org: ${{ env.ORG }} - url: ${{ env.URL }} - repo: ${{ env.REPO }} - buildres: ${{ steps.build-script.outcome }} - steps: - - name: Check workspace - run: | - repourl=$(echo $GU | cut -d '/' -f 3) - echo "URL=$repourl" >> ${GITHUB_ENV} - echo $repourl - reponame=$(echo $GR | cut -d '/' -f 1) - echo "REPO=$reponame" >> ${GITHUB_ENV} - echo $reponame - env: - GU: ${{ gitea.server_url }} - GR: ${{ gitea.repository }} - - name: Set repo for c10f2 (Temporary) - if: ${{ contains(github.ref_name, 'c10f2') }} - run: | - echo "event tag=${{ github.ref_name }}" - echo "10.4.0.3 update.altsp.su" >> /etc/hosts - echo "cat /etc/hosts" - cat /etc/hosts - - name: Update apt - uses: actions/init-alt-env@v1 - - name: Install requires - run: | - echo "apt-get install -y python3-module-tomli python3-module-jinja2 python3-module-yaml python3-module-requests podman buildah jq curl" - apt-get install -y python3-module-tomli python3-module-jinja2 python3-module-yaml python3-module-requests podman buildah jq curl - echo "apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc qemu-user-static-binfmt-riscv qemu-user-static-binfmt-loongarch" - apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc qemu-user-static-binfmt-riscv qemu-user-static-binfmt-loongarch - - name: Check out current repo - uses: actions/checkout@v4 - - name: Parse target branch and tag from events context, save to env - env: - EV: ${{ toJson(gitea.event) }} - run: | - echo $EV | jq '.ref' -r | sed "s/refs\/tags\//BRANCH=/g" | cut -d '_' -f 1 - echo $EV | jq '.ref' -r | sed "s/refs\/tags\//BRANCH=/g" | cut -d '_' -f 1 >> ${GITHUB_ENV} - org=$(echo $EV | jq '.ref' -r | sed 's/refs\/tags\///g' | cut -d '_' -f 2) - echo "ORG=$org" >> ${GITHUB_ENV} - echo "ORG=$org" - - name: Login podman gitea - run: | - echo "podman login ${{ env.URL }}" - podman login --username $P_USER --password $P_PASS ${{ env.URL }} - env: - P_USER: ${{ secrets.PODMAN_USER }} - P_PASS: ${{ secrets.PODMAN_PASS }} - - name: Run building script - id: build-script - run: | - build_args="-b $BR -o $ORG --skip-images alt/distroless-devel --arches amd64 386 arm64" - if [[ $ORG == 'k8s' ]]; then build_args="$build_args --tags tags.toml --overwrite-organization $ORG-$BR --skip-images k8s/kube-apiserver k8s/kube-controller-manager k8s/kube-proxy k8s/kube-scheduler"; fi - echo "build.py $build_args" - ${{ gitea.workspace }}/build.py $build_args - env: - ORG: ${{ env.ORG }} - BR: ${{ env.BRANCH }} - continue-on-error: true - - name: Send notification if build crashed - if: ${{ steps.build-script.outcome != 'success' }} - run: | - issueid=1 - body="Building images finish with some errors." - curl -X 'POST' "$URL/api/v1/repos/$REPO/image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s - echo "notification about test error is sent to issue $issueid" - env: - T: ${{ secrets.TOKEN }} - BR: ${{ env.BRANCH }} - URL: ${{ gitea.server_url }} - REPO: ${{ env.REPO }} - - name: Delete event tag - run: | - tagname=$(echo $EV | jq '.ref' -r | sed "s/refs\/tags\///g") - curl -X 'DELETE' "$URL/api/v1/repos/$REPO/image-forge/tags/$tagname?token=$T" -H 'accept: application/json' -s - echo "tag $tagname is deleted" - env: - T: ${{ secrets.TOKEN }} - BR: ${{ env.BRANCH }} - URL: ${{ gitea.server_url }} - REPO: ${{ env.REPO }} - EV: ${{ toJson(gitea.event) }} - test-process: - needs: build-process - if: ${{ needs.build-process.outputs.buildres == 'success' }} - runs-on: alt-p10 - steps: - - name: Update apt - uses: actions/init-alt-env@v1 - - name: Install requires - run: | - echo "apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah jq curl" - apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah jq curl - - name: Check out current repo - uses: https://gitea.com/actions/checkout@v4 - - name: Test - id: test-script - continue-on-error: true - run: | - $WS/.gitea/workflows/testscript $BR $ORG $URL $REPO $WS - cat haserr.log >> ${GITHUB_ENV} - echo "test process finished" - env: - BR: ${{ needs.build-process.outputs.branch }} - ORG: ${{ needs.build-process.outputs.org }} - URL: ${{ needs.build-process.outputs.url }} - REPO: ${{ needs.build-process.outputs.repo }} - WS: ${{ gitea.workspace }} - - name: Send notification if test crashed - if: ${{ env.ERR == 'true' || steps.test-script.outcome == 'failure' }} - run: | - issueid=1 - errors=$(cat errors.log) - body="Testing images finish with some errors. $errors" - curl -X 'POST' "$URL/api/v1/repos/$REPO/image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s - echo "notification about test error is sent to issue $issueid" - env: - T: ${{ secrets.TOKEN }} - BR: ${{ needs.build-process.outputs.branch }} - URL: ${{ gitea.server_url }} - REPO: ${{ needs.build-process.outputs.repo }} diff --git a/.gitea/workflows/wf_full_p11.yaml b/.gitea/workflows/wf_full_p11.yaml deleted file mode 100644 index 358a5c1..0000000 --- a/.gitea/workflows/wf_full_p11.yaml +++ /dev/null @@ -1,133 +0,0 @@ -name: Full building alt images -on: - push: - tags: - - 'p11_*' - -jobs: - build-process: - runs-on: alt-sisyphus - outputs: - branch: ${{ env.BRANCH }} - org: ${{ env.ORG }} - url: ${{ env.URL }} - repo: ${{ env.REPO }} - buildres: ${{ steps.build-script.outcome }} - steps: - - name: Check workspace - run: | - repourl=$(echo $GU | cut -d '/' -f 3) - echo "URL=$repourl" >> ${GITHUB_ENV} - echo $repourl - reponame=$(echo $GR | cut -d '/' -f 1) - echo "REPO=$reponame" >> ${GITHUB_ENV} - echo $reponame - env: - GU: ${{ gitea.server_url }} - GR: ${{ gitea.repository }} - - name: Set repo for p11 (Temporary) - if: ${{ contains(github.ref_name, 'p11') }} - run: | - echo "event tag=${{ github.ref_name }}" - echo "10.4.0.3 update.altsp.su" >> /etc/hosts - echo "cat /etc/hosts" - cat /etc/hosts - - name: Update apt - uses: actions/init-alt-env@v1 - - name: Install requires - run: | - echo "apt-get install -y python3-module-tomli python3-module-jinja2 python3-module-yaml python3-module-requests podman buildah jq curl" - apt-get install -y python3-module-tomli python3-module-jinja2 python3-module-yaml python3-module-requests podman buildah jq curl - echo "apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc qemu-user-static-binfmt-riscv qemu-user-static-binfmt-loongarch" - apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc qemu-user-static-binfmt-riscv qemu-user-static-binfmt-loongarch - - name: Check out current repo - uses: actions/checkout@v4 - - name: Parse target branch and tag from events context, save to env - env: - EV: ${{ toJson(gitea.event) }} - run: | - echo $EV | jq '.ref' -r | sed "s/refs\/tags\//BRANCH=/g" | cut -d '_' -f 1 - echo $EV | jq '.ref' -r | sed "s/refs\/tags\//BRANCH=/g" | cut -d '_' -f 1 >> ${GITHUB_ENV} - org=$(echo $EV | jq '.ref' -r | sed 's/refs\/tags\///g' | cut -d '_' -f 2) - echo "ORG=$org" >> ${GITHUB_ENV} - echo "ORG=$org" - - name: Login podman gitea - run: | - echo "podman login ${{ env.URL }}" - podman login --username $P_USER --password $P_PASS ${{ env.URL }} - env: - P_USER: ${{ secrets.PODMAN_USER }} - P_PASS: ${{ secrets.PODMAN_PASS }} - - name: Run building script - id: build-script - run: | - build_args="-b $BR -o $ORG --skip-images alt/distroless-devel --arches amd64 386 arm64" - if [[ $ORG == 'k8s' ]]; then build_args="$build_args --tags tags.toml --overwrite-organization $ORG-$BR --skip-images k8s/kube-apiserver k8s/kube-controller-manager k8s/kube-proxy k8s/kube-scheduler"; fi - echo "build.py $build_args" - ${{ gitea.workspace }}/build.py $build_args - env: - ORG: ${{ env.ORG }} - BR: ${{ env.BRANCH }} - continue-on-error: true - - name: Send notification if build crashed - if: ${{ steps.build-script.outcome != 'success' }} - run: | - issueid=1 - body="Building images finish with some errors." - curl -X 'POST' "$URL/api/v1/repos/$REPO/image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s - echo "notification about test error is sent to issue $issueid" - env: - T: ${{ secrets.TOKEN }} - BR: ${{ env.BRANCH }} - URL: ${{ gitea.server_url }} - REPO: ${{ env.REPO }} - - name: Delete event tag - run: | - tagname=$(echo $EV | jq '.ref' -r | sed "s/refs\/tags\///g") - curl -X 'DELETE' "$URL/api/v1/repos/$REPO/image-forge/tags/$tagname?token=$T" -H 'accept: application/json' -s - echo "tag $tagname is deleted" - env: - T: ${{ secrets.TOKEN }} - BR: ${{ env.BRANCH }} - URL: ${{ gitea.server_url }} - REPO: ${{ env.REPO }} - EV: ${{ toJson(gitea.event) }} - test-process: - needs: build-process - if: ${{ needs.build-process.outputs.buildres == 'success' }} - runs-on: alt-sisyphus - steps: - - name: Update apt - uses: actions/init-alt-env@v1 - - name: Install requires - run: | - echo "apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah jq curl" - apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah jq curl - - name: Check out current repo - uses: https://gitea.com/actions/checkout@v4 - - name: Test - id: test-script - continue-on-error: true - run: | - $WS/.gitea/workflows/testscript $BR $ORG $URL $REPO $WS - cat haserr.log >> ${GITHUB_ENV} - echo "test process finished" - env: - BR: ${{ needs.build-process.outputs.branch }} - ORG: ${{ needs.build-process.outputs.org }} - URL: ${{ needs.build-process.outputs.url }} - REPO: ${{ needs.build-process.outputs.repo }} - WS: ${{ gitea.workspace }} - - name: Send notification if test crashed - if: ${{ env.ERR == 'true' || steps.test-script.outcome == 'failure' }} - run: | - issueid=1 - errors=$(cat errors.log) - body="Testing images finish with some errors. $errors" - curl -X 'POST' "$URL/api/v1/repos/$REPO/image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s - echo "notification about test error is sent to issue $issueid" - env: - T: ${{ secrets.TOKEN }} - BR: ${{ needs.build-process.outputs.branch }} - URL: ${{ gitea.server_url }} - REPO: ${{ needs.build-process.outputs.repo }} diff --git a/.gitea/workflows/wf_single.yaml b/.gitea/workflows/wf_single.yaml index b2c7979..49657e9 100644 --- a/.gitea/workflows/wf_single.yaml +++ b/.gitea/workflows/wf_single.yaml @@ -6,7 +6,7 @@ on: jobs: build-process: - runs-on: alt-latest + runs-on: alt-sisyphus outputs: branch: ${{ env.BRANCH }} image: ${{ env.IMAGE }} @@ -115,7 +115,7 @@ jobs: test-process: needs: build-process if: ${{ needs.build-process.outputs.buildres == 'success' }} - runs-on: alt-latest + runs-on: alt-sisyphus steps: - name: Update apt uses: https://gitea.basealt.ru/actions/init-alt-env@v1