-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new reset command & clean/prune arguments
The reset command allows you to delete all Atlassian host product data, which will now be persisted unless you use the new clean/prune options
- Loading branch information
Showing
25 changed files
with
249 additions
and
36 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
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
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
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,30 @@ | ||
#!/usr/bin/env node | ||
|
||
import { Option, program } from 'commander'; | ||
import { gracefulExit } from 'exit-hook'; | ||
|
||
import { AMPS } from '../applications/amps'; | ||
import { Bamboo } from '../applications/bamboo'; | ||
|
||
const version = AMPS.getApplicationVersion() || '9.6.1'; | ||
|
||
(async () => { | ||
const options = program | ||
.showHelpAfterError(true) | ||
.addOption(new Option('-v, --version <version>', 'The version of the host application').choices([ '9.4.3' ]).default(version)) | ||
.addOption(new Option('-d, --database <name>', 'The database engine to remove data from').choices([ 'postgresql', 'mysql', 'mssql' ]).default('postgresql')) | ||
.parse(process.argv) | ||
.opts(); | ||
|
||
const instance = new Bamboo({ | ||
version: options.version, | ||
database: options.database | ||
}); | ||
|
||
await instance.reset(); | ||
})(); | ||
|
||
process.on('SIGINT', () => { | ||
console.log(`Received term signal, trying to stop gracefully 💪`); | ||
gracefulExit(); | ||
}); |
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,30 @@ | ||
#!/usr/bin/env node | ||
|
||
import { Option, program } from 'commander'; | ||
import { gracefulExit } from 'exit-hook'; | ||
|
||
import { AMPS } from '../applications/amps'; | ||
import { Bitbucket } from '../applications/bitbucket'; | ||
|
||
const version = AMPS.getApplicationVersion() || '9.4.3'; | ||
|
||
(async () => { | ||
const options = program | ||
.showHelpAfterError(true) | ||
.addOption(new Option('-v, --version <version>', 'The version of the host application').choices([ '9.4.3' ]).default(version)) | ||
.addOption(new Option('-d, --database <name>', 'The database engine to remove data from').choices([ 'postgresql', 'mysql', 'mssql' ]).default('postgresql')) | ||
.parse(process.argv) | ||
.opts(); | ||
|
||
const instance = new Bitbucket({ | ||
version: options.version, | ||
database: options.database | ||
}); | ||
|
||
await instance.reset(); | ||
})(); | ||
|
||
process.on('SIGINT', () => { | ||
console.log(`Received term signal, trying to stop gracefully 💪`); | ||
gracefulExit(); | ||
}); |
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,30 @@ | ||
#!/usr/bin/env node | ||
|
||
import { Option, program } from 'commander'; | ||
import { gracefulExit } from 'exit-hook'; | ||
|
||
import { AMPS } from '../applications/amps'; | ||
import { Confluence } from '../applications/confluence'; | ||
|
||
const version = AMPS.getApplicationVersion() || '8.9.0'; | ||
|
||
(async () => { | ||
const options = program | ||
.showHelpAfterError(true) | ||
.addOption(new Option('-v, --version <version>', 'The version of the host application').choices([ '8.9.0' ]).default(version)) | ||
.addOption(new Option('-d, --database <name>', 'The database engine to remove data from').choices([ 'postgresql', 'mysql', 'mssql' ]).default('postgresql')) | ||
.parse(process.argv) | ||
.opts(); | ||
|
||
const instance = new Confluence({ | ||
version: options.version, | ||
database: options.database | ||
}); | ||
|
||
await instance.reset(); | ||
})(); | ||
|
||
process.on('SIGINT', () => { | ||
console.log(`Received term signal, trying to stop gracefully 💪`); | ||
gracefulExit(); | ||
}); |
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,30 @@ | ||
#!/usr/bin/env node | ||
|
||
import { Option, program } from 'commander'; | ||
import { gracefulExit } from 'exit-hook'; | ||
|
||
import { AMPS } from '../applications/amps'; | ||
import { Jira } from '../applications/jira'; | ||
|
||
const version = AMPS.getApplicationVersion() || '9.15.0'; | ||
|
||
(async () => { | ||
const options = program | ||
.showHelpAfterError(true) | ||
.addOption(new Option('-v, --version <version>', 'The version of the host application').choices([ '9.15.0' ]).default(version)) | ||
.addOption(new Option('-d, --database <name>', 'The database engine to remove data from').choices([ 'postgresql', 'mysql', 'mssql' ]).default('postgresql')) | ||
.parse(process.argv) | ||
.opts(); | ||
|
||
const instance = new Jira({ | ||
version: options.version, | ||
database: options.database, | ||
}); | ||
|
||
await instance.reset(); | ||
})(); | ||
|
||
process.on('SIGINT', () => { | ||
console.log(`Received term signal, trying to stop gracefully 💪`); | ||
gracefulExit(); | ||
}); |
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,28 @@ | ||
#!/usr/bin/env node | ||
|
||
import { Option, program } from 'commander'; | ||
|
||
import { AMPS } from '../applications/amps'; | ||
import { SupportedApplications } from '../types/SupportedApplications'; | ||
|
||
// Check if there is a command in the arguments | ||
const isDefaultCommand = !process.argv.some(item => Object.values(SupportedApplications).includes(item as SupportedApplications)); | ||
// If there is no command, check if we are running this within the context of an Atlassian Plugin project | ||
if (isDefaultCommand) { | ||
const application = AMPS.getApplication(); | ||
if (application) { | ||
const args = [ application, ...process.argv.splice(2) ]; | ||
process.argv = [ ...process.argv.slice(0, 2), ...args ]; | ||
} | ||
} | ||
|
||
program | ||
.name('dcdx reset') | ||
.addOption(new Option('-P, --activate-profiles <arg>', 'Comma-delimited list of profiles to activate')) | ||
.command('bamboo', 'Remove all data (incl. database) for Atlassian Bamboo (standalone)', { executableFile: './reset-bamboo.js'}) | ||
.command('bitbucket', 'Remove all data (incl. database) for Atlassian Bitbucket (standalone)', { executableFile: './reset-bitbucket.js'}) | ||
.command('confluence', 'Remove all data (incl. database) for Atlassian Confluence (standalone)', { executableFile: './reset-confluence.js'}) | ||
.command('jira', 'Remove all data (incl. database) for Atlassian Jira (standalone)', { executableFile: './reset-jira.js'}) | ||
.showHelpAfterError(true); | ||
|
||
program.parse(process.argv); |
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
Oops, something went wrong.