wp-blank-scripts 2.6.4 → 2.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,7 @@ const getMostRecentSqlFile = require('../utils/getMostRecentSqlFile');
11
11
  const runProjectBuildTask = require('../utils/runProjectBuildTask');
12
12
  const bumpVersion = require('../utils/bumpVersion');
13
13
  const isCI = require('../utils/isCI');
14
+ const execAsync = require('../utils/execAsync');
14
15
  const { DEPLOY_MODES } = require('../constants');
15
16
  const getProjectPath = require('../utils/getProjectPath');
16
17
  const getSettings = require('../utils/projectSettings');
@@ -19,9 +20,10 @@ const replaceSQL = require('../utils/replaceSQL');
19
20
 
20
21
  // Default options
21
22
  const defaultOptions = {
22
- tunnelHost: 'localhost',
23
- tunnelPort: 33333,
23
+ tunnelHost: '127.0.0.1',
24
+ tunnelPort: 3307,
24
25
  mySQLPort: 3306,
26
+ mySQLSocket: '/var/lib/mysql/mysql.sock',
25
27
  };
26
28
 
27
29
  let m;
@@ -68,6 +70,12 @@ async function createTunnel() {
68
70
 
69
71
  const { tunnelHost, tunnelPort, mySQLPort } = options;
70
72
 
73
+ if (isCI()) {
74
+ execAsync(`ssh -L ${tunnelPort}:${tunnelHost}:${mySQLPort} -N ${server.user}@${server.host}`);
75
+ logger.log(`Created tunnel to ${server.host}`);
76
+ return;
77
+ }
78
+
71
79
  let serverPrivateKey;
72
80
  if (options.serverPrivateKey) {
73
81
  serverPrivateKey = fs.readFileSync(cleanShellPath(options.serverPrivateKey));
@@ -187,6 +195,7 @@ async function connectMySQL() {
187
195
  m = mysql.createConnection({
188
196
  host: tunnelHost,
189
197
  port: tunnelPort,
198
+ socketPath: isCI() ? options.mySQLSocket : '/Applications/MAMP/tmp/mysql/mysql.sock',
190
199
  user,
191
200
  password,
192
201
  database,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wp-blank-scripts",
3
- "version": "2.6.4",
3
+ "version": "2.6.7",
4
4
  "description": "Personal Wordpress Scripts",
5
5
  "main": "index.js",
6
6
  "bin": {