-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathtools.sh
More file actions
executable file
·69 lines (54 loc) · 1.38 KB
/
Copy pathtools.sh
File metadata and controls
executable file
·69 lines (54 loc) · 1.38 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
#!/bin/bash
echo "UrnaDB Tools Shell Script."
echo ""
echo "1: testing cmd package."
echo "2: testing conf package."
echo "3: testing vfs package."
echo "4: testing utils package."
echo "5: testing codecov coverage."
echo "6: builder container images."
echo ""
case_num=$1
if [ -z "$case_num" ]; then
echo "Please provide an option (1, 2, 3, 4, 5, 6)."
exit 1
fi
sudo rm -rf /tmp/urnadb
sudo mkdir -p /tmp/urnadb
sudo chmod -R 777 /tmp/urnadb
function test_cmd_package() {
sudo cd cmd && go test -v
}
function test_all_packages() {
sudo mkdir -p /tmp/urnadb
sudo chmod -R 777 /tmp/urnadb
sudo go test -vet=all -race -coverprofile=coverage.out -covermode=atomic -v ./...
}
function test_utils_packages() {
sudo cd utils && go test -v
}
function test_conf_packages(){
cd conf && go test -v
}
function test_vfs_packages() {
sudo cd vfs && go test -v
}
function build_container_images() {
docker build -t urnadb:latest .
}
if [ "$case_num" -eq 1 ]; then
test_cmd_package
elif [ "$case_num" -eq 2 ]; then
test_conf_packages
elif [ "$case_num" -eq 3 ]; then
test_vfs_packages
elif [ "$case_num" -eq 4 ]; then
test_utils_packages
elif [ "$case_num" -eq 5 ]; then
test_all_packages
elif [ "$case_num" -eq 6 ]; then
build_container_images
else
echo "Invalid option!"
echo "Please provide a valid option (1, 2, 3, 4, 5, 6)."
fi