wp-blank-scripts 2.6.10 → 2.6.12
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.
- package/lib/deployProject.js +2 -1
- package/package.json +2 -1
- package/utils/deploySQLFromCI.js +13 -6
package/lib/deployProject.js
CHANGED
|
@@ -278,7 +278,8 @@ module.exports = async (selectOptions, callbacks) => {
|
|
|
278
278
|
|
|
279
279
|
if (options.sql) {
|
|
280
280
|
if (isCI()) {
|
|
281
|
-
|
|
281
|
+
console.log(options);
|
|
282
|
+
return deploySQLFromCI(options);
|
|
282
283
|
}
|
|
283
284
|
|
|
284
285
|
const file = await exportSql({ environment: options.environment });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wp-blank-scripts",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.12",
|
|
4
4
|
"description": "Personal Wordpress Scripts",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"lint-staged": "^9.2.5",
|
|
67
67
|
"mini-css-extract-plugin": "^0.9.0",
|
|
68
68
|
"mysql": "^2.13.0",
|
|
69
|
+
"node-fetch": "2",
|
|
69
70
|
"node-sass": "^4.14.1",
|
|
70
71
|
"normalize.css": "^8.0.1",
|
|
71
72
|
"opn": "^6.0.0",
|
package/utils/deploySQLFromCI.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
|
+
const fetch = require('node-fetch');
|
|
2
3
|
|
|
3
4
|
const getMostRecentSqlFile = require('./getMostRecentSqlFile');
|
|
4
5
|
const getSettings = require('./projectSettings');
|
|
6
|
+
const replaceSQL = require('../utils/replaceSQL');
|
|
5
7
|
|
|
6
|
-
const DEPLOY_URL = 'https://
|
|
8
|
+
const DEPLOY_URL = 'https://a64vpm7gjh4nzgmrys6vmltsva0dydvc.lambda-url.ap-southeast-2.on.aws/';
|
|
7
9
|
|
|
8
|
-
async function deploySQLFromCI() {
|
|
9
|
-
const { default: fetch } = await import('node-fetch');
|
|
10
|
+
async function deploySQLFromCI(options) {
|
|
10
11
|
const file = getMostRecentSqlFile(true);
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
console.log({ file });
|
|
14
|
+
|
|
15
|
+
await replaceSQL({
|
|
16
|
+
environmentIn: 'local',
|
|
17
|
+
environmentOut: options.environment,
|
|
18
|
+
file,
|
|
19
|
+
});
|
|
20
|
+
|
|
12
21
|
const sql = fs.readFileSync(file, 'utf8');
|
|
13
22
|
|
|
14
23
|
const response = await fetch(DEPLOY_URL, {
|
|
@@ -20,8 +29,6 @@ async function deploySQLFromCI() {
|
|
|
20
29
|
});
|
|
21
30
|
|
|
22
31
|
console.log(response.status);
|
|
23
|
-
const body = await response.json();
|
|
24
|
-
console.log(body);
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
module.exports = deploySQLFromCI;
|