off deploy all, update active

This commit is contained in:
Sergey Zhemoytel 2025-01-27 18:16:49 +03:00
parent 7773642cff
commit b452d56319

View file

@ -55,9 +55,10 @@ runs:
# sudo urpmi.addmedia --distrib --mirrorlist https://tvoygit.ru/Djam/r11_mirrorlist/raw/branch/main/rosa2016.1.x86_64.list
# - name: Update repo and pre-install
# run: |
# sudo urpmi.update -fa
- name: Update repo and pre-install
run: |
sudo urpmi.addmedia personalold http://135.181.14.149:8090/rosa2016.1/x86_64/main/release
sudo urpmi.update -fa
# sudo urpmi --auto \
# https://packages.buildkite.com/r11-team/r11-x86-64/files/branding-configs-r11-3.0-3-mdv.x86_64.rpm \
# https://packages.buildkite.com/r11-team/r11-x86-64/files/branding-configs-common-3.0-3-mdv.x86_64.rpm
@ -257,7 +258,7 @@ runs:
fi
}
install_dependencies
# install_dependencies
sudo urpmi --buildrequires --auto ${SPECFILE}
- name: Build rpm
@ -265,86 +266,86 @@ runs:
source .env
rpmbuild -ba ${SPECFILE}
- name: Deploy in repos packages
if: github.ref == 'refs/heads/rosa2016.1'
env:
RPMBUILDROOT: /home/builder/rpmbuild
run: |
send_package() {
local file=$1
local arch=$2
local type=$3
# - name: Deploy in repos packages
# if: github.ref == 'refs/heads/rosa2016.1'
# env:
# RPMBUILDROOT: /home/builder/rpmbuild
# run: |
# send_package() {
# local file=$1
# local arch=$2
# local type=$3
if [ "$arch" = "noarch" ]; then
url="${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/r11_rpms/noarch/${file}"
else
url="${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/r11_rpms/${arch}/${file}"
fi
# if [ "$arch" = "noarch" ]; then
# url="${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/r11_rpms/noarch/${file}"
# else
# url="${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/r11_rpms/${arch}/${file}"
# fi
if [ "$type" = "srpm" ]; then
url="${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/r11_rpms/srpms/${file}"
fi
# if [ "$type" = "srpm" ]; then
# url="${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/r11_rpms/srpms/${file}"
# fi
curl --user ${{ github.repository_owner }}:${{ inputs.CI_DEPLOY }} \
--upload-file "$file" \
"$url"
curl --user ${{ github.repository_owner }}:${{ inputs.CI_DEPLOY }} \
--upload-file "$file" \
"${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/${{ github.event.repository.name }}/rpm/${file}"
}
# curl --user ${{ github.repository_owner }}:${{ inputs.CI_DEPLOY }} \
# --upload-file "$file" \
# "$url"
# curl --user ${{ github.repository_owner }}:${{ inputs.CI_DEPLOY }} \
# --upload-file "$file" \
# "${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/${{ github.event.repository.name }}/rpm/${file}"
# }
for dir in SRPMS RPMS/*; do
if [ -d "${RPMBUILDROOT}/${dir}" ]; then
for file in "${RPMBUILDROOT}/${dir}"/*.rpm; do
if [ -f "$file" ]; then
if [ "$dir" = "SRPMS" ]; then
arch="srpms"
type="srpm"
elif [ "$dir" = "noarch" ]; then
arch="noarch"
type="rpm"
else
arch=$(basename "${dir}")
type="rpm"
fi
echo "********************************************************"
echo "file: " "$file"
echo "arch: " "$arch"
echo "type: " "$type"
echo "********************************************************"
send_package "$file" "$arch" "$type"
fi
done
fi
done
# for dir in SRPMS RPMS/*; do
# if [ -d "${RPMBUILDROOT}/${dir}" ]; then
# for file in "${RPMBUILDROOT}/${dir}"/*.rpm; do
# if [ -f "$file" ]; then
# if [ "$dir" = "SRPMS" ]; then
# arch="srpms"
# type="srpm"
# elif [ "$dir" = "noarch" ]; then
# arch="noarch"
# type="rpm"
# else
# arch=$(basename "${dir}")
# type="rpm"
# fi
# echo "********************************************************"
# echo "file: " "$file"
# echo "arch: " "$arch"
# echo "type: " "$type"
# echo "********************************************************"
# send_package "$file" "$arch" "$type"
# fi
# done
# fi
# done
- name: Deploy in buildkite
if: github.ref == 'refs/heads/rosa2016.1'
run: |
echo "Deploying src artifacts..."
for file in /home/builder/rpmbuild/SRPMS/*.rpm; do
curl -X POST https://api.buildkite.com/v2/packages/organizations/r11-team/registries/r11-srpms/packages \
-H "Authorization: Bearer ${{ inputs.PUBLICATOR }}" \
-F "file=@$file"
done
declare -A arch_urls=(
["x86_64"]="https://api.buildkite.com/v2/packages/organizations/r11-team/registries/r11-x86-64/packages"
["noarch"]="https://api.buildkite.com/v2/packages/organizations/r11-team/registries/r11-noarch/packages"
)
for arch in "${!arch_urls[@]}"; do
echo "Deploying rpm artifacts for $arch..."
for file in /home/builder/rpmbuild/RPMS/$arch/*.rpm; do
if [ -f "$file" ]; then
curl -X POST "${arch_urls[$arch]}" \
-H "Authorization: Bearer ${{ inputs.PUBLICATOR }}" \
-F "file=@$file"
fi
done
done
# - name: Deploy in buildkite
# if: github.ref == 'refs/heads/rosa2016.1'
# run: |
# echo "Deploying src artifacts..."
# for file in /home/builder/rpmbuild/SRPMS/*.rpm; do
# curl -X POST https://api.buildkite.com/v2/packages/organizations/r11-team/registries/r11-srpms/packages \
# -H "Authorization: Bearer ${{ inputs.PUBLICATOR }}" \
# -F "file=@$file"
# done
#
# declare -A arch_urls=(
# ["x86_64"]="https://api.buildkite.com/v2/packages/organizations/r11-team/registries/r11-x86-64/packages"
# ["noarch"]="https://api.buildkite.com/v2/packages/organizations/r11-team/registries/r11-noarch/packages"
# )
#
# for arch in "${!arch_urls[@]}"; do
# echo "Deploying rpm artifacts for $arch..."
# for file in /home/builder/rpmbuild/RPMS/$arch/*.rpm; do
# if [ -f "$file" ]; then
# curl -X POST "${arch_urls[$arch]}" \
# -H "Authorization: Bearer ${{ inputs.PUBLICATOR }}" \
# -F "file=@$file"
# fi
# done
# done
container:
image: packages.buildkite.com/r11-team/r11/builder:latest
image: docker.io/zhemoitel/r11:builder-20250125