90 Commits
master ... new

Author SHA1 Message Date
90ff275009 Обновить .gitea/workflows/wf_test.yaml 2024-04-19 18:55:48 +03:00
3cb889958f Обновить .gitea/workflows/wf_test.yaml 2024-04-19 18:53:21 +03:00
eda31085fb Обновить .gitea/workflows/wf_test.yaml 2024-04-19 18:51:51 +03:00
9978a86d47 Обновить .gitea/workflows/wf_test.yaml 2024-04-19 18:47:29 +03:00
3afd8bc54e Обновить .gitea/workflows/wf_test.yaml 2024-04-19 18:41:42 +03:00
a12660480b Обновить .gitea/workflows/wf_full_sis.yaml 2024-04-19 10:38:50 +03:00
380a0edde2 Обновить .gitea/workflows/wf_full_sis.yaml 2024-04-19 10:23:37 +03:00
350b30deb8 Обновить .gitea/workflows/testscript 2024-04-18 14:21:07 +03:00
fa91af9346 Обновить .gitea/workflows/testscript 2024-04-18 13:58:32 +03:00
b2405d1e94 Обновить .gitea/workflows/testscript 2024-04-18 13:40:43 +03:00
56965e0770 Обновить .gitea/workflows/testscript 2024-04-18 13:16:08 +03:00
52a99cb816 Обновить .gitea/workflows/testscript 2024-04-18 13:15:41 +03:00
55ccd3baea Обновить .gitea/workflows/wf_full_p10.yaml 2024-04-18 12:37:00 +03:00
f314eede47 Обновить .gitea/workflows/wf_full_p10.yaml 2024-04-18 12:22:42 +03:00
ae072551ba Обновить .gitea/workflows/wf_full_p10.yaml 2024-04-18 12:04:36 +03:00
3de460f98b Обновить .gitea/workflows/wf_full_p10.yaml 2024-04-18 11:50:31 +03:00
a3b7569639 Обновить .gitea/workflows/wf_full_p10.yaml 2024-04-18 11:42:13 +03:00
0e0dd3fd46 Обновить .gitea/workflows/wf_full_p10.yaml 2024-04-18 11:06:57 +03:00
04bf7f182d Merge branch 'mymaster' 2024-04-18 10:27:50 +03:00
65ba744aa1 Merge remote-tracking branch 'refs/remotes/myrepo/master' 2024-04-17 20:01:09 +03:00
b9f1e5c287 add test script 2024-04-17 19:55:10 +03:00
e1fd09c37e Обновить .gitea/workflows/wf_full_sis.yaml 2024-04-17 18:39:03 +03:00
2d4dd5425b Обновить .gitea/workflows/wf_full_sis.yaml 2024-04-17 12:03:39 +03:00
10c33d2b86 Обновить .gitea/workflows/wf_full_sis.yaml 2024-04-16 19:50:51 +03:00
53b54589c6 Обновить .gitea/workflows/wf_full_p10.yaml 2024-04-16 19:10:26 +03:00
226e407ffa Обновить .gitea/workflows/wf_full_sis.yaml 2024-04-16 19:08:53 +03:00
a021602815 Обновить .gitea/workflows/wf_full_p10.yaml 2024-04-16 18:47:15 +03:00
da897f1524 Обновить .gitea/workflows/wf_full_sis.yaml 2024-04-16 18:46:14 +03:00
876b5dd69a Обновить .gitea/workflows/wf_full_sis.yaml 2024-04-16 18:43:55 +03:00
2a6b4f6d63 Обновить .gitea/workflows/wf_full_sis.yaml 2024-04-16 18:27:39 +03:00
d309a0913a Обновить .gitea/workflows/wf_full_p10.yaml 2024-04-16 18:02:15 +03:00
5cba21f04d Обновить .gitea/workflows/wf_full_sis.yaml 2024-04-16 17:44:17 +03:00
8483e80261 Обновить .gitea/workflows/wf_full_sis.yaml 2024-04-16 17:26:40 +03:00
22ae07c07e Добавить .gitea/workflows/wf_full_p10.yaml 2024-04-16 16:40:13 +03:00
7da6f533fd Обновить .gitea/workflows/wf_full_sis.yaml 2024-04-16 16:39:26 +03:00
5879650bb5 Обновить .gitea/workflows/wf_full.yaml 2024-04-16 16:37:49 +03:00
ec5dfc77c2 Обновить .gitea/workflows/wf_full.yaml 2024-04-16 16:08:03 +03:00
7308bf40ed Обновить .gitea/workflows/wf_full.yaml 2024-04-16 16:04:50 +03:00
048d9e0dc9 Обновить .gitea/workflows/wf_full2.yaml 2024-04-16 15:26:01 +03:00
8dde33afc9 Обновить .gitea/workflows/wf_full.yaml 2024-04-16 15:20:57 +03:00
f9ebe0e930 Обновить .gitea/workflows/wf_full2.yaml 2024-04-16 15:17:55 +03:00
4958cce4bb Обновить .gitea/workflows/wf_full2.yaml 2024-04-16 14:34:13 +03:00
6a7f3e4b47 Обновить .gitea/workflows/wf_full.yaml 2024-04-16 14:30:39 +03:00
219cfcf83c Обновить .gitea/workflows/wf_full2.yaml 2024-04-16 14:27:40 +03:00
6cfa2d4cda Обновить .gitea/workflows/wf_full.yaml 2024-04-16 14:23:14 +03:00
a023dc2db8 Обновить .gitea/workflows/wf_full.yaml 2024-04-16 14:21:07 +03:00
c73bfecccf Обновить .gitea/workflows/wf_full.yaml 2024-04-16 10:54:35 +03:00
7720676c88 add tests for k8s 2024-04-15 19:54:52 +03:00
78c4c97158 Обновить .gitea/workflows/wf_full2.yaml 2024-04-15 19:51:50 +03:00
0d9343fdb3 Обновить .gitea/workflows/wf_full2.yaml 2024-04-15 19:40:34 +03:00
7dc3d359db Обновить .gitea/workflows/wf_full2.yaml 2024-04-15 18:29:37 +03:00
403de130b3 Обновить .gitea/workflows/wf_full2.yaml 2024-04-15 17:49:43 +03:00
59bc095538 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 17:45:43 +03:00
91f1737489 Добавить .gitea/workflows/wf_full2.yaml 2024-04-15 17:36:59 +03:00
1fbe27bca4 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 17:25:07 +03:00
93927be6b3 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 17:04:10 +03:00
4ae36fcc13 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 16:51:36 +03:00
a1c2dd7846 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 16:44:32 +03:00
a0affe3b1b Обновить .gitea/workflows/wf_full.yaml 2024-04-15 16:35:53 +03:00
e876bd1bf0 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 16:30:15 +03:00
8ccf88f288 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 16:28:50 +03:00
c091d70ef6 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 16:19:16 +03:00
d563003aed Обновить .gitea/workflows/wf_full.yaml 2024-04-15 16:11:52 +03:00
f7a330b160 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 16:11:06 +03:00
22f7e136db Обновить .gitea/workflows/wf_full.yaml 2024-04-15 15:28:09 +03:00
0a2d821433 Обновить org/alt/base/test 2024-04-15 13:57:57 +03:00
91a49afff5 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 13:26:53 +03:00
d17b884447 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 13:12:54 +03:00
00494f0ccd Обновить .gitea/workflows/wf_full.yaml 2024-04-15 13:03:20 +03:00
d1f8704ce3 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 13:02:20 +03:00
138cd58024 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 12:25:25 +03:00
4db33da5e3 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 11:56:25 +03:00
9bec80e52d Обновить .gitea/workflows/wf_full.yaml 2024-04-15 11:50:43 +03:00
d1f1ba4867 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 10:38:29 +03:00
d9536bcf04 Обновить .gitea/workflows/wf_full.yaml 2024-04-15 10:27:24 +03:00
38b288c40c Обновить .gitea/workflows/wf_full.yaml 2024-04-12 16:04:32 +03:00
09dc78deaf Обновить .gitea/workflows/wf_test.yaml 2024-04-12 16:01:05 +03:00
b91b534067 Обновить .gitea/workflows/wf_full.yaml 2024-04-12 15:57:40 +03:00
836b9003e8 Обновить .gitea/workflows/wf_full.yaml 2024-04-12 15:56:38 +03:00
e00880a5e0 Обновить .gitea/workflows/wf_full.yaml 2024-04-12 15:50:34 +03:00
78d310fce1 Обновить .gitea/workflows/wf_full.yaml 2024-04-12 15:42:33 +03:00
d957ee81ad add full test 2024-04-12 15:04:06 +03:00
5adbf02c90 add test workflow 2024-04-12 13:01:34 +03:00
716c7e5331 Обновить .gitea/workflows/wf.yaml 2024-04-11 17:59:40 +03:00
7b4fa36a1f Обновить .gitea/workflows/wf.yaml 2024-04-11 17:45:31 +03:00
299cc889f0 Обновить .gitea/workflows/wf_test.yaml 2024-04-11 17:29:37 +03:00
52bdd4d05f Обновить .gitea/workflows/wf_test.yaml 2024-04-11 17:04:38 +03:00
9026f3412c Обновить .gitea/workflows/wf_test.yaml 2024-04-11 17:02:23 +03:00
3936f1cd58 Обновить .gitea/workflows/wf_test.yaml 2024-04-11 16:17:23 +03:00
065c19863d add tests 2024-04-11 16:10:52 +03:00
35 changed files with 661 additions and 57 deletions

View File

@ -0,0 +1,74 @@
name: 'Reusable test job'
description: 'Test for images'
outputs:
result:
description: "Result of test (success|failure)"
value: ${{ jobs.example_job.outputs.output1 }}
inputs:
image: string
branch: string
url: string
repo: string
runs:
using: 'composite'
steps:
- name: Update apt
uses: https://gitea.basealt.ru/actions/init-alt-env@v1
- name: Install requires
run: |
echo "apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah"
apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah
echo "apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc"
apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc
- name: Check out current repo
uses: https://gitea.com/actions/checkout@v4
with:
repository: ${{ gitea.server_url }}/${{ inputs.repo }}/gitea-image-forge
- name: Get test for image
run: |
if test -f ${{ gitea.workspace }}/org/$IM/test; then testscript=$(cat ${{ gitea.workspace }}/org/$IM/test); else testscript=""; fi
echo "TEST=$testscript" >> ${GITHUB_ENV}
echo "test script: $testscript"
env:
IM: ${{ inputs.image }}
BR: ${{ inputs.branch }}
- name: Run test
id: test-script
if: ${{ env.TEST != '' }}
continue-on-error: true
uses: https://gitea.basealt.ru/actions/podman-run-action@v2
with:
image: ${{ inputs.url }}/${{ inputs.repo }}/${{ inputs.image }}:${{ inputs.branch }}
options: --rm
run: ${{ env.TEST }}
- name: Run special test
id: special-test
if: ${{ env.TEST == '' }}
continue-on-error: true
run: |
if [[ IM = 'alt/distroless-true' ]]; then podman run --rm $URL/$REPO/$IM:$BR true; fi
if [[ IM = 'alt/distroless-gotop' ]]; then podman run --rm $URL/$REPO/$IM:$BR --version; fi
env:
IM: ${{ inputs.image }}
BR: ${{ inputs.branch }}
URL: ${{ inputs.url }}
- name: Send notification if test crashed
if: ${{ steps.test-script.outcome == 'failure' || steps.special-test.outcome == 'failure' }}
run: |
issueid=$(curl -X 'GET' "$URL/api/v1/repos/$REPO/gitea-image-forge/issues?state=all&type=issues&page=1&limit=1&token=$T" -H 'accept: application/json' -s | jq '.[].number' -r)
body="Building of image $IM for branch $BR is failed"
curl -X 'POST' "$URL/api/v1/repos/$REPO/gitea-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 }}
URL: ${{ gitea.server_url }}
IM: ${{ inputs.image }}
BR: ${{ inputs.branch }}
REPO: ${{ inputs.repo }}
- name: Finish test
run: echo "finish test for image $IM on branch $BR"
env:
IM: ${{ inputs.image }}
BR: ${{ inputs.branch }}

