File tree Expand file tree Collapse file tree 8 files changed +14
-59
lines changed
packages/google-cloud-logging Expand file tree Collapse file tree 8 files changed +14
-59
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ echo $ENVCTL_ID
7272
7373# Run the specified environment test
7474set +e
75+
7576python3.6 -m nox --session " tests(language='python', platform='$ENVIRONMENT ')"
7677TEST_STATUS_CODE=$?
7778
Original file line number Diff line number Diff line change @@ -23,10 +23,15 @@ WORKDIR /usr/src/app
2323COPY package*.json ./
2424COPY app.js ./
2525COPY tests.js ./
26- # Assumption: local file is already built
26+
27+ # Compile library
2728COPY _library ./nodejs-logging
29+ WORKDIR nodejs-logging
30+ RUN npm install
31+ RUN npm run compile
2832
29- # Install test app's dependencies.
33+ # Install other dependencies
34+ WORKDIR /usr/src/app
3035RUN npm install --production
3136
3237# Environment variable denoting whether to run an app server
Original file line number Diff line number Diff line change 11flask == 1.1.2
22google-cloud-pubsub == 2.3.0
33click == 7.1.2
4+ pytz == 2021.1
Original file line number Diff line number Diff line change @@ -68,26 +68,8 @@ verify() {
6868 set -e
6969}
7070
71- build_node_container () {
72- export GCR_PATH=gcr.io/$PROJECT_ID /logging:$SERVICE_NAME
73- # copy super-repo into deployable dir
74- _env_tests_relative_path=${REPO_ROOT# " $SUPERREPO_ROOT /" }
75- _deployable_dir=$REPO_ROOT /deployable/$LANGUAGE
76-
77- # copy over local copy of library
78- pushd $SUPERREPO_ROOT
79- tar -cvf $_deployable_dir /lib.tar --exclude node_modules --exclude env-tests-logging --exclude test --exclude system-test --exclude .nox --exclude samples --exclude docs .
80- popd
81- mkdir -p $_deployable_dir /$LIBRARY_NAME
82- tar -xvf $_deployable_dir /lib.tar --directory $_deployable_dir /$LIBRARY_NAME
83-
84- # build container
85- docker build -t $GCR_PATH $_deployable_dir
86- docker push $GCR_PATH
87- }
88-
8971deploy () {
90- build_node_container
72+ build_container
9173 gcloud config set run/platform managed
9274 gcloud config set run/region us-west1
9375 gcloud run deploy \
Original file line number Diff line number Diff line change @@ -47,26 +47,8 @@ verify() {
4747 set -e
4848}
4949
50-
51- build_node_container () {
52- export GCR_PATH=gcr.io/$PROJECT_ID /logging:$SERVICE_NAME
53- # copy super-repo into deployable dir
54- _env_tests_relative_path=${REPO_ROOT# " $SUPERREPO_ROOT /" }
55- _deployable_dir=$REPO_ROOT /deployable/$LANGUAGE
56-
57- # copy over local copy of library
58- pushd $SUPERREPO_ROOT
59- tar -cvf $_deployable_dir /lib.tar --exclude node_modules --exclude env-tests-logging --exclude test --exclude system-test --exclude .nox --exclude samples --exclude docs .
60- popd
61- mkdir -p $_deployable_dir /$LIBRARY_NAME
62- tar -xvf $_deployable_dir /lib.tar --directory $_deployable_dir /$LIBRARY_NAME
63- # build container
64- docker build -t $GCR_PATH $_deployable_dir
65- docker push $GCR_PATH
66- }
67-
6850deploy () {
69- build_node_container
51+ build_container
7052 gcloud config set compute/zone $ZONE
7153 gcloud compute instances create-with-container \
7254 $SERVICE_NAME \
Original file line number Diff line number Diff line change @@ -65,26 +65,9 @@ attach_or_create_gke_cluster(){
6565 set -e
6666}
6767
68- build_node_container (){
69- export GCR_PATH=gcr.io/$PROJECT_ID /logging:$SERVICE_NAME
70- # copy super-repo into deployable dir
71- _env_tests_relative_path=${REPO_ROOT# " $SUPERREPO_ROOT /" }
72- _deployable_dir=$REPO_ROOT /deployable/$LANGUAGE
73-
74- # copy over local copy of library
75- pushd $SUPERREPO_ROOT
76- tar -cvf $_deployable_dir /lib.tar --exclude node_modules --exclude env-tests-logging --exclude test --exclude system-test --exclude .nox --exclude samples --exclude docs .
77- popd
78- mkdir -p $_deployable_dir /$LIBRARY_NAME
79- tar -xvf $_deployable_dir /lib.tar --directory $_deployable_dir /$LIBRARY_NAME
80- # build container
81- docker build -t $GCR_PATH $_deployable_dir
82- docker push $GCR_PATH
83- }
84-
8568deploy () {
8669 attach_or_create_gke_cluster
87- build_node_container
70+ build_container
8871 cat << EOF > $TMP_DIR /gke.yaml
8972 apiVersion: apps/v1
9073 kind: Deployment
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ build_container() {
4646 tar -cvf $_deployable_dir /lib.tar \
4747 --exclude tests --exclude .nox --exclude samples --exclude docs --exclude __pycache__ \
4848 --exclude target --exclude env-tests-logging --exclude test --exclude .git --exclude .github \
49+ --exclude node_modules --exclude system-test \
4950 --exclude system-test --exclude environment-tests --exclude .kokoro .
5051 popd
5152 mkdir -p $_deployable_dir /_library
Original file line number Diff line number Diff line change 1- Subproject commit 3b5b391d6afc746c59cdd3100ccc5e8d60793489
1+ Subproject commit f30dafa8b62bf197e39edd5aca57ce1cc62e9540
You can’t perform that action at this time.
0 commit comments