-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstart.sh
executable file
·51 lines (37 loc) · 991 Bytes
/
start.sh
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
#!/bin/bash
set -euo pipefail
function cleanup {
kill "$GRPC_ACCOUNTS_PID"
kill "$GRPC_PRODUCTS_PID"
kill "$GRPC_REVIEWS_PID"
kill "$GRAPHQL_ACCOUNTS_PID"
kill "$GRAPHQL_PRODUCTS_PID"
kill "$GRAPHQL_REVIEWS_PID"
}
trap cleanup EXIT
cd "$(dirname "$0")"
cargo build --bins
../../target/debug/grpc-accounts &
GRPC_ACCOUNTS_PID=$!
../../target/debug/grpc-products &
GRPC_PRODUCTS_PID=$!
../../target/debug/grpc-reviews &
GRPC_REVIEWS_PID=$!
sleep 2
../../target/debug/graphql-accounts &
GRAPHQL_ACCOUNTS_PID=$!
../../target/debug/graphql-products &
GRAPHQL_PRODUCTS_PID=$!
../../target/debug/graphql-reviews &
GRAPHQL_REVIEWS_PID=$!
sleep 4
echo "GRPC_ACCOUNTS_PID=$GRPC_ACCOUNTS_PID"
echo "GRPC_PRODUCTS_PID=$GRPC_PRODUCTS_PID"
echo "GRPC_REVIEWS_PID=$GRPC_REVIEWS_PID"
echo "GRAPHQL_ACCOUNTS_PID=$GRAPHQL_ACCOUNTS_PID"
echo "GRAPHQL_PRODUCTS_PID=$GRAPHQL_PRODUCTS_PID"
echo "GRAPHQL_REVIEWS_PID=$GRAPHQL_REVIEWS_PID"
(
cd gateway
node index.js
)