65
.gitea/workflows/testscript Executable file
View File

@ -0,0 +1,65 @@
#!/bin/bash
#$1 - ${{ needs.build-process.outputs.branch }}
#$2 - ${{ needs.build-process.outputs.org }}
#$3 - ${{ needs.build-process.outputs.url }}
#$4 - ${{ needs.build-process.outputs.repo }}
#$5 - ${{ gitea.workspace }}
errors=''
haserr=false
for IM in $(ls $5/org/$2/ | xargs)
do
echo "image=$IM"
if test -f $5/org/$2/$IM/test
then
test=$(cat $5/org/$2/$IM/test)
else test=''
fi
echo "test script=$test"
imgpath="$2/$IM:$1"
if [[ $2 == 'k8s' ]]
then imgpath="$2-$1/$IM:latest"
fi
command="echo empty_command"
if [[ $test != '' ]]; then
command="podman run --rm --entrypoint=\"/bin/sh\" $3/$4/$imgpath -c \"$test\""
else
if [[ $IM = 'distroless-true' ]]; then
command="podman run --rm $3/$4/$imgpath \"true\""
fi
if [[ $IM = 'distroless-gotop' ]]; then
command="podman run --rm $3/$4/$imgpath \"--version\""
fi
if [[ $IM = 'flannel-cni-plugin' ]]; then
command="podman run --rm $3/$4/$imgpath \"/flannel\""
fi
if [[ $IM = 'pause' ]]; then
command="podman run --rm $3/$4/$imgpath \"/pause\" \"-v\""
fi
fi
echo $command
eval $command 2>$IM.log || haserr=true
echo "podman rmi --all"
podman rmi --all
if [ "$haserr" = true ]
then
if [[ $(cat $IM.log) != '' ]]
then errors="TEST ERROR OF IMAGE $IM: $(cat $IM.log); $errors"
else errors="TEST ERROR OF IMAGE $IM: test returned empty error, but exit status was nozero; $errors"
fi
fi
haserr=false
done
echo "$errors"
if [[ $errors != '' ]]
then haserr=true
fi
echo "ERR=$haserr" > haserr.log
echo $errors > errors.log

