forked from oeg-upm/rsfc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_rsfc.sh
More file actions
executable file
·79 lines (68 loc) · 1.4 KB
/
Copy pathrun_rsfc.sh
File metadata and controls
executable file
·79 lines (68 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
set -e
REPO_URL=""
TEST_ID=""
FTR_FLAG=false
TOKEN=""
BRANCH=""
TAG=""
while [[ $# -gt 0 ]]; do
case "$1" in
--repo)
REPO_URL="$2"
shift 2
;;
--id)
TEST_ID="$2"
shift 2
;;
--ftr)
FTR_FLAG=true
shift
;;
-t)
TOKEN="$2"
shift 2
;;
-b)
BRANCH="$2"
shift 2
;;
-v)
TAG="$2"
shift 2
;;
*)
echo "Unknown argument: $1"
echo "Usage: $0 --repo <repo_url> [--ftr] [--id <test_id>] [-t <github_token>] [-b <branch>] [-v <tag>]"
exit 1
;;
esac
done
if [ -z "$REPO_URL" ]; then
echo "Error: --repo is required"
exit 1
fi
OUTPUT_DIR="rsfc_output"
mkdir -p "$OUTPUT_DIR"
DOCKER_ARGS="--repo $REPO_URL"
if [ -n "$BRANCH" ]; then
DOCKER_ARGS="$DOCKER_ARGS -b $BRANCH"
fi
if [ -n "$TAG" ]; then
DOCKER_ARGS="$DOCKER_ARGS -v $TAG"
fi
if [ "$FTR_FLAG" = true ]; then
DOCKER_ARGS="$DOCKER_ARGS --ftr"
fi
if [ -n "$TEST_ID" ]; then
DOCKER_ARGS="$DOCKER_ARGS --id $TEST_ID"
fi
if [ -n "$TOKEN" ]; then
DOCKER_ARGS="$DOCKER_ARGS -t $TOKEN"
fi
docker run --rm \
-v "$(pwd)/$OUTPUT_DIR:/rsfc/rsfc_output" \
-e PYTHONWARNINGS="ignore" \
rsfc-docker \
$DOCKER_ARGS