add scripts
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Vivian 2022-11-17 10:20:27 +01:00
parent 1304b5b591
commit b5a692be22
3 changed files with 29 additions and 0 deletions

View file

@ -1,4 +1,8 @@
pipeline:
shellcheck:
image: koalaman/shellcheck-alpine
commands:
- shellcheck ./scripts/*.sh
check:
image: rust:1.65
commands:

9
scripts/add_remotes.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -xe
data=$(cargo run -- projects 20197)
repo="$HOME/src/software-systems/student-template-repository"
cd "$repo"
while read -r line; do
# shellcheck disable=SC2086
git remote add ${line}
done <<< "$data"

16
scripts/create_fix_mr.sh Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -xe
repo="$HOME/src/software-systems/student-template-repository"
cd "$repo"
# CONFIG
REMOTES=$(git remote | grep --invert-match origin)
SOURCE_BRANCH=1-concurrency-update
TARGET_BRANCH=1-concurrency
TITLE="Fix example 3"
DESCRIPTION="We made a mistake in Example 3 which can cause issues when trying to implement binary mode. This MR should address those issues"
# END CONFIG
while read -r target_remote; do
git push -o merge_request.create -o merge_request.target="$TARGET_BRANCH" -o merge_request.title="$TITLE" -o merge_request.description="$DESCRIPTION" -o merge_request.remove_source_branch="true" "$target_remote" "$SOURCE_BRANCH"
done <<<"$REMOTES"