View File

@ -5,14 +5,14 @@ on:
- '*_*/*'
jobs:
build_process:
build-process:
runs-on: alt-latest
outputs:
branch: ${{ env.BRANCH }}
image: ${{ env.IMAGE }}
url: ${{ env.URL }}
repo: ${{ env.REPO }}
buildres: ${{ steps.build_script.outcome }}
buildres: ${{ steps.build-script.outcome }}
test: ${{ env.TEST }}
steps:
- name: Check workspace
@ -25,9 +25,7 @@ jobs:
GU: ${{ gitea.server_url }}
GR: ${{ gitea.repository }}
- name: Update apt
run: |
echo "apt-get update -y && apt-get install -y apt rpm"
apt-get update -y && apt-get install -y apt rpm
uses: https://gitea.basealt.ru/actions/init-alt-env@v1
- name: Install requires
run: |
echo "apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah jq"
@ -57,13 +55,13 @@ jobs:
echo "IMAGE=$localimage"
- name: Get test for image
run: |
testscript=$(cat ${{ gitea.workspace }}/org/$IM/test)
if test -f ${{ gitea.workspace }}/org/$IM/test; then testscript=$(cat ${{ gitea.workspace }}/org/$IM/test); else testscript=""; fi
echo "TEST=$testscript" >> ${GITHUB_ENV}
env:
IM: ${{ env.IMAGE }}
BR: ${{ env.BRANCH }}
- name: Run building script
id: build_script
id: build-script
run: |
echo "build.py -i $IM -b $BR"
if [[ $BR == 'sisyphus' ]]; then ${{ gitea.workspace }}/build.py -i $IM -b $BR --skip-arches arm; else ${{ gitea.workspace }}/build.py -i $IM -b $BR; fi
@ -71,17 +69,14 @@ jobs:
IM: ${{ env.IMAGE }}
BR: ${{ env.BRANCH }}
continue-on-error: true
test_process:
if: ${{ jobs.build_process.env.BUILDRES == 'success' }}
needs: build_process
test-process:
needs: build-process
runs-on: alt-latest
outputs:
testres: ${{ steps.test_script.outcome }}
testres: ${{ steps.test-script.outcome == 'success' || steps.special-test.outcome == 'success' }}
steps:
- name: Update apt
run: |
echo "apt-get update -y && apt-get install -y apt rpm"
apt-get update -y && apt-get install -y apt rpm
uses: https://gitea.basealt.ru/actions/init-alt-env@v1
- name: Install requires
run: |
echo "apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah"
@ -89,22 +84,33 @@ jobs:
echo "apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc"
apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc
- name: Run test
id: test_script
id: test-script
if: ${{ needs.build-process.outputs.buildres == 'success' && needs.build-process.outputs.test != '' }}
continue-on-error: true
uses: https://gitea.basealt.ru/actions/podman-run-action@v2
with:
image: ${{ needs.build_process.outputs.url }}/${{ needs.build_process.outputs.repo }}/${{ needs.build_process.outputs.image }}:${{ needs.build_process.outputs.branch }}
image: ${{ needs.build-process.outputs.url }}/${{ needs.build-process.outputs.repo }}/${{ needs.build-process.outputs.image }}:${{ needs.build-process.outputs.branch }}
options: --rm
run: ${{ needs.build_process.outputs.test }}
- name: Run special test
id: special-test
if: ${{ needs.build-process.outputs.buildres == 'success' && needs.build-process.outputs.test == '' }}
continue-on-error: true
run: |
if [[ IM = 'alt/distroless-true' ]]; then podman run --rm $URL/$REPO/$IM:$BR true; fi
if [[ IM = 'alt/distroless-gotop' ]]; then podman run --rm $URL/$REPO/$IM:$BR --version; fi
env:
IM: ${{ needs.build-process.outputs.image }}
BR: ${{ needs.build-process.outputs.branch }}
URL: ${{ needs.build-process.outputs.url }}
REPO: ${{ needs.build-process.outputs.repo }}
finish_process:
needs: [ build_process, test_process ]
needs: [ build-process, test-process ]
runs-on: alt-latest
steps:
- name: Update apt
run: |
echo "apt-get update -y && apt-get install -y apt rpm"
apt-get update -y && apt-get install -y apt rpm
- name: Update apt
uses: https://gitea.basealt.ru/actions/init-alt-env@v1
- name: Install requires
run: |
echo "apt-get install -y curl jq"
apt-get install -y curl jq
@ -115,22 +121,22 @@ jobs:
echo "tag $BR_$IM is deleted"
env:
T: ${{ secrets.TOKEN }}
URL: ${{ needs.build_process.outputs.url }}
REPO: ${{ needs.build_process.outputs.repo }}
IM: ${{ needs.build_process.outputs.image}}
BR: ${{ needs.build_process.outputs.branch }}
URL: ${{ needs.build-process.outputs.url }}
REPO: ${{ needs.build-process.outputs.repo }}
IM: ${{ needs.build-process.outputs.image }}
BR: ${{ needs.build-process.outputs.branch }}
EV: ${{ toJson(gitea.event) }}
continue-on-error: true
- name: Send comment to issue for notification
run: |
issueid=$(curl -X 'GET' "https://$URL/api/v1/repos/$REPO/gitea-image-forge/issues?state=all&type=issues&page=1&limit=1&token=$T" -H 'accept: application/json' -s | jq '.[].number' -r)
if [[ ${ needs.build_process.outputs.buildres }} = "success" ]] && [[ ${{ needs.test_process.outputs.testres }} = "success" ]]; then body="Building of image $IM for branch $BR finished success"; else body="Testing of image $IM for branch $BR is failed"; fi
if [[ ${{ needs.build_process.outputs.buildres }} != 'success' ]]; then body="Building of image $IM for branch $BR is failed"; fi
if [[ ${{ needs.build-process.outputs.buildres }} = 'success' ]] && [[ ${{ needs.test-process.outputs.testres }} ]]; then body="Building of image $IM for branch $BR finished success"; else body="Testing of image $IM for branch $BR is failed"; fi
if [[ ${{ needs.build-process.outputs.buildres }} != 'success' ]]; then body="Building of image $IM for branch $BR is failed"; fi
curl -X 'POST' "https://$URL/api/v1/repos/$REPO/gitea-image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s
echo "notification is sent"
echo "notification is sent to issue $issueid"
env:
T: ${{ secrets.TOKEN }}
URL: ${{ needs.build_process.outputs.url }}
REPO: ${{ needs.build_process.outputs.repo }}
IM: ${{ needs.build_process.outputs.image}}
BR: ${{ needs.build_process.outputs.image}}
URL: ${{ needs.build-process.outputs.url }}
REPO: ${{ needs.build-process.outputs.repo }}
IM: ${{ needs.build-process.outputs.image }}
BR: ${{ needs.build-process.outputs.branch }}

