Skip to content

Commit

Permalink
Merge pull request #115 from theohbrothers/enhancement/entrypoint-sta…
Browse files Browse the repository at this point in the history
…ndardize-and-improve-clarity-of-verbose-output

Enhancement (entrypoint): Standardize and improve clarity of verbose output
  • Loading branch information
joeltimothyoh authored Jun 1, 2024
2 parents a3ce002 + b0a587d commit 6e846f6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
18 changes: 13 additions & 5 deletions src/scripts/ci/Invoke-Generate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,40 @@ try {

# Generate release notes
if ($env:PROJECT_DIRECTORY) {
"Using specified project directory '$env:PROJECT_DIRECTORY'" | Write-Verbose
$private:ProjectDir = $env:PROJECT_DIRECTORY
}else {
$private:superProjectDir = git rev-parse --show-superproject-working-tree
if ($private:superProjectDir) {
$private:ProjectDir = $private:superProjectDir
"Using superproject path '$private:ProjectDir'" | Write-Verbose
"Using superproject directory '$private:ProjectDir'" | Write-Verbose
}else {
throw "`$env:PROJECT_DIRECTORY is undefined or superproject directory cannot be determined." | Write-Verbose
}
}
$private:generateArgs = @{
Path = $private:ProjectDir
TagName = if ($env:RELEASE_TAG_REF) {
$env:RELEASE_TAG_REF
"Using specified ref '$env:RELEASE_TAG_REF'" | Write-Verbose
$env:RELEASE_TAG_REF
}else {
"`$env:RELEASE_TAG_REF is null or undefined. Using the default ref 'HEAD'" | Write-Verbose
"Using default ref 'HEAD'" | Write-Verbose
'HEAD'
}
Variant = if ($env:RELEASE_NOTES_VARIANT) { $env:RELEASE_NOTES_VARIANT } else { 'VersionDate-HashSubject-NoMerges-CategorizedSorted' }
Variant = if ($env:RELEASE_NOTES_VARIANT) {
"Using specified release notes variant '$env:RELEASE_NOTES_VARIANT'" | Write-Verbose
$env:RELEASE_NOTES_VARIANT
}else {
"Using default release notes variant 'VersionDate-HashSubject-NoMerges-CategorizedSorted'" | Write-Verbose
'VersionDate-HashSubject-NoMerges-CategorizedSorted'
}
ReleaseNotesPath = if ($env:RELEASE_NOTES_PATH) {
"Using specified release notes path '$env:RELEASE_NOTES_PATH'" | Write-Verbose
if ([System.IO.Path]::IsPathRooted($env:RELEASE_NOTES_PATH)) { $env:RELEASE_NOTES_PATH }
else { "$private:ProjectDir/$env:RELEASE_NOTES_PATH" }
}else {
$private:defaultReleaseNotesPath = "$(git rev-parse --show-toplevel)/.release-notes.md"
"Using the default release notes path '$private:defaultReleaseNotesPath'" | Write-Verbose
"Using default release notes path '$private:defaultReleaseNotesPath'" | Write-Verbose
$private:defaultReleaseNotesPath
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/scripts/ci/Invoke-Release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ try {

# Create GitHub release
if ($env:PROJECT_DIRECTORY) {
"Using specified project directory '$env:PROJECT_DIRECTORY'" | Write-Verbose
$private:ProjectDir = $env:PROJECT_DIRECTORY
}else {
$private:superProjectDir = git rev-parse --show-superproject-working-tree
if ($private:superProjectDir) {
$private:ProjectDir = $private:superProjectDir
"Using superproject path '$private:ProjectDir'" | Write-Verbose
"Using superproject directory '$private:ProjectDir'" | Write-Verbose
}else {
throw "`$env:PROJECT_DIRECTORY is undefined or superproject directory cannot be determined." | Write-Verbose
}
Expand All @@ -40,7 +41,7 @@ try {
}else {
$private:defaultReleaseNotesPath = "$(git rev-parse --show-toplevel)/.release-notes.md"
if (Test-Path -Path $private:defaultReleaseNotesPath -PathType Leaf) {
"Sourcing from the default release notes path '$private:defaultReleaseNotesPath'" | Write-Verbose
"Sourcing from default release notes path '$private:defaultReleaseNotesPath'" | Write-Verbose
$private:createReleaseArgs['ReleaseNotesPath'] = $private:defaultReleaseNotesPath
}else {
"Default release notes not found at the path '$private:defaultReleaseNotesPath'. No release notes will be included with the release." | Write-Verbose
Expand Down

0 comments on commit 6e846f6

Please sign in to comment.