Skip to content

Commit

Permalink
Add helper script and rework dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
  • Loading branch information
saschagrunert committed Sep 25, 2023
1 parent 968437b commit 7b669b3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
10 changes: 7 additions & 3 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ dependencies:
- name: OSC
version: 1.3.1
refPaths:
- path: scripts/obs
match: OSC_VERSION
- path: scripts/reconcile
- path: scripts/helpers
match: OSC_VERSION

- name: Fedora test image
Expand Down Expand Up @@ -46,6 +44,12 @@ dependencies:
- path: .github/workflows/obs.yml
match: '- debian:'

- name: AlmaLinux test container image
version: '9.2'
refPaths:
- path: .github/workflows/obs.yml
match: '- almalinux:'

- name: qemu
version: 7.2.0-1
refPaths:
Expand Down
15 changes: 15 additions & 0 deletions scripts/helpers
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

curl_retry() {
curl -sSfL --retry 5 --retry-delay 3 "$@"
}

install_osc() {
OSC_VERSION=1.3.1
curl_retry https://github.com/openSUSE/osc/archive/refs/tags/$OSC_VERSION.tar.gz -o- | tar xfz -
pushd osc-$OSC_VERSION
sudo ./setup.py build
sudo ./setup.py install
popd
}
9 changes: 0 additions & 9 deletions scripts/obs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ setup_krel() {
krel version
}

install_osc() {
OSC_VERSION=1.3.1
curl_retry https://github.com/openSUSE/osc/archive/refs/tags/$OSC_VERSION.tar.gz -o- | tar xfz -
pushd osc-$OSC_VERSION
sudo ./setup.py build
sudo ./setup.py install
popd
}

obs_stage() {
if [[ "$COMMIT" != "" ]]; then
# Patch the package metadata to download the latest commit
Expand Down
16 changes: 4 additions & 12 deletions scripts/reconcile
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail

OBS_PASSWORD=${OBS_PASSWORD:-}

curl_retry() {
curl -sSfL --retry 5 --retry-delay 3 "$@"
}
source "$(dirname "${BASH_SOURCE[0]}")"/helpers

install_osc() {
OSC_VERSION=1.3.1
curl_retry https://github.com/openSUSE/osc/archive/refs/tags/$OSC_VERSION.tar.gz -o- | tar xfz -
pushd osc-$OSC_VERSION
sudo ./setup.py build
sudo ./setup.py install
popd
OBS_PASSWORD=${OBS_PASSWORD:-}

setup_osc() {
printf "[general]\napiurl = https://api.opensuse.org\n[https://api.opensuse.org]\n" >~/.oscrc
echo user=cri-o-release-bot >>~/.oscrc
echo "pass=$OBS_PASSWORD" >>~/.oscrc
Expand All @@ -26,6 +17,7 @@ submit_workflow() {
}

install_osc
setup_osc

PACKAGES=$(osc se --package cri-o)
PROJECT_PREFIX=isv:kubernetes:addons:cri-o
Expand Down
4 changes: 1 addition & 3 deletions scripts/vars
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env bash
set -euox pipefail

curl_retry() {
curl -sSfL --retry 5 --retry-delay 3 "$@"
}
source "$(dirname "${BASH_SOURCE[0]}")"/helpers

PROJECT_ROOT=isv:kubernetes:addons:cri-o
CRIO_MAIN_BRANCH=main
Expand Down

0 comments on commit 7b669b3

Please sign in to comment.