forked from midwayjs/midway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add generate rollback script (midwayjs#865)
- Loading branch information
1 parent
1be9b41
commit d2939f0
Showing
6 changed files
with
97 additions
and
70 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,40 @@ | ||
const { execSync } = require('child_process'); | ||
const { writeFileSync } = require('fs'); | ||
const { join } = require('path'); | ||
|
||
const currentVersion = require('../lerna.json').version; | ||
const originData = execSync('npx lerna ls --json').toString(); | ||
const data = JSON.parse(originData); | ||
|
||
const arr = ['#!/bin/bash\n', `# timestamp: ${Date.now()}\n\n`]; | ||
const diff = ['\n# Changes:\n\n']; | ||
|
||
for (const item of data) { | ||
|
||
if (item.private === false) { | ||
const remoteVersion = execSync( | ||
`npm show ${item.name} version` | ||
).toString().replace('\n', ''); | ||
|
||
const localVersion = item.version; | ||
console.log(`----> ${item.name} local=${localVersion} remote=${remoteVersion}`); | ||
|
||
if (remoteVersion !== localVersion) { | ||
arr.push( | ||
`npm dist-tag add ${item.name}@${remoteVersion} latest\n` | ||
); | ||
arr.push( | ||
`npm dist-tag add ${item.name}@${localVersion} beta\n` | ||
); | ||
arr.push( | ||
`tnpm dist-tag add ${item.name}@${remoteVersion} latest\n` | ||
); | ||
arr.push( | ||
`tnpm dist-tag add ${item.name}@${localVersion} latest\n` | ||
); | ||
diff.push(`# - ${item.name}: ${remoteVersion} => ${currentVersion}\n`); | ||
} | ||
} | ||
} | ||
|
||
writeFileSync(join(__dirname, `./rollback/rollback-${currentVersion}.sh`), arr.join('') + diff.join('')); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,51 @@ | ||
#!/bin/bash | ||
|
||
# Changes: | ||
# - @midwayjs/bootstrap: 2.7.7 => 2.8.0 | ||
# - @midwayjs/core: 2.7.7 => 2.8.0 | ||
# - @midwayjs/decorator: 2.7.7 => 2.8.0 | ||
# - @midwayjs/faas: 2.7.7 => 2.8.0 | ||
# - @midwayjs/grpc: 2.7.7 => 2.8.0 | ||
# - @midwayjs/logger: 2.7.7 => 2.8.0 | ||
# - midway-schedule: 2.7.7 => 2.8.0 | ||
# - midway: 2.7.7 => 2.8.0 | ||
# - @midwayjs/mock: 2.7.7 => 2.8.0 | ||
# - @midwayjs/rabbitmq: 2.7.7 => 2.8.0 | ||
# - @midwayjs/socketio: 2.7.7 => 2.8.0 | ||
# - @midwayjs/typegoose: 2.7.7 => 2.8.0 | ||
# - @midwayjs/express: 2.7.7 => 2.8.0 | ||
# - @midwayjs/koa: 2.7.7 => 2.8.0 | ||
# - @midwayjs/web: 2.7.7 => 2.8.0 | ||
|
||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add [email protected] beta | ||
npm dist-tag add [email protected] latest | ||
npm dist-tag add [email protected] beta | ||
npm dist-tag add [email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest | ||
npm dist-tag add @midwayjs/[email protected] beta | ||
npm dist-tag add @midwayjs/[email protected] latest |