File tree Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Copyright 2023 Google LLC.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ set -eo pipefail
18
+
19
+ file=" $( pwd) "
20
+ APP_REGION=" us-central1"
21
+ export SAMPLE_VERSION=" ${KOKORO_GIT_COMMIT:- latest} "
22
+ # Builds not triggered by a PR will fall back to the commit hash then "latest".
23
+ SUFFIX=${KOKORO_GITHUB_PULL_REQUEST_NUMBER:- ${SAMPLE_VERSION: 0: 12} } -$( date +%s%N)
24
+ export SERVICE_NAME=" ${SAMPLE_NAME} -${SUFFIX} "
25
+
26
+ set -x
27
+
28
+ if [[ " $file " == * " hello" * ]]; then
29
+ echo " Deploying App Engine Flex project: ${file} "
30
+ mvn clean package appengine:deploy \
31
+ --Dservice-account=$SERVICE_NAME \
32
+ --region $APP_REGION
33
+
34
+ fi
35
+ set +x
36
+
37
+ echo
38
+ echo ' ---'
39
+ echo
40
+
41
+ # Do not use exec to preserve trap behavior.
42
+ " $@ "
43
+
Original file line number Diff line number Diff line change @@ -60,6 +60,23 @@ if [[ "$file" == *"functions/helloworld/"* ]]; then
60
60
fi
61
61
fi
62
62
63
+ # Build and deploy Appengine flex samples
64
+ if [[ " $file " == * " flexible/java-11/" * ]]; then
65
+ source " $SCRIPT_DIR " /build_appengine_flex.sh
66
+ EXIT=$?
67
+
68
+ if [[ $EXIT -ne 0 ]]; then
69
+ RTN=1
70
+ echo -e " \n Appengine Flex build/deploy failed: gcloud returned a non-zero exit code. \n"
71
+ else
72
+ echo -e " \n Appengine Flex build/deploy completed.\n"
73
+
74
+ # Wait for functions to warm up (and start detecting events)
75
+ sleep 1m
76
+ fi
77
+ fi
78
+
79
+
63
80
# Use maven to execute the tests for the project.
64
81
mvn --quiet --batch-mode --fail-at-end clean verify \
65
82
-Dfile.encoding=" UTF-8" \
You can’t perform that action at this time.
0 commit comments