Skip to content

Fix Windows environment set issue and change to env to params for compatibility #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ module.exports = {
const assetsDir = this.readConfig('assetsDir');

this.log('SENTRY: Creating release...');
this.sentryCliExec(`releases new ${releaseName}`);
this.sentryCliExec('releases', `new ${releaseName}`);

this.log('SENTRY: Assigning commits...');
this.sentryCliExec(`releases set-commits --auto ${releaseName}`);
this.sentryCliExec('releases', `set-commits --auto ${releaseName}`);

this.log('SENTRY: Uploading source maps...');
this.sentryCliExec(`releases files ${releaseName} upload-sourcemaps --rewrite ${assetsDir}`);
this.sentryCliExec('releases', `files ${releaseName} upload-sourcemaps --rewrite ${assetsDir}`);

this.log('SENTRY: Finalizing release...');
this.sentryCliExec(`releases finalize ${releaseName}`);
this.sentryCliExec('releases', `finalize ${releaseName}`);

this.log('SENTRY: Release published!...');
},
Expand All @@ -55,7 +55,7 @@ module.exports = {
const environment = this.readConfig('environment');

this.log('SENTRY: Deploying release...');
this.sentryCliExec(`releases deploys ${releaseName} new -e ${environment}`);
this.sentryCliExec('releases', `deploys ${releaseName} new -e ${environment}`);
this.log('SENTRY: Deployed!');
},

Expand All @@ -64,22 +64,26 @@ module.exports = {
const releaseName = `${appName}@${this.readConfig('revisionKey')}`;

this.log('SENTRY: Deleting release...');
this.sentryCliExec(`releases delete ${releaseName}`);
this.sentryCliExec('releases', `delete ${releaseName}`);
this.log('SENTRY: Release deleted!');
},

sentryCliExec(command) {
sentryCliExec(command, subCommand) {
const authToken = this.readConfig('authToken');
const orgName = this.readConfig('orgName');
const appName = this.readConfig('appName');
const url = this.readConfig('url');

return this._exec(
url ? `SENTRY_URL=${url} ` : '' +
`SENTRY_ORG=${orgName} ` +
`SENTRY_PROJECT=${appName} ` +
`SENTRY_AUTH_TOKEN=${authToken} ` +
`node_modules/.bin/sentry-cli ${command}`
[
path.join('node_modules', '.bin', 'sentry-cli'),
url ? `--url ${url}` : '',
`--auth-token ${authToken}`,
command,
`--org ${orgName}`,
`--project ${appName}`,
subCommand
].join(' ')
);
},

Expand Down