forked from anvil-verifier/anvil
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal-test.sh
More file actions
executable file
·66 lines (59 loc) · 2.29 KB
/
Copy pathlocal-test.sh
File metadata and controls
executable file
·66 lines (59 loc) · 2.29 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
#!/usr/bin/env bash
## Test the controller locally in a kind cluster.
##
## Requires kind to be installed and the prerequisites of deploy.sh.
## Usage: ./local-test.sh <controller_name> [--no-build]
set -xeu
app=$(echo "$1" | tr '_' '-')
app_filename=$(echo "$app" | tr '-' '_')
build_controller="no"
dockerfile_path="docker/controller/Dockerfile.local"
if [ $# -gt 1 ]; then
if [ "$2" == "--build" ]; then # chain build.sh
if [ ! -f "${VERUS_DIR}/source/target-verus/release/verus" ]; then
echo "Verus not found. Please set VERUS_DIR correct"
exit 1
fi
build_controller="local"
elif [ "$2" == "--build-remote" ]; then
build_controller="remote"
fi
fi
case "$build_controller" in
local)
echo "Building $app controller binary"
shift 2
./build.sh "${app_filename}_controller.rs" "--no-verify" $@
echo "Building $app controller image"
docker build -f $dockerfile_path -t local/$app-controller:v0.1.0 --build-arg APP=$app_filename .
;;
remote)
echo "Building $app controller image using builder"
dockerfile_path="docker/controller/Dockerfile.remote"
docker build -f $dockerfile_path -t local/$app-controller:v0.1.0 --build-arg APP=$app_filename .
;;
no)
echo "Use existing $app controller image"
;;
esac
# for VDeployment, need to deploy VReplicaSet as a dependency
if [ "$app" == "vdeployment" ]; then
case "$build_controller" in
local)
echo "Building vreplicaset controller binary"
./build.sh "vreplicaset_controller.rs" "--no-verify" $@
echo "Building vreplicaset controller image"
docker build -f $dockerfile_path -t local/vreplicaset-controller:v0.1.0 --build-arg APP=vreplicaset .
;;
remote)
echo "Building vreplicaset controller image using builder"
dockerfile_path="docker/controller/Dockerfile.remote"
docker build -f $dockerfile_path -t local/vreplicaset-controller:v0.1.0 --build-arg APP=vreplicaset .
;;
no)
echo "Use existing vreplicaset controller image"
;;
esac
fi
# Setup cluster, deploy the controller as a pod to the kind cluster, using the image just loaded
./deploy.sh $app local