-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
platform_build_and_push
to dashboard
- Loading branch information
Showing
6 changed files
with
167 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module.exports = { | ||
// for pm2 deploy (remote server exec pull and deploy) | ||
// https://pm2.keymetrics.io/docs/usage/deployment/ | ||
deploy: { | ||
dashboard: { | ||
host: '47.90.57.225', | ||
port: '22', | ||
user: 'www-data', | ||
ref: 'origin/dashboard', | ||
repo: 'git@code.aliyun.com:solidzoro/deploy-leaa.git', | ||
env: { NODE_ENV: 'production' }, | ||
path: '/var/www/leaa-dashboard', | ||
'pre-setup': ` | ||
echo ----DASHBOARD-PRE---- && | ||
echo ----DASHBOARD-PRE---- && | ||
echo ----DASHBOARD-PRE---- && | ||
echo ----DASHBOARD-PRE---- && | ||
pwd && | ||
ls -la && | ||
echo ----DASHBOARD-PRE---- && | ||
echo ----DASHBOARD-PRE---- && | ||
echo ----DASHBOARD-PRE---- && | ||
echo ----DASHBOARD-PRE---- | ||
`, | ||
'post-deploy': ` | ||
echo -------- && | ||
pwd && | ||
echo - && | ||
ls -la && | ||
echo -------- | ||
`, | ||
}, | ||
}, | ||
}; | ||
|
||
// && | ||
// docker-compose down && | ||
// docker-compose up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module.exports = { | ||
// for pm2 deploy (remote server exec pull and deploy) | ||
// https://pm2.keymetrics.io/docs/usage/deployment/ | ||
deploy: { | ||
api: { | ||
host: '111.111.111.111', | ||
port: '22', | ||
user: 'www-data', | ||
ref: 'origin/dashboard', | ||
repo: 'git@xxxxxxxx.com:aaaa/bbbb.git', | ||
env: { NODE_ENV: 'production' }, | ||
path: '/var/www/leaa-dashboard', | ||
'pre-setup': ` | ||
echo ----DASHBOARD---- && | ||
echo ----DASHBOARD---- && | ||
echo ----DASHBOARD---- && | ||
echo ----DASHBOARD---- && | ||
pwd && | ||
ls -la && | ||
echo ----DASHBOARD---- && | ||
echo ----DASHBOARD---- && | ||
echo ----DASHBOARD---- && | ||
echo ----DASHBOARD---- | ||
`, | ||
'post-deploy': ` | ||
echo -------- && | ||
pwd && | ||
echo - && | ||
ls -la && | ||
echo -------- | ||
`, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const mkdirp = require('mkdirp'); | ||
const moment = require('moment'); | ||
const childProcess = require('child_process'); | ||
|
||
const pkg = require('../../package.json'); | ||
|
||
const getGitVersion = (childProcess.execSync('git rev-parse HEAD') || '').toString().substr(0, 4); | ||
const getProjectVersion = pkg.version; | ||
const getVersion = `v${getProjectVersion} (${getGitVersion})`; | ||
|
||
const DIST_PUBLIC_DIR = path.resolve(__dirname, '../../_dist'); | ||
const DIST_FILE_PATH = `${DIST_PUBLIC_DIR}/version.txt`; | ||
|
||
const buildInfo = { | ||
VERSION: getVersion, | ||
BUILDTIME: moment().format('YYYYMMDD-HHmmss'), | ||
}; | ||
|
||
if (!fs.existsSync(DIST_PUBLIC_DIR)) { | ||
console.log(`NEED mkdirp ----> ${DIST_PUBLIC_DIR}`); | ||
|
||
mkdirp(DIST_PUBLIC_DIR, (err) => err && console.log(JSON.stringify(err))); | ||
} | ||
|
||
console.log('\n\n🌈 DONE-GEN-VERSION-FILE', '\n\n'); | ||
|
||
fs.writeFileSync(DIST_FILE_PATH, JSON.stringify(buildInfo)); |