View File

@ -0,0 +1,169 @@
name: Full building alt images v2
on:
push:
tags:
- '*#*'
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: Update apt
uses: https://gitea.basealt.ru/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
echo "apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc"
apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc
- name: Check out current repo
uses: https://gitea.com/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"
if [[ $BR == 'sisyphus' ]]; then build_args="$build_args --skip-arches arm"; fi
if [[ $ORG == 'k8s' ]]; then build_args="$build_args --overwrite-organization $ORG-$BR"; fi
echo "build.py $build_args"
${{ gitea.workspace }}/build.py $build_args -i alt/distroless-true
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=$(curl -X 'GET' "$URL/api/v1/repos/$REPO/gitea-image-forge/issues?state=all&type=issues&page=1&limit=1&token=$T" -H 'accept: application/json' -s | jq '.[].number' -r)
body="Building images finish with some errors."
curl -X 'POST' "$URL/api/v1/repos/$REPO/gitea-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/gitea-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-alt:
needs: build-process
if: ${{ needs.build-process.outputs.buildres == 'success' && needs.build-process.outputs.org == 'alt' }}
runs-on: alt-p10
strategy:
max-parallel: 5
matrix:
images:
- apache2
- base
- buildpack-deps
- buildpack-deps-curl
- buildpack-deps-scm
- devel
- distroless-base
- distroless-builder
- distroless-devel
- distroless-gotop
- distroless-static
- distroless-true
- etcd
- gitea
- nginx
- node
- prometheus
- python
- registry
- ruby
- systemd
- unit
steps:
- name: Update apt
uses: ${{ gitea.server_url }}/actions/init-alt-env@v1
- name: Install requires
run: |
echo "apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah curl jq"
apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah curl jq
- uses: https://gitea.basealt.ru/actions/image-forge-test@v1
continue-on-error: true
with:
image: ${{ matrix.images }}
branch: ${{ needs.build-process.outputs.branch }}
org: ${{ needs.build-process.outputs.org }}
url: ${{ needs.build-process.outputs.url }}
repo: ${{ needs.build-process.outputs.repo }}
test-process-k8s:
needs: build-process
if: ${{ needs.build-process.outputs.buildres == 'success' && needs.build-process.outputs.org == 'k8s' }}
runs-on: alt-p10
strategy:
max-parallel: 5
matrix:
images:
- cert-manager-cainjector
- cert-manager-controller
- cert-manager-webhook
- coredns
- etcd
- flannel
- flannel-cni-plugin
- kube-apiserver
- kube-controller-manager
- kube-proxy
- kube-scheduler
- pause
- trivy-node-collector
steps:
- name: Update apt
uses: ${{ gitea.server_url }}/actions/init-alt-env@v1
- name: Install requires
run: |
echo "apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah curl jq"
apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah curl jq
- uses: https://gitea.basealt.ru/actions/image-forge-test@v1
continue-on-error: true
with:
image: ${{ matrix.images }}
branch: ${{ needs.build-process.outputs.branch }}
org: ${{ needs.build-process.outputs.org }}
url: ${{ needs.build-process.outputs.url }}
repo: ${{ needs.build-process.outputs.repo }}

