-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.js
35 lines (32 loc) · 1.09 KB
/
deploy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const fs = require('fs')
const path = require('path')
const {
runCLI,
} = require('deployer-buddy')
const rootDir = __dirname
const GIT_BRANCH = process.env.GIT_BRANCH
const handler = {
buildInfoDocs: async () => {
},
buildInfo: async () => {
if(
process.env.GIT_URL_CI_RUN ||
process.env.GIT_URL_COMMIT ||
process.env.GIT_CI_RUN ||
process.env.GIT_COMMIT
) {
const buildInfo = {
GIT_BRANCH: GIT_BRANCH,
GIT_URL_CI_RUN: process.env.GIT_URL_CI_RUN,
GIT_URL_COMMIT: process.env.GIT_URL_COMMIT,
GIT_CI_RUN: process.env.GIT_CI_RUN,
GIT_COMMIT: process.env.GIT_COMMIT,
}
fs.writeFileSync(path.join(rootDir, 'packages/render-api/build/build_info.json'), JSON.stringify(buildInfo))
fs.writeFileSync(path.join(rootDir, 'packages/demo-static/build/build_info.json'), JSON.stringify(buildInfo))
}
console.log('Created Build Info File.')
},
}
const actionTargets = {}
runCLI(actionTargets, handler)