Skip to content

Commit

Permalink
Update cloud-sql/mysql sample
Browse files Browse the repository at this point in the history
* Delete instructions for GAE Flex.
* Update Node version to 10 for GAE Standard.
* Delete repo-tools.
* Clean up package.json
  • Loading branch information
fhinkel committed Nov 26, 2019
1 parent 088778c commit 416f48f
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 80 deletions.
16 changes: 0 additions & 16 deletions cloud-sql/mysql/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,6 @@ command:
gcloud app browse
```

## Deploy to Google App Engine Flexible

First, update `app.flexible.yaml` with the correct values to pass the environment
variables into the runtime.

Next, the following command will deploy the application to your Google Cloud project:
```bash
gcloud app deploy app.flexible.yaml
```

To launch your browser and view the app at https://[YOUR_PROJECT_ID].appspot.com, run the following
command:
```bash
gcloud app browse
```

## Deploy to Cloud Run

See the [Cloud Run documentation](https://cloud.google.com/sql/docs/mysql/connect-run)
Expand Down
30 changes: 0 additions & 30 deletions cloud-sql/mysql/mysql/app.flexible.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion cloud-sql/mysql/mysql/app.standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

runtime: nodejs8
runtime: nodejs10

# The following env variables may contain sensitive information that grants
# anyone access to your database. Do not add this file to your source control.
Expand Down
31 changes: 2 additions & 29 deletions cloud-sql/mysql/mysql/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "cloudsql-mysql-mysql",
"description": "Node.js Cloud SQL MySQL Connectivity Sample",
"version": "0.0.1",
"private": true,
"license": "Apache-2.0",
"author": "Google Inc.",
Expand All @@ -10,51 +9,25 @@
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.0.0"
},
"scripts": {
"system-test": "mocha test/*.test.js --timeout=60000 --exit",
"test": "npm run system-test"
},
"dependencies": {
"@google-cloud/logging-winston": "^3.0.0",
"body-parser": "1.19.0",
"body-parser": "^1.19.0",
"express": "^4.17.1",
"promise-mysql": "^4.0.0",
"prompt": "^1.0.0",
"pug": "^2.0.3",
"winston": "^3.1.0"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "^3.3.0",
"mocha": "^6.0.0",
"proxyquire": "^2.1.0",
"supertest": "^4.0.0",
"sinon": "^7.1.1"
},
"cloud-repo-tools": {
"requiresKeyFile": true,
"requiresProjectId": true,
"test": {
"app": {
"requiredEnvVars": [
"DB_USER",
"DB_PASS",
"DB_NAME",
"CLOUD_SQL_INSTANCE_NAME"
],
"args": [
"server.js"
]
},
"build": {
"requiredEnvVars": [
"DB_USER",
"DB_PASS",
"DB_NAME",
"CLOUD_SQL_INSTANCE_NAME"
]
}
}
}
}
4 changes: 0 additions & 4 deletions cloud-sql/mysql/mysql/test/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
const request = require('supertest');
const sinon = require('sinon');
const assert = require('assert');
const tools = require('@google-cloud/nodejs-repo-tools');

// Stub out MySQL calls
const stubMysql = sinon.stub(require('promise-mysql'));
Expand All @@ -30,9 +29,6 @@ stubMysql.createPool.returns(poolStub);

const server = require('../server.js');

beforeEach(tools.stubConsole);
afterEach(tools.restoreConsole);

it('check index page', async () => {
const response = await request(server)
.get('/')
Expand Down

0 comments on commit 416f48f

Please sign in to comment.