View File

@ -0,0 +1,136 @@
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: 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-repo"
apt-get install -y python3-module-tomli python3-module-jinja2 podman buildah jq curl apt-repo
#echo "apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc"
#apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc
echo "apt-repo add 345290 && apt-get update"
apt-repo add 345290 && apt-get update
echo "apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc"
apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc
- 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"
#-o $ORG --skip-images alt/distroless-devel
if [[ $BR == 'sisyphus' ]]; then build_args="$build_args --skip-arches arm"; fi
if [[ $ORG == 'k8s' ]]; then build_args="$build_args --tags tags.toml --overwrite-organization $ORG-$BR"; 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=$(curl -X 'GET' "$URL/api/v1/repos/$REPO/gitea-image-forge/issues?state=open&labels=building&type=issues&page=1&limit=1&token=$T" -H 'accept: application/json' -s | jq '.[].number' -r)
if [[ $issueid != '' ]]; then \
body="Building images finish with some errors."; \
curl -X 'POST' "$URL/api/v1/repos/$REPO/gitea-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"; \
else echo "no issue to send notification"; fi
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/gitea-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=$(curl -X 'GET' "$URL/api/v1/repos/$REPO/gitea-image-forge/issues?state=open&labels=building&type=issues&page=1&limit=1&token=$T" -H 'accept: application/json' -s | jq '.[].number' -r)
if [[ $issueid != '' ]]; then \
errors=$(cat errors.log); \
body="Testing images finish with some errors. $errors"; \
curl -X 'POST' "$URL/api/v1/repos/$REPO/gitea-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"; \
else echo "no issue to send notification"; fi
env:
T: ${{ secrets.TOKEN }}
BR: ${{ needs.build-process.outputs.branch }}
URL: ${{ gitea.server_url }}
REPO: ${{ needs.build-process.outputs.repo }}

