2 Commits

7 changed files with 122 additions and 122 deletions

View File

@ -1,16 +1,30 @@
name: Full building alt images
on:
push:
tags:
- '*_*'
- '!*_k8s'
workflow_dispatch:
inputs:
branch:
description: 'Branch'
required: true
default: 'sisyphus'
type: choice
options:
- sisyphus
- p10
- p11
- c10f2
group:
description: 'Images group'
required: true
type: choice
options:
- base
- alt
- kubevirt
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 }}
@ -27,22 +41,15 @@ jobs:
run: |
repourl=$(echo $GU | cut -d '/' -f 3)
echo "URL=$repourl" >> ${GITHUB_ENV}
echo $repourl
echo "URL=$repourl"
reponame=$(echo $GR | cut -d '/' -f 1)
echo "REPO=$reponame" >> ${GITHUB_ENV}
echo $reponame
echo "REPO=$reponame"
echo "GROUP=${{ inputs.group }}"
echo "BRANCH=${{ inputs.branch }}"
env:
GU: ${{ gitea.server_url }}
GR: ${{ gitea.repository }}
- 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: Check out current repo
uses: actions/checkout@v4
- name: Change vendor label for c10f
@ -55,7 +62,7 @@ jobs:
echo "sed -i 's/ALT Linux Team/BaseALT LLC/g' ${{ gitea.workspace }}/org/$ORG/*/info.yaml ||:"
sed -i 's/ALT Linux Team/BaseALT LLC/g' ${{ gitea.workspace }}/org/$ORG/*/info.yaml ||:
env:
ORG: ${{ env.ORG }}
ORG: ${{ inputs.group }}
- name: Set repo for c10f2 (Temporary)
if: ${{ contains(github.ref_name, 'c10f2') }}
run: |
@ -80,8 +87,8 @@ jobs:
echo "${{ gitea.workspace }}/build.py $build_args $arches"
${{ gitea.workspace }}/build.py $build_args $arches
env:
ORG: ${{ env.ORG }}
BR: ${{ env.BRANCH }}
ORG: ${{ inputs.group }}
BR: ${{ inputs.branch }}
BUILD_URL: "gitea.basealt.ru/alt"
continue-on-error: true
- name: Send notification if build crashed
@ -93,20 +100,9 @@ jobs:
echo "notification about test error is sent to issue $issueid"
env:
T: ${{ secrets.TOKEN }}
BR: ${{ env.BRANCH }}
BR: ${{ inputs.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' && needs.build-process.outputs.org != 'k8s' }}
@ -128,8 +124,8 @@ jobs:
cat haserr.log >> ${GITHUB_ENV}
echo "test process finished"
env:
BR: ${{ needs.build-process.outputs.branch }}
ORG: ${{ needs.build-process.outputs.org }}
BR: ${{ inputs.branch }}
ORG: ${{ inputs.group }}
URL: ${{ needs.build-process.outputs.url }}
REPO: ${{ needs.build-process.outputs.repo }}
WS: ${{ gitea.workspace }}
@ -143,6 +139,6 @@ jobs:
echo "notification about test error is sent to issue $issueid"
env:
T: ${{ secrets.TOKEN }}
BR: ${{ needs.build-process.outputs.branch }}
BR: ${{ inputs.branch }}
URL: ${{ gitea.server_url }}
REPO: ${{ needs.build-process.outputs.repo }}

View File

@ -1,27 +1,37 @@
name: Full building alt images
on:
push:
tags:
- "*_k8s"
workflow_dispatch:
inputs:
branch:
description: 'Branch'
required: true
default: 'sisyphus'
type: choice
options:
- sisyphus
- p10
- p11
- c10f2
env:
ORG: k8s
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
- name: Check workspace and inputs
run: |
repourl=$(echo $GU | cut -d '/' -f 3)
echo "URL=$repourl" >> ${GITHUB_ENV}
echo $repourl
echo "URL=$repourl"
reponame=$(echo $GR | cut -d '/' -f 1)
echo "REPO=$reponame" >> ${GITHUB_ENV}
echo $reponame
echo "REPO=$reponame"
echo "BRANCH=${{ inputs.branch }}"
env:
GU: ${{ gitea.server_url }}
GR: ${{ gitea.repository }}
@ -40,15 +50,6 @@ jobs:
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-riscv qemu-user-static-binfmt-loongarch"
apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-riscv qemu-user-static-binfmt-loongarch
- 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: Check out current repo
uses: actions/checkout@v4
- name: Change vendor label for c10f
@ -78,7 +79,7 @@ jobs:
${{ gitea.workspace }}/.gitea/workflows/k8s_buildscript.py --branch "$BR" --other-build-args "$build_args" --workspace "${{ gitea.workspace }}"
env:
ORG: ${{ env.ORG }}
BR: ${{ env.BRANCH }}
BR: ${{ inputs.branch }}
BUILD_URL: "gitea.basealt.ru/alt"
continue-on-error: true
- name: Send notification if build crashed
@ -90,17 +91,6 @@ jobs:
echo "notification about test error is sent to issue $issueid"
env:
T: ${{ secrets.TOKEN }}
BR: ${{ env.BRANCH }}
BR: ${{ inputs.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) }}

View File

@ -1,21 +1,44 @@
name: Building alt images
on:
push:
tags:
- '*_*/*_*'
workflow_dispatch:
inputs:
group:
description: 'Image group'
required: true
type: choice
options:
k8s
kubevirt
alt
base
branch:
description: 'Branch'
required: true
default: 'sisyphus'
type: choice
options:
- sisyphus
- p10
- p11
- c10f2
image:
description: 'Image name'
required: true
type: string
version:
description: 'Needed version'
type: string
jobs:
build-process:
runs-on: alt-sisyphus
outputs:
branch: ${{ env.BRANCH }}
image: ${{ env.IMAGE }}
url: ${{ env.URL }}
repo: ${{ env.REPO }}
buildres: ${{ steps.build-script.outcome }}
test: ${{ env.TEST }}
steps:
- name: Check workspace
- name: Check workspace and inputs
run: |
repourl=$(echo $GU | cut -d '/' -f 3)
echo "URL=$repourl" >> ${GITHUB_ENV}
@ -23,6 +46,10 @@ jobs:
reponame=$(echo $GR | cut -d '/' -f 1)
echo "REPO=$reponame" >> ${GITHUB_ENV}
echo "REPO=$reponame"
echo "BRANCH=${{ inputs.branch }}"
echo "ORG=${{ inputs.group }}"
echo "IMAGE=${{ inputs.image }}"
echo "VERSION=${{ inputs.version }}"
env:
GU: ${{ gitea.server_url }}
GR: ${{ gitea.repository }}
@ -50,24 +77,6 @@ jobs:
env:
P_USER: ${{ secrets.PODMAN_USER }}
P_PASS: ${{ secrets.PODMAN_PASS }}
- name: Check files in the repository
run: |
ls -a ${{ gitea.workspace }}
- 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}
localimage=$(echo $EV | jq '.ref' -r | sed 's/refs\/tags\///g' | cut -d '_' -f 2)
echo "IMAGE=$localimage" >> ${GITHUB_ENV}
echo "IMAGE=$localimage"
org=$(echo "$localimage" | cut -d '/' -f 1)
echo "ORG=$org" >> ${GITHUB_ENV}
echo "ORG=$org"
ver=$(echo $EV | jq '.ref' -r | sed 's/refs\/tags\///g' | cut -d '_' -f 3)
echo "VER=$ver" >> ${GITHUB_ENV}
echo "VER=$ver"
- name: Change vendor label for c10f
if: ${{ contains(github.ref_name, 'c10f') }}
run: |
@ -78,14 +87,14 @@ jobs:
echo "sed -i 's/ALT Linux Team/BaseALT LLC/g' ${{ gitea.workspace }}/org/$ORG/*/info.yaml ||:"
sed -i 's/ALT Linux Team/BaseALT LLC/g' ${{ gitea.workspace }}/org/$ORG/*/info.yaml ||:
env:
ORG: ${{ env.ORG }}
ORG: ${{ inputs.group }}
- 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}
env:
IM: ${{ env.IMAGE }}
BR: ${{ env.BRANCH }}
IM: ${{ inputs.image }}
BR: ${{ inputs.branch }}
- name: Run building script
id: build-script
run: |
@ -94,10 +103,10 @@ jobs:
echo "build.py -i $IM -b $BR $arches $k8sarg"
${{ gitea.workspace }}/build.py -i $IM -b $BR $arches --latest $BR --log-level debug --registry gitea.basealt.ru/alt $k8sarg
env:
IM: ${{ env.IMAGE }}
VER: ${{ env.VER }}
BR: ${{ env.BRANCH }}
ORG: ${{ env.ORG }}
IM: ${{ inputs.image }}
VER: ${{ inputs.version }}
BR: ${{ inputs.branch }}
ORG: ${{ inputs.group }}
continue-on-error: true
- name: Send notification if build crashed
if: ${{ steps.build-script.outcome != 'success' }}
@ -108,21 +117,10 @@ jobs:
echo "notification about test error is sent to issue $issueid"
env:
T: ${{ secrets.TOKEN }}
BR: ${{ env.BRANCH }}
BR: ${{ inputs.branch }}
URL: ${{ gitea.server_url }}
REPO: ${{ env.REPO }}
IM: ${{ env.IMAGE }}
- 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) }}
IM: ${{ inputs.image }}
test-process:
needs: build-process
if: ${{ needs.build-process.outputs.buildres == 'success' }}
@ -142,8 +140,8 @@ jobs:
imname=$(echo "$IM" | cut -d "/" -f2)
if [[ "$IM" == *"k8s"* ]]; then echo "skip tests for k8s images"; else podman run --rm --entrypoint="/bin/sh" $URL/$REPO/$BR/$imname:latest -c "$TEST"; fi
env:
IM: ${{ needs.build-process.outputs.image }}
BR: ${{ needs.build-process.outputs.branch }}
IM: ${{ inputs.image }}
BR: ${{ inputs.branch }}
URL: ${{ needs.build-process.outputs.url }}
REPO: ${{ needs.build-process.outputs.repo }}
TEST: ${{ needs.build-process.outputs.test }}
@ -156,8 +154,8 @@ jobs:
if [[ $IM = 'alt/distroless-true' ]]; then podman run --rm $URL/$REPO/$BR/$imname:latest true; fi
if [[ $IM = 'alt/distroless-gotop' ]]; then podman run --rm $URL/$REPO/$BR/$imname:latest --version; fi
env:
IM: ${{ needs.build-process.outputs.image }}
BR: ${{ needs.build-process.outputs.branch }}
IM: ${{ inputs.image }}
BR: ${{ inputs.branch }}
URL: ${{ needs.build-process.outputs.url }}
REPO: ${{ needs.build-process.outputs.repo }}
- name: Send notification if test crashed
@ -165,13 +163,13 @@ jobs:
run: |
issueid=1
errors=$(cat errors.log)
body="Testing image $IM finish with some errors."
body="Testing image $IM 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 }}
BR: ${{ inputs.branch }}
URL: ${{ gitea.server_url }}
REPO: ${{ needs.build-process.outputs.repo }}
IM: ${{ needs.build-process.outputs.image }}
IM: ${{ inputs.image }}

View File

@ -13,9 +13,14 @@ LABEL org.opencontainers.image.vendor="ALT Linux Team"
"php8.2",
"php8.2-xdebug",
) }}
{% elseif branch == 'c10f2' %}
{{ install_packages(
"php8.3",
"php8.3-xdebug",
) }}
{% else %}
{{ install_packages(
"php8.3",
"php8.3-xdebug",
"php8.4",
"php8.4-xdebug",
) }}
{% endif %}

View File

@ -3,10 +3,12 @@ is_versioned: true
version_template: "{{ version }}"
source_packages:
- >
{%- if branch in [ "p10", "c10f1", "c10f2"] -%}
{%- if branch in ["p10", "c10f1"] -%}
php8.2
{%- else -%}
{%- elseif branch in ["c10f2"] -%}
php8.3
{%- else -%}
php8.4
{%- endif -%}
annotations:
org.opencontainers.image.revision: ''

View File

@ -7,8 +7,12 @@ LABEL org.opencontainers.image.description="PostgreSQL rograms and libraries"
LABEL org.opencontainers.image.source="https://github.com/postgres/postgres"
LABEL org.opencontainers.image.licenses="PostgreSQL"
LABEL org.opencontainers.image.vendor="ALT Linux Team"
{% if branch == 'c10f2' %}
{{ install_packages("postgresql16","postgresql16-server") }}
{% else %}
{{ install_packages("postgresql17","postgresql17-server") }}
{% endif %}
RUN usermod -a -G postgres postgres
RUN chown -R postgres:postgres /var/lib/pgsql

View File

@ -2,7 +2,12 @@
is_versioned: true
version_template: "{{ version }}"
source_packages:
- postgresql16
- >
{%- if branch in ["c10f2"] -%}
postgresql16
{%- else -%}
postgresql17
{%- endif -%}
annotations:
org.opencontainers.image.revision: ''
org.opencontainers.image.source: 'https://github.com/postgres/postgres'