|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Copyright 2018 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 | +export GCLOUD_PROJECT=nodejs-docs-samples-tests |
| 18 | +export NODE_ENV=development |
| 19 | + |
| 20 | +cd github/nodejs-docs-samples/ |
| 21 | + |
| 22 | +# Display link to docs |
| 23 | +echo '=================================================================' |
| 24 | +echo -e 'Test failing? See \e[36mgo/drift-test-tracker-onboarding\e[0m for more info!' |
| 25 | +echo '=================================================================' |
| 26 | + |
| 27 | +# Fetch XUnit CI enforcer script |
| 28 | +# curl-ing it ensures we get the latest version |
| 29 | +curl "https://raw.githubusercontent.com/GoogleCloudPlatform/repo-automation-playground/master/xunit-ci-enforcer/region_tag_enforcer.sh" > enforcer.sh |
| 30 | +chmod +x enforcer.sh |
| 31 | + |
| 32 | +# Run enforcer on appropriate directories |
| 33 | +STATUS=0 |
| 34 | + |
| 35 | +# Functions |
| 36 | +DIRS_LIST_FUNCTIONS=$(find functions -type d -name "*est" -not -path "*/node_modules/*" | xargs -I @ dirname @) |
| 37 | +./enforcer.sh $DIRS_LIST_FUNCTIONS || STATUS=$? |
| 38 | + |
| 39 | +# App Engine |
| 40 | +DIRS_LIST_APPENGINE=$(find appengine -type d -name "*est" -not -path "*/node_modules/*" | xargs -I @ dirname @) |
| 41 | +./enforcer.sh $DIRS_LIST_APPENGINE || STATUS=$? |
| 42 | + |
| 43 | +# Fail if any directory-label attempts failed |
| 44 | +exit $STATUS |
0 commit comments