View File

@ -0,0 +1,132 @@
name: Full building alt images
on:
push:
tags:
- 'sisyphus_*'
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: 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
echo "apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc"
apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc
- 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"
#-o $ORG --skip-images alt/distroless-devel
if [[ $BR == 'sisyphus' ]]; then build_args="$build_args --skip-arches arm"; fi
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=$(curl -X 'GET' "$URL/api/v1/repos/$REPO/gitea-image-forge/issues?state=open&labels=building&type=issues&page=1&limit=1&token=$T" -H 'accept: application/json' -s | jq '.[].number' -r)
if [[ $issueid != '' ]]; then \
body="Building images finish with some errors."; \
curl -X 'POST' "$URL/api/v1/repos/$REPO/gitea-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"; \
else echo "no issue to send notification"; fi
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/gitea-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=$(curl -X 'GET' "$URL/api/v1/repos/$REPO/gitea-image-forge/issues?state=open&labels=building&type=issues&page=1&limit=1&token=$T" -H 'accept: application/json' -s | jq '.[].number' -r)
if [[ $issueid != '' ]]; then \
errors=$(cat errors.log); \
body="Testing images finish with some errors. $errors"; \
curl -X 'POST' "$URL/api/v1/repos/$REPO/gitea-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"; \
else echo "no issue to send notification"; fi
env:
T: ${{ secrets.TOKEN }}
BR: ${{ needs.build-process.outputs.branch }}
URL: ${{ gitea.server_url }}
REPO: ${{ needs.build-process.outputs.repo }}

