-
Notifications
You must be signed in to change notification settings - Fork 79
chore(build): streamline release command execution MONGOSH-534 #651
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
rose-m
merged 6 commits into
master
from
MONGOSH-534-streamline-release-command-execution
Feb 16, 2021
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b197b8b
chore(build): streamline release command execution MONGOSH-534
rose-m 5baa322
fixup
rose-m 0f9d889
fixup
rose-m 5ada3c3
fixup
rose-m ebd6323
Update .evergreen/package-and-upload-artifact.sh
rose-m d03d47e
fixup
rose-m File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,7 +1,36 @@ | ||
import release from './release'; | ||
import { getArtifactUrl } from './evergreen'; | ||
import { downloadMongoDb } from './download-mongodb'; | ||
import path from 'path'; | ||
import { BuildVariant } from './config'; | ||
import { downloadMongoDb } from './download-mongodb'; | ||
import { getArtifactUrl } from './evergreen'; | ||
import { release, ReleaseCommand } from './release'; | ||
|
||
export { getArtifactUrl, downloadMongoDb }; | ||
|
||
if (require.main === module) { | ||
(async() => { | ||
const config = require(path.join(__dirname, '..', '..', '..', 'config', 'build.conf.js')); | ||
|
||
const command = process.argv[2]; | ||
|
||
if (!['bump', 'compile', 'package', 'upload', 'draft', 'publish'].includes(command)) { | ||
throw new Error('USAGE: npm run evergreen-release <bump|compile|package|upload|draft|publish>'); | ||
} | ||
|
||
const cliBuildVariant = process.argv | ||
.map((arg) => arg.match(/^--build-variant=(.+)$/)) | ||
.filter(Boolean)[0]; | ||
if (cliBuildVariant) { | ||
config.buildVariant = cliBuildVariant[1]; | ||
} | ||
|
||
// Resolve 'Windows' to 'win32' etc. | ||
if (config.buildVariant in BuildVariant) { | ||
config.buildVariant = (BuildVariant as any)[config.buildVariant]; | ||
} | ||
|
||
export default release; | ||
export { release, BuildVariant, getArtifactUrl, downloadMongoDb }; | ||
await release(command as ReleaseCommand, config); | ||
})().then( | ||
() => process.exit(0), | ||
(err) => process.nextTick(() => { throw err; }) | ||
); | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to use absolute paths on Windows, you’ll need to use
cygpath -w
on the filepath before passing it to Node.js (because this would be/cygdrive/c/.../artifact-url.txt
, which on Windows would be interpreted as a path relative to the FS root, e.g.C:\cygdrive\c\...\artifact-url.txt
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope the way I've included it now makes that part work...