Skip to content

Commit

Permalink
Update scripts (tmp)
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteOtter committed May 29, 2024
1 parent 1c3a1e2 commit f1ab36f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 7 additions & 6 deletions script/openqa-clone-custom-git-refspec
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,6 @@ Please try 'curl $json_url' or select another job, e.g. in the same scenario: $h
scriptdir=$(dirname "${BASH_SOURCE[0]}")
local cmd="$dry_run $scriptdir/openqa-clone-job $clone_args \"$host\" \"$job\" _GROUP=\"$GROUP\" TEST+=\"$test_suffix\" BUILD=\"$build\" CASEDIR=\"$casedir\" PRODUCTDIR=\"$productdir\" NEEDLES_DIR=\"$needles_dir\""
# FIXME: This does not work yet. Maybe I am checking the wrong list of arguments
if [[ $cmd =~ "SCHEDULE" ]] && [[ $cmd =~ "YAML_SCHEDULE" ]]; then
fail "Error: 'SCHEDULE' and 'YAML_SCHEDULE' are set in '--clone-job-args'. Cannot continue as they are mutually exclusive!"
fi
if [[ -n "$modules" ]] && [[ $cmd =~ (SCHEDULE|YAML_SCHEDULE) ]]; then
fail "Error: '--modules' flag cannot exist when passing 'SCHEDULE' or 'YAML_SCHEDULE' with '--clone-job-args'!"
fi
[[ ${#args[@]} -ne 0 ]] && cmd=$cmd"$(printf " '%s'" "${args[@]}")"
if [[ -n "$MARKDOWN" ]]; then
eval "$cmd" | sed 's/^Created job.*: \([^ ]*\) -> \(.*\)$/* [\1](\2)/'
Expand All @@ -203,6 +197,13 @@ if [[ -z "$host" ]] && [[ -z "$job_list" ]]; then
exit 1
fi
args=("${@:3}")
if [[ $(echo "${args[*]}" | grep -q "SCHEDULE") ]] && [[ $(echo "${args[*]}" | grep -q "YAML_SCHEDULE") ]]; then
fail "Error: 'SCHEDULE' and 'YAML_SCHEDULE' are set in '--clone-job-args'. Cannot continue as they are mutually exclusive!"
fi
if [[ -n "$modules" ]] && ([[ $(echo "${args[*]}" | grep -q "SCHEDULE") ]] || [[ $(echo "${args[*]}" | grep -q "YAML_SCHEDULE") ]]); then
fail "Error: '--modules' flag cannot exist when passing 'SCHEDULE' or 'YAML_SCHEDULE' with '--clone-job-args'!"
fi

IFS=','
for i in $job_list; do
clone_job "$i"
Expand Down
2 changes: 2 additions & 0 deletions script/openqa-verify-pr
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ if [ $# -ne 5 ]; then
fi

# Read GH token from config file.
# TODO: Wrap into function. Call it in clone-custom-refspec when $TOKEN not set.
if [[ -f $config_file ]]; then
config=$(grep "^GH_ACCESS_TOKEN=" "$config_file" | cut -d'"' -f2)
custom_target=$(grep "^CUSTOM_TARGET=" "$config_file" | cut -d'"' -f2)
Expand All @@ -99,6 +100,7 @@ if [ $source = 'opensuse' ]; then
openqa-clone-custom-git-refspec "https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/$pr_id" \
"https://openqa.opensuse.org/tests/$test_id" \
SCHEDULE="tests/installation/bootloader_start,tests/boot/boot_to_desktop,$modules" \
YAML_SCHEDULE="" \
TEST="$test_name"
elif [ $source = 'suse' ]; then
echo "Dispatching verification run for suse..."
Expand Down

0 comments on commit f1ab36f

Please sign in to comment.