View File

@ -1,23 +1,21 @@
name: Test_wf
name: Test job
on:
push:
tags:
- '*'
- 'test*'
jobs:
Test-job:
test-job:
runs-on: alt-latest
env:
TEST: "gitea --version"
steps:
- name: Update apt
run: apt-get update -y && apt-get install -y apt rpm
- name: Install reqs
run: apt-get install -y podman buildah
- name: Podman run
uses: https://gitea.basealt.ru/actions/podman-run-action@v2
with:
image: gitea.basealt.ru/images_repo/alt/gitea
options: --rm
run: ${{ env.TEST }}
- run: echo "This job's status is ${{ job.status }}"
- name: Parse target branch
run: |
echo $EV
echo $RE
echo $RE2
echo $BR
env:
EV: ${{ toJson(gitea.event) }}
RE: ${{ github.ref_name }}
RE2: ${{ github.ref }}
BR: ${{ github.head_ref }}

View File

@ -32,5 +32,3 @@ On x86_64 machine using p10 branch you need:
- `qemu-user-static-binfmt-aarch64` to build for arm64 architecture
- `qemu-user-static-binfmt-arm` to build for arm architecture
- `qemu-user-static-binfmt-ppc` to build for ppc64le architecture

1
org/alt/base/test Normal file
View File

@ -0,0 +1 @@
LC_ALL=ru_RU.UTF-8 TZ=/usr/share/zoneinfo/Europe/Moscow date| grep MSK

View File

@ -0,0 +1 @@
curl --version;gpg --version

View File

@ -0,0 +1 @@
git --version;hg --version

View File

@ -0,0 +1 @@
gcc --version;make --version

1
org/alt/devel/test Normal file
View File

@ -0,0 +1 @@
man --version;ip -V;vim --version | grep vim

View File

@ -0,0 +1 @@
apt-repo --version

View File

@ -0,0 +1 @@
ss -V

1
org/alt/etcd/test Normal file
View File

@ -0,0 +1 @@
etcdctl version

1
org/alt/nginx/test Normal file
View File

@ -0,0 +1 @@
nginx -v

1
org/alt/node/test Normal file
View File

@ -0,0 +1 @@
node -v

1
org/alt/prometheus/test Normal file
View File

@ -0,0 +1 @@
prometheus --version

View File

@ -1 +1 @@
python3 --help
python3 --version

1
org/alt/registry/test Normal file
View File

@ -0,0 +1 @@
registry --version

1
org/alt/ruby/test Normal file
View File

@ -0,0 +1 @@
ruby --version

1
org/alt/systemd/test Normal file
View File

@ -0,0 +1 @@
ls -la /sbin/init | grep systemd

1
org/alt/unit/test Normal file
View File

@ -0,0 +1 @@
unitd --version

View File

@ -0,0 +1 @@
cainjector --help

View File

@ -0,0 +1 @@
controller --help

View File

@ -0,0 +1 @@
webhook --help

1
org/k8s/coredns/test Normal file
View File

@ -0,0 +1 @@
coredns --version

1
org/k8s/etcd/test Normal file
View File

@ -0,0 +1 @@
etcd --version

1
org/k8s/flannel/test Normal file
View File

@ -0,0 +1 @@
flanneld --version

View File

@ -0,0 +1 @@
kube-apiserver --version

View File

@ -0,0 +1 @@
kube-controller-manager --version

1
org/k8s/kube-proxy/test Normal file
View File

@ -0,0 +1 @@
kube-proxy --version

View File

@ -0,0 +1 @@
kube-scheduler --version

View File

@ -0,0 +1 @@
node-collector --help