-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
1,744 additions
and
684 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ credentials.* | |
**/build/ | ||
.php_cs.cache | ||
.vscode/ | ||
export-secrets.sh | ||
iap/composer.lock | ||
.kokoro/secrets.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,32 @@ | ||
FROM gcr.io/google_appengine/php72 | ||
|
||
RUN composer global require phpunit/phpunit:4.8 | ||
RUN apt-get update && apt-get install -y \ | ||
python-ipaddr \ | ||
autoconf \ | ||
build-essential \ | ||
zlib1g-dev \ | ||
jq | ||
|
||
RUN export PATH="$PATH:/opt/composer/vendor/bin" | ||
RUN git clone https://github.com/GoogleCloudPlatform/php-tools.git ${HOME}/php-tools \ | ||
&& ${HOME}/php-tools/scripts/install_test_deps.sh | ||
|
||
# install / enable PHP extensions | ||
RUN pecl install grpc \ | ||
&& echo "extension=grpc.so" >> /opt/php72/lib/conf.d/ext-grpc.ini \ | ||
&& echo "extension=bcmath.so" >> /opt/php72/lib/conf.d/ext-bcmath.ini | ||
|
||
# Install composer globally | ||
RUN composer global require phpunit/phpunit:^5.0 | ||
|
||
# Install Google Cloud SDK | ||
RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz \ | ||
-o ${HOME}/google-cloud-sdk.tar.gz \ | ||
&& tar xzf ${HOME}/google-cloud-sdk.tar.gz -C $HOME \ | ||
&& ${HOME}/google-cloud-sdk/install.sh \ | ||
--usage-reporting false \ | ||
--path-update false \ | ||
--command-completion false | ||
|
||
ENV PATH="$PATH:/opt/composer/vendor/bin:/root/google-cloud-sdk/bin" | ||
|
||
ENTRYPOINT /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#!/bin/bash | ||
|
||
################################################################################ | ||
# Run the following gcloud command to decrypt secrets.sh.enc as follows: # | ||
# # | ||
# gcloud kms decrypt -location=global --keyring=ci --key=ci \ # | ||
# --ciphertext-file=.kokoro/secrets.sh.enc \ # | ||
# --plaintext-file=.kokoro/secrets.sh # | ||
# # | ||
# Then run `source .kokoro/secrets.sh` # | ||
################################################################################ | ||
|
||
# General | ||
export GOOGLE_PROJECT_ID= | ||
export GOOGLE_API_KEY= | ||
export GOOGLE_STORAGE_BUCKET=$GOOGLE_PROJECT_ID | ||
export GOOGLE_CLIENT_ID= | ||
export GOOGLE_CLIENT_SECRET= | ||
export GCLOUD_PROJECT=$GOOGLE_PROJECT_ID | ||
|
||
# AppEngine | ||
export MAILJET_APIKEY= | ||
export MAILJET_SECRET= | ||
export MAILGUN_APIKEY= | ||
export MAILGUN_DOMAIN= | ||
export MAILGUN_RECIPIENT= | ||
export SENDGRID_APIKEY= | ||
export SENDGRID_SENDER= | ||
export TWILIO_ACCOUNT_SID= | ||
export TWILIO_AUTH_TOKEN= | ||
export TWILIO_FROM_NUMBER= | ||
export TWILIO_TO_NUMBER= | ||
|
||
# BigQuery | ||
export GOOGLE_BIGQUERY_DATASET=test_dataset | ||
export GOOGLE_BIGQUERY_TABLE=test_table | ||
|
||
# CloudSQL | ||
export CLOUDSQL_CONNECTION_NAME_MYSQL= | ||
export CLOUDSQL_CONNECTION_NAME_POSTGRES= | ||
export MYSQL_DSN= | ||
export MYSQL_DATABASE= | ||
export MYSQL_USER= | ||
export MYSQL_PASSWORD= | ||
export POSTGRES_DSN= | ||
export POSTGRES_DATABASE= | ||
export POSTGRES_USER= | ||
export POSTGRES_PASSWORD= | ||
|
||
# Datastore | ||
export CLOUD_DATASTORE_NAMESPACE= | ||
export DATASTORE_EVENTUALLY_CONSISTENT_RETRY_COUNT= | ||
|
||
# DLP | ||
export DLP_TOPIC=dlp-tests | ||
export DLP_SUBSCRIPTION=dlp-tests | ||
export DLP_DEID_WRAPPED_KEY= | ||
export DLP_DEID_KEY_NAME=projects/$GOOGLE_PROJECT_ID/locations/global/keyRings/ci/cryptoKeys/ci | ||
|
||
# Firestore | ||
export FIRESTORE_PROJECT_ID= | ||
|
||
# IAP | ||
export IAP_CLIENT_ID= | ||
export IAP_PROJECT_ID= | ||
export IAP_PROJECT_NUMBER= | ||
export IAP_URL= | ||
|
||
# IAM | ||
export GOOGLE_IAM_USER= | ||
|
||
# IOT | ||
export GOOGLE_IOT_DEVICE_CERTIFICATE_B64= | ||
|
||
# KMS | ||
export GOOGLE_KMS_KEYRING= | ||
export GOOGLE_KMS_CRYPTOKEY= | ||
export GOOGLE_KMS_CRYPTOKEY_ALTERNATE= | ||
export GOOGLE_KMS_SERVICEACCOUNTEMAIL= | ||
|
||
# PubSub | ||
export GOOGLE_PUBSUB_SUBSCRIPTION=php-example-subscription | ||
export GOOGLE_PUBSUB_TOPIC=php-example-topic | ||
|
||
# Spanner | ||
export GOOGLE_SPANNER_INSTANCE_ID= | ||
export GOOGLE_SPANNER_DATABASE_ID=test-database | ||
|
||
# Tasks | ||
export CLOUD_TASKS_APPENGINE_QUEUE= | ||
export CLOUD_TASKS_LOCATION= | ||
export CLOUD_TASKS_PULL_QUEUE= |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,45 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2017 Google Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -ex | ||
|
||
echo "hello world" | ||
# Kokoro directory for running these samples | ||
cd github/php-docs-samples | ||
|
||
export GOOGLE_APPLICATION_CREDENTIALS=$KOKORO_GFILE_DIR/service-account.json | ||
|
||
# export the secrets | ||
if [ -f ${GOOGLE_APPLICATION_CREDENTIALS} ]; then | ||
gcloud auth activate-service-account \ | ||
--key-file "${GOOGLE_APPLICATION_CREDENTIALS}" \ | ||
--project $(cat "${GOOGLE_APPLICATION_CREDENTIALS}" | jq -r .project_id) | ||
gcloud kms decrypt \ | ||
--location=global \ | ||
--keyring=ci \ | ||
--key=ci \ | ||
--ciphertext-file=.kokoro/secrets.sh.enc \ | ||
--plaintext-file=.kokoro/secrets.sh | ||
fi | ||
|
||
# Unencrypt and extract secrets | ||
source .kokoro/secrets.sh | ||
|
||
mkdir -p build/logs | ||
|
||
export IS_PULL_REQUEST=$KOKORO_GITHUB_PULL_REQUEST_COMMIT | ||
|
||
# Run tests | ||
bash testing/run_test_suite.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.