Something went wrong. Try again.
Shuttle runs GitLab CI pipelines for Tangled repositories on an ordinary GitLab runner, and publishes the job logs to the repository owner's tangled.org/dracoblue.de/shuttle
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435#!/usr/bin/env bashset -euo pipefailcd "$(dirname "$0")/.."export PATH="$HOME/.local/go/bin:$PATH"features=(basic stages needs retry services cache hooks docker-options variables-expand artifacts tags reports)if (($#)); then features=("$@"); fiwork_dir=$(mktemp -d)volumes_before="$work_dir/volumes.before"docker volume ls -q | sort >"$volumes_before"cleanup(){ status=$? docker ps -aq --filter label=shuttle.spike=runlocal | xargs -r docker rm -f >/dev/null 2>&1 || true docker volume ls -q | sort >"$work_dir/volumes.after" || true comm -13 "$volumes_before" "$work_dir/volumes.after" >"$work_dir/volumes.new" || true while IFS= read -r volume; do [[ -n "$volume" ]] || continue if [[ "$(docker volume inspect -f '{{ index .Labels "com.gitlab.gitlab-runner.type" }}' "$volume" 2>/dev/null || true)" == cache ]]; then docker volume rm "$volume" >/dev/null || true; fi done <"$work_dir/volumes.new" find "$work_dir" -depth -delete exit "$status"}trap cleanup EXIT INT TERMgo build -o "$work_dir/shuttle" ./cmd/shuttlefor feature in "${features[@]}"; do repo="$work_dir/repo-$feature"; out="$work_dir/out-$feature" git init -q -b main "$repo"; git -C "$repo" config user.name 'Shuttle Run Local'; git -C "$repo" config user.email shuttle@example.invalid cp "e2e/$feature/.gitlab-ci.yml" "$repo/.gitlab-ci.yml" [[ ! -d "e2e/$feature/files-1" ]] || cp -R "e2e/$feature/files-1/." "$repo/" git -C "$repo" add -A; git -C "$repo" commit -q -m "$feature" set +e; "$work_dir/shuttle" run-local --runner docker --out "$out" "$repo"; command_status=$?; set -e if [[ $command_status -gt 1 ]]; then echo "infrastructure failure: $feature" >&2; exit "$command_status"; fi SHUTTLE_RUN_LOCAL_OUT="$out" SHUTTLE_RUN_LOCAL_EXPECT="$PWD/e2e/$feature/expect.yml" go test -count=1 -tags runlocal -run TestRunLocalExpect ./cmd/shuttle echo "PASS $feature"done