29 lines
670 B
Bash
29 lines
670 B
Bash
#!/usr/bin/env bash
|
|
|
|
_fetch_recipe() {
|
|
if [[ ! -d "$ABRA_DIR/recipes/$TEST_RECIPE" ]]; then
|
|
run mkdir -p "$ABRA_DIR/recipes"
|
|
assert_success
|
|
|
|
run git clone "https://git.coopcloud.tech/coop-cloud/$TEST_RECIPE" "$ABRA_DIR/recipes/$TEST_RECIPE"
|
|
assert_success
|
|
fi
|
|
}
|
|
|
|
_reset_recipe(){
|
|
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
|
|
assert_success
|
|
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
|
|
|
_fetch_recipe
|
|
}
|
|
|
|
_ensure_latest_version(){
|
|
latestRelease=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag -l | tail -n 1)
|
|
|
|
if [ ! $latestRelease = "$1" ]; then
|
|
echo "expected latest recipe version of '$1', saw: $latestRelease"
|
|
return 1
|
|
fi
|
|
}
|