forked from angular/components
-
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.
build: publish docs-content bazel artifacts (angular#14634)
- Loading branch information
1 parent
c15e2cf
commit 16a4a05
Showing
10 changed files
with
62 additions
and
510 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* Bazel workspace status script that is responsible for creating Bazel stamping variables. | ||
* The stamping variables will be used by the NodeJS Bazel rules to provide proper version | ||
* placeholder replacements. Read more about variable stamping within Bazel: | ||
* https://docs.bazel.build/versions/master/user-manual.html#flag--workspace_status_command | ||
*/ | ||
|
||
const spawnSync = require('child_process').spawnSync; | ||
const packageJson = require('../package'); | ||
|
||
const currentCommitSha = getCurrentCommitSha(); | ||
|
||
// The "BUILD_SCM_VERSION" will be picked up by the "npm_package" and "ng_package" rule | ||
// in order to replace the "0.0.0-PLACEHOLDER" with a proper version | ||
console.log(`BUILD_SCM_VERSION ${packageJson.version}-${currentCommitSha.substr(0, 7)}`); | ||
console.log(`BUILD_SCM_COMMIT_SHA ${currentCommitSha}`); | ||
console.log(`BUILD_SCM_BRANCH ${getCurrentBranchName()}`); | ||
console.log(`BUILD_SCM_USER ${getCurrentGitUser()}`); | ||
|
||
/** Returns the commit SHA for the current git HEAD of the project. */ | ||
function getCurrentCommitSha() { | ||
return spawnSync('git', ['rev-parse', 'HEAD']).stdout.toString().trim(); | ||
} | ||
|
||
/** Returns the name of the currently checked out branch of the project. */ | ||
function getCurrentBranchName() { | ||
return spawnSync('git', ['symbolic-ref', '--short', 'HEAD']).stdout.toString().trim(); | ||
} | ||
|
||
/** Returns the name and email of the Git user that creates this release build. */ | ||
function getCurrentGitUser() { | ||
const userName = spawnSync('git', ['config', 'user.name']).stdout.toString().trim(); | ||
const userEmail = spawnSync('git', ['config', 'user.email']).stdout.toString().trim(); | ||
|
||
return `${userName} <${userEmail}>`; | ||
} |
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
Oops, something went wrong.