-
Notifications
You must be signed in to change notification settings - Fork 0
/
service.sh
executable file
·53 lines (47 loc) · 1.46 KB
/
service.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
52
53
#!/bin/bash
BASEDIR="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
run_maven() {
docker run --rm \
-w /build \
-v $BASEDIR:/build \
-v ~/.m2:/root/.m2 \
maven:3-adoptopenjdk-11-openj9 $@
}
run_node() {
docker run -it \
--rm \
-v $BASEDIR:/usr/src/app \
-w /usr/src/app \
node $@
}
case $1 in
npm-install)
run_node npm --prefix theme/ install
;;
compile-sass)
run_node npx sass --watch theme/scss/main.scss:public/css/main.css --style compressed
;;
up-function)
docker-compose up -d function.ees.dev
;;
log-function)
docker logs -f --tail 1000 function.ees.dev
;;
down)
docker-compose down
;;
build)
run_maven mvn clean package -f function/pom.xml -DskipTests --batch-mode
;;
deploy-function)
gcloud functions deploy ees-contact-function --entry-point br.com.ees.function.ContactFormFunction \
--runtime java11 \
--trigger-http \
--memory 512MB \
--source function \
--allow-unauthenticated
;;
*)
echo -e "Invalid option"
;;
esac