Skip to content

Commit 49b8b6a

Browse files
authored
Merge pull request #85 from back4app/improve_deploy_time
Improve deployment time
2 parents 2e9486f + 76f9465 commit 49b8b6a

File tree

4 files changed

+5
-38
lines changed

4 files changed

+5
-38
lines changed

deploy-homolog.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ branch=$(git symbolic-ref --short HEAD)
1010
git='~/bin/git-parse-dashboard'
1111

1212
ssh -t -i $b4a_certs_path/$pem $user@$host "sudo su back4app -c '. ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/parse-dashboard && $git reset --hard && $git remote update && $git checkout $branch && $git merge origin/$branch && npm install'"
13-
ssh -t -i $b4a_certs_path/$pem $user@$host "sudo su back4app -c '. ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/parse-dashboard && sed -i \"s/http:\/\/localhost:4000\/parseapi/https:\/\/dashboard-homolog.back4app.com\/parseapi/\" node_modules/parse/lib/browser/settings.js && npm run prepublish && npm run build-homolog'"
13+
ssh -t -i $b4a_certs_path/$pem $user@$host "sudo su back4app -c '. ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/parse-dashboard && sed -i \"s/http:\/\/localhost:4000\/parseapi/https:\/\/dashboard-homolog.back4app.com\/parseapi/\" node_modules/parse/lib/browser/settings.js && npm run build-homolog'"
1414

1515
#ssh -t aws_B4ANFS_Homolog "sudo su back4app -c '. ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/back4app-site && yarn install && npm run build && pm2 reload site'"

deploy-prod.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ branch=master
1111
git='~/bin/git-parse-dashboard'
1212

1313
ssh -t -i $b4a_certs_path/$pem $user@$host "sudo su back4app -c 'cp -r ~/scm/parse-dashboard ~/scm/parse-dashboard-$now && . ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/parse-dashboard && $git reset --hard && $git remote update && $git checkout $branch && $git merge origin/$branch && yarn install --production=false '"
14-
ssh -t -i $b4a_certs_path/$pem $user@$host "sudo su back4app -c '. ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/parse-dashboard && sed -i \"s/http:\/\/localhost:4000\/parseapi/https:\/\/dashboard.back4app.com\/parseapi/\" node_modules/parse/lib/browser/settings.js && npm run prepublish && npm run build'"
14+
ssh -t -i $b4a_certs_path/$pem $user@$host "sudo su back4app -c '. ~/.nvm/nvm.sh && nvm use 9 && cd ~/scm/parse-dashboard && sed -i \"s/http:\/\/localhost:4000\/parseapi/https:\/\/dashboard.back4app.com\/parseapi/\" node_modules/parse/lib/browser/settings.js && npm run build'"
1515

1616
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/69ace06909c83213745231d2c6d0fd27/purge_cache" -H "X-Auth-Email: $CF_EMAIL" -H "X-Auth-Key: $CF_KEY" -H "Content-Type: application/json" --data '{"files":[
1717
"https://parse-dashboard.back4app.com/bundles/dashboard.bundle.js",

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,14 @@
103103
"watch": "NODE_ENV=dev webpack --config webpack/build.config.js --devtool eval-source-map --progress --watch",
104104
"dev": "nodemon ./Parse-Dashboard/index.js & webpack --config webpack/build.config.js --devtool eval-source-map --progress --watch",
105105
"pig": "http-server ./PIG -p 4041 -s & webpack --config webpack/PIG.config.js --progress --watch",
106-
"build": "NODE_ENV=production webpack --config webpack/production.config.js && webpack --config webpack/PIG.config.js",
107-
"build-homolog": "NODE_ENV=homolog webpack --config webpack/homolog.config.js && webpack --config webpack/PIG.config.js",
106+
"build": "webpack --config webpack/publish.config.js --progress && webpack --config webpack/production.config.js && webpack --config webpack/PIG.config.js",
107+
"build-homolog": "webpack --config webpack/homolog.config.js",
108108
"test": "NODE_PATH=./node_modules jest",
109109
"lint": "eslint . --ignore-path .gitignore --cache",
110110
"pretest": "npm run lint",
111111
"generate": "node scripts/generate.js",
112112
"deploy-homolog": "sh deploy-homolog.sh",
113113
"deploy-prod": "sh deploy-prod.sh",
114-
"prepublish": "webpack --config webpack/publish.config.js --progress",
115114
"start": "node ./Parse-Dashboard/index.js"
116115
},
117116
"bin": {

webpack/homolog.config.js

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,11 @@
1-
var configuration = require('./base.config.js');
2-
var HtmlWebpackExternalsPlugin = require('html-webpack-externals-plugin');
3-
var settings = require('@back4app/back4app-settings');
4-
5-
configuration.entry = {
6-
dashboard: './dashboard/index.js',
7-
login: './login/index.js',
8-
PIG: './parse-interface-guide/index.js',
9-
quickstart: './quickstart/index.js',
10-
};
11-
configuration.output.path = require('path').resolve('./production/bundles');
12-
1+
var configuration = require('./publish.config.js');
132
var webpack = require('webpack');
143

15-
// Enable minification
164
configuration.plugins.push(
175
new webpack.DefinePlugin({
186
'process.env': {
197
'NODE_ENV': '"homolog"'
208
}
21-
}),
22-
new webpack.optimize.UglifyJsPlugin({
23-
compress: {
24-
warnings: false
25-
}
26-
}),
27-
new webpack.optimize.OccurrenceOrderPlugin(),
28-
function() {
29-
this.plugin('done', function(stats) {
30-
if (stats.compilation.errors && stats.compilation.errors.length) {
31-
console.log(stats.compilation.errors);
32-
process.exit(1);
33-
}
34-
});
35-
},
36-
new HtmlWebpackExternalsPlugin({
37-
externals: [{
38-
module: '@back4app/back4app-navigation',
39-
entry: settings.BACK4APP_NAVIGATION_PATH + '/back4app-navigation.bundle.js'
40-
}]
419
})
4210
);
4311

0 commit comments

Comments
 (0)