diff --git a/.kokoro/functions-helloworld.sh b/.kokoro/functions-helloworld.sh index aac336cc7d..cdcb586382 100755 --- a/.kokoro/functions-helloworld.sh +++ b/.kokoro/functions-helloworld.sh @@ -34,15 +34,15 @@ gcloud config set project $GCLOUD_PROJECT function cleanup { CODE=$? - gcloud beta functions delete helloHttp -q - gcloud beta functions delete helloGET -q - gcloud beta functions delete helloBackground -q - gcloud beta functions delete helloPubSub -q - gcloud beta functions delete helloGCS -q - gcloud beta functions delete helloError -q - gcloud beta functions delete helloError2 -q - gcloud beta functions delete helloError3 -q - gcloud beta functions delete helloTemplate -q + gcloud functions delete helloHttp -q + gcloud functions delete helloGET -q + gcloud functions delete helloBackground -q + gcloud functions delete helloPubSub -q + gcloud functions delete helloGCS -q + gcloud functions delete helloError -q + gcloud functions delete helloError2 -q + gcloud functions delete helloError3 -q + gcloud functions delete helloTemplate -q } trap cleanup EXIT diff --git a/circle.yml b/circle.yml index 93790d7600..c2778d3afb 100644 --- a/circle.yml +++ b/circle.yml @@ -18,7 +18,7 @@ machine: node: - version: 6.14.1 + version: 8.11.1 # Use for broader build-related configuration general: @@ -31,7 +31,7 @@ dependencies: override: - echo $KEYFILE > /home/ubuntu/nodejs-docs-samples/key.json - gcloud auth activate-service-account --key-file /home/ubuntu/nodejs-docs-samples/key.json || true - - yarn global add ava nyc codecov semistandard @google-cloud/nodejs-repo-tools@1.4.17 @google-cloud/functions-emulator@1.0.0-alpha.29 + - yarn global add ava nyc codecov semistandard @google-cloud/nodejs-repo-tools@1.4.17 @google-cloud/functions-emulator@1.0.0-beta.4 - yarn install - yarn run lint - samples test install -l=functions/background diff --git a/functions/datastore/README.md b/functions/datastore/README.md index d8610ef442..530a9881fe 100644 --- a/functions/datastore/README.md +++ b/functions/datastore/README.md @@ -25,19 +25,19 @@ Functions for your project. 1. Deploy the "get" function with an HTTP trigger: - gcloud beta functions deploy get --trigger-http + gcloud functions deploy get --trigger-http 1. Deploy the "set" function with an HTTP trigger: - gcloud beta functions deploy set --trigger-http + gcloud functions deploy set --trigger-http 1. Deploy the "del" function with an HTTP trigger: - gcloud beta functions deploy del --trigger-http + gcloud functions deploy del --trigger-http 1. Call the "set" function to create a new entity: - gcloud beta functions call set --data '{"kind":"Task","key":"sampletask1","value":{"description":"Buy milk"}}' + gcloud functions call set --data '{"kind":"Task","key":"sampletask1","value":{"description":"Buy milk"}}' or @@ -48,7 +48,7 @@ Functions for your project. 1. Call the "get" function to read the newly created entity: - gcloud beta functions call get --data '{"kind":"Task","key":"sampletask1"}' + gcloud functions call get --data '{"kind":"Task","key":"sampletask1"}' or @@ -70,7 +70,7 @@ Functions for your project. 1. Call the "get" function again to verify it was deleted: - gcloud beta functions call get --data '{"kind":"Task","key":"sampletask1"}' + gcloud functions call get --data '{"kind":"Task","key":"sampletask1"}' or diff --git a/functions/datastore/index.js b/functions/datastore/index.js index 0fa60c988b..33561ae080 100644 --- a/functions/datastore/index.js +++ b/functions/datastore/index.js @@ -44,7 +44,7 @@ function getKeyFromRequestData (requestData) { * Creates and/or updates a record. * * @example - * gcloud beta functions call set --data '{"kind":"Task","key":"sampletask1","value":{"description": "Buy milk"}}' + * gcloud functions call set --data '{"kind":"Task","key":"sampletask1","value":{"description": "Buy milk"}}' * * @param {object} req Cloud Function request context. * @param {object} req.body The request body. @@ -78,7 +78,7 @@ exports.set = (req, res) => { * Retrieves a record. * * @example - * gcloud beta functions call get --data '{"kind":"Task","key":"sampletask1"}' + * gcloud functions call get --data '{"kind":"Task","key":"sampletask1"}' * * @param {object} req Cloud Function request context. * @param {object} req.body The request body. @@ -110,7 +110,7 @@ exports.get = (req, res) => { * Deletes a record. * * @example - * gcloud beta functions call del --data '{"kind":"Task","key":"sampletask1"}' + * gcloud functions call del --data '{"kind":"Task","key":"sampletask1"}' * * @param {object} req Cloud Function request context. * @param {object} req.body The request body. diff --git a/functions/datastore/package.json b/functions/datastore/package.json index 7075383260..e57fa1c0b3 100644 --- a/functions/datastore/package.json +++ b/functions/datastore/package.json @@ -14,7 +14,7 @@ "scripts": { "lint": "repo-tools lint", "pretest": "npm run lint", - "e2e-test": "export FUNCTIONS_CMD='gcloud beta functions' && sh test/updateFunctions.sh && BASE_URL=\"https://$GCF_REGION-$GCLOUD_PROJECT.cloudfunctions.net/\" ava -T 20s --verbose test/*.test.js", + "e2e-test": "export FUNCTIONS_CMD='gcloud functions' && sh test/updateFunctions.sh && BASE_URL=\"https://$GCF_REGION-$GCLOUD_PROJECT.cloudfunctions.net/\" ava -T 20s --verbose test/*.test.js", "system-test": "export FUNCTIONS_CMD='functions' && sh test/updateFunctions.sh && BASE_URL=\"http://localhost:8010/$GCLOUD_PROJECT/$GCF_REGION\" ava -T 20s --verbose test/*.test.js", "test": "npm run system-test" }, @@ -23,7 +23,7 @@ "supertest": "^3.0.0" }, "devDependencies": { - "@google-cloud/functions-emulator": "^1.0.0-alpha.29", + "@google-cloud/functions-emulator": "^1.0.0-beta.4", "@google-cloud/nodejs-repo-tools": "2.2.1", "ava": "0.25.0", "proxyquire": "2.0.0", diff --git a/functions/gcs/README.md b/functions/gcs/README.md index b5ea918b5b..37459dd57b 100644 --- a/functions/gcs/README.md +++ b/functions/gcs/README.md @@ -32,11 +32,11 @@ Functions for your project. 1. Deploy the "wordCount" function with an HTTP trigger: - gcloud beta functions deploy wordCount --trigger-http + gcloud functions deploy wordCount --trigger-http 1. Call the "wordCount" function using the sample file: - gcloud beta functions call wordCount --data '{"bucket":"YOUR_BUCKET_NAME","file":"sample.txt"}' + gcloud functions call wordCount --data '{"bucket":"YOUR_BUCKET_NAME","file":"sample.txt"}' * Replace `YOUR_BUCKET_NAME` with the name of your Cloud Storage Bucket. diff --git a/functions/helloworld/package.json b/functions/helloworld/package.json index c89645c69c..f63bb9ebc1 100644 --- a/functions/helloworld/package.json +++ b/functions/helloworld/package.json @@ -14,7 +14,7 @@ "scripts": { "lint": "repo-tools lint", "pretest": "npm run lint", - "e2e-test": "export FUNCTIONS_CMD='gcloud beta functions' && sh test/updateFunctions.sh && BASE_URL=\"https://$GCF_REGION-$GCLOUD_PROJECT.cloudfunctions.net/\" ava -T 20s --verbose test/*.test.js", + "e2e-test": "export FUNCTIONS_CMD='gcloud functions' && sh test/updateFunctions.sh && BASE_URL=\"https://$GCF_REGION-$GCLOUD_PROJECT.cloudfunctions.net/\" ava -T 20s --verbose test/*.test.js", "test": "export FUNCTIONS_CMD='functions-emulator' && sh test/updateFunctions.sh && export BASE_URL=\"http://localhost:8010/$GCLOUD_PROJECT/$GCF_REGION\" && ava -T 20s --verbose -c 1 test/index.test.js test/*unit*test.js test/*integration*test.js", "system-test": "export FUNCTIONS_CMD='functions-emulator' && sh test/updateFunctions.sh && export BASE_URL=\"http://localhost:8010/$GCLOUD_PROJECT/$GCF_REGION\" && ava -T 20s --verbose test/*.test.js" }, diff --git a/functions/helloworld/test/sample.system.pubsub.test.js b/functions/helloworld/test/sample.system.pubsub.test.js index 0fa7b25370..6a5430710a 100644 --- a/functions/helloworld/test/sample.system.pubsub.test.js +++ b/functions/helloworld/test/sample.system.pubsub.test.js @@ -21,7 +21,7 @@ const Pubsub = require(`@google-cloud/pubsub`); const pubsub = Pubsub(); const topicName = process.env.FUNCTIONS_TOPIC; -const baseCmd = `gcloud beta functions`; +const baseCmd = `gcloud functions`; test(`helloPubSub: should print a name`, async (t) => { t.plan(1); diff --git a/functions/helloworld/test/sample.system.storage.test.js b/functions/helloworld/test/sample.system.storage.test.js index 7db34a170b..7e6518bf9b 100644 --- a/functions/helloworld/test/sample.system.storage.test.js +++ b/functions/helloworld/test/sample.system.storage.test.js @@ -27,7 +27,7 @@ const gcsFileName = `test-${uuid.v4()}.txt`; const bucketName = process.env.BUCKET_NAME; const bucket = storage.bucket(bucketName); -const baseCmd = `gcloud beta functions`; +const baseCmd = `gcloud functions`; test.serial(`helloGCS: should print uploaded message`, async (t) => { t.plan(1); diff --git a/functions/imagemagick/README.md b/functions/imagemagick/README.md index 17cd154c2c..af7b31c209 100644 --- a/functions/imagemagick/README.md +++ b/functions/imagemagick/README.md @@ -27,7 +27,7 @@ Functions for your project. 1. Deploy the `blurOffensiveImages` function with a Storage trigger: - gcloud beta functions deploy blurOffensiveImages --trigger-bucket=YOUR_BUCKET_NAME + gcloud functions deploy blurOffensiveImages --trigger-bucket=YOUR_BUCKET_NAME * Replace `YOUR_BUCKET_NAME` with the name of the Cloud Storage Bucket you created earlier. @@ -36,7 +36,7 @@ Functions for your project. 1. Check the logs for the `blurOffensiveImages` function: - gcloud beta functions get-logs blurOffensiveImages + gcloud functions get-logs blurOffensiveImages You should see something like this in your console: diff --git a/functions/pubsub/README.md b/functions/pubsub/README.md index 67353ecc24..538e557ea5 100644 --- a/functions/pubsub/README.md +++ b/functions/pubsub/README.md @@ -28,17 +28,17 @@ can skip this step): 1. Deploy the `publish` function with an HTTP trigger: - gcloud beta functions deploy publish --trigger-http + gcloud functions deploy publish --trigger-http 1. Deploy the `subscribe` function with the Pub/Sub topic as a trigger: - gcloud beta functions deploy subscribe --trigger-topic YOUR_TOPIC_NAME + gcloud functions deploy subscribe --trigger-topic YOUR_TOPIC_NAME * Replace `YOUR_TOPIC_NAME` with the name of your Pub/Sub Topic. 1. Call the `publish` function: - gcloud beta functions call publish --data '{"topic":"YOUR_TOPIC_NAME","message":"Hello World!"}' + gcloud functions call publish --data '{"topic":"YOUR_TOPIC_NAME","message":"Hello World!"}' * Replace `YOUR_TOPIC_NAME` with the name of your Pub/Sub Topic. diff --git a/functions/uuid/README.md b/functions/uuid/README.md index 1708e7a2e1..0451146212 100644 --- a/functions/uuid/README.md +++ b/functions/uuid/README.md @@ -22,11 +22,11 @@ Functions for your project. 1. Deploy the `uuid` function with an HTTP trigger: - gcloud beta functions deploy uuid --trigger-http + gcloud functions deploy uuid --trigger-http 1. Call the `uuid` function: - gcloud beta functions call uuid + gcloud functions call uuid You should see something like this in your console: