Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 09971b2

Browse files
authored
Merge pull request GoogleCloudPlatform#219 from donmccasland/add-tools
Adding build scripts
2 parents 272f8d9 + 953a810 commit 09971b2

File tree

3 files changed

+113
-0
lines changed

3 files changed

+113
-0
lines changed

scripts/deploy_check.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
export KOKORO_GITHUB_DIR=${KOKORO_ROOT}/src/github
6+
source ${KOKORO_GFILE_DIR}/kokoro/common.sh
7+
8+
cd ${KOKORO_GITHUB_DIR}/${SAMPLE_APP_DIRECTORY}
9+
if [ -n "${RUNTIME_SPEC}" -a -f app.yaml.in ]; then
10+
sed "s|\${RUNTIME_SPEC}|${RUNTIME_SPEC}|" app.yaml.in > app.yaml
11+
fi
12+
13+
cd ${KOKORO_GFILE_DIR}/appengine/integration_tests
14+
15+
sudo /usr/local/bin/pip install --upgrade -r requirements.txt
16+
17+
if [ -f ${KOKORO_GITHUB_DIR}/${SAMPLE_APP_DIRECTORY}/requirements.txt ]
18+
then
19+
sudo /usr/local/bin/pip install --upgrade -r ${KOKORO_GITHUB_DIR}/${SAMPLE_APP_DIRECTORY}/requirements.txt
20+
fi
21+
22+
export DEPLOY_LATENCY_PROJECT='cloud-deploy-latency'
23+
24+
skip_flag=""
25+
26+
if [ "${SKIP_CUSTOM_LOGGING_TESTS}" = "true" -o "${SKIP_BUILDERS}" = "true" ]; then
27+
skip_flag="$skip_flag --skip-builders"
28+
fi
29+
30+
if [ "${SKIP_XRT}" = "true" ]; then
31+
skip_flag="$skip_flag --skip-xrt"
32+
fi
33+
34+
python deploy_check.py -d ${KOKORO_GITHUB_DIR}/${SAMPLE_APP_DIRECTORY} -l ${LANGUAGE} ${skip_flag}

scripts/integration-test.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
export KOKORO_GITHUB_DIR=${KOKORO_ROOT}/src/github
6+
source ${KOKORO_GFILE_DIR}/kokoro/common.sh
7+
8+
export GOOGLE_CLOUD_PROJECT=gcp-runtimes
9+
10+
sudo /usr/local/bin/pip install --upgrade -r ${KOKORO_GFILE_DIR}/appengine/integration_tests/requirements.txt
11+
12+
if [ -f ${KOKORO_GITHUB_DIR}/${SAMPLE_APP_DIRECTORY}/requirements.txt ]
13+
then
14+
sudo /usr/local/bin/pip install --upgrade -r ${KOKORO_GITHUB_DIR}/${SAMPLE_APP_DIRECTORY}/requirements.txt
15+
fi
16+
17+
export GOPATH=${KOKORO_GITHUB_DIR}/${SAMPLE_APP_DIRECTORY}
18+
19+
flags=""
20+
21+
if [ -n "${STAGING_IMAGE}" ]; then
22+
flags="$flags -i ${STAGING_IMAGE}"
23+
fi
24+
25+
if [ "${SKIP_STANDARD_LOGGING_TESTS}" = "true" ]; then
26+
flags="$flags --skip-standard-logging-tests"
27+
fi
28+
29+
if [ "${SKIP_CUSTOM_LOGGING_TESTS}" = "true" ]; then
30+
flags="$flags --skip-custom-logging-tests"
31+
fi
32+
33+
if [ "${SKIP_MONITORING_TESTS}" = "true" ]; then
34+
flags="$flags --skip-monitoring-tests"
35+
fi
36+
37+
if [ "${SKIP_EXCEPTION_TESTS}" = "true" ]; then
38+
flags="$flags --skip-exception-tests"
39+
fi
40+
41+
if [ "${SKIP_CUSTOM_TESTS}" = "true" ]; then
42+
flags="$flags --skip-custom-tests"
43+
fi
44+
45+
if [ -n "${URL}" ]; then
46+
flags="$flags --url ${URL}"
47+
fi
48+
49+
if [ -n "${BUILDER}" ]; then
50+
flags="$flags --builder ${BUILDER}"
51+
gcloud config set app/use_runtime_builders True
52+
gcloud config set app/runtime_builders_root file://${KOKORO_GITHUB_DIR}/${SAMPLE_APP_DIRECTORY}
53+
fi
54+
55+
if [ -n "${YAML}" ]; then
56+
flags="$flags --yaml ${KOKORO_GITHUB_DIR}/${YAML}"
57+
fi
58+
59+
60+
chmod a+x ${KOKORO_GFILE_DIR}/appengine/integration_tests/testsuite/driver.py
61+
${KOKORO_GFILE_DIR}/appengine/integration_tests/testsuite/driver.py -d ${KOKORO_GITHUB_DIR}/${SAMPLE_APP_DIRECTORY} ${flags}

scripts/release.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
export KOKORO_GITHUB_DIR=${KOKORO_ROOT}/src/github
4+
source ${KOKORO_GFILE_DIR}/kokoro/common.sh
5+
6+
source "${KOKORO_PIPER_DIR}/google3/third_party/runtimes_common/kokoro/common.sh"
7+
8+
cd ${KOKORO_GITHUB_DIR}/python-runtime
9+
10+
if [ -z "${TAG:+set}" ]; then
11+
export TAG=$(date +%Y-%m-%d-%H%M%S)
12+
fi
13+
14+
./build.sh $BUILD_FLAGS
15+
16+
METADATA=$(pwd)/METADATA
17+
cd ${KOKORO_GFILE_DIR}/kokoro
18+
python note.py python -m ${METADATA} -t ${TAG}

0 commit comments

Comments
 (0)