diff --git a/deploy/1-fetch-and-build.ps1 b/deploy/1-fetch-and-build.ps1 index 2d498fc12c..873dae393e 100644 --- a/deploy/1-fetch-and-build.ps1 +++ b/deploy/1-fetch-and-build.ps1 @@ -15,17 +15,23 @@ $currentVersion = $commonPropsXmlCurrent.Project.PropertyGroup.Version.Trim() if (!$newVersion) { - $newVersion = Read-Host "Current version is '$currentVersion'. Enter the new version " + $newVersion = Read-Host "Current version is '$currentVersion'. Enter the new version (empty for no change) " + if($newVersion -eq "") + { + $newVersion = $currentVersion + } } -# Update common.props for version attribute -$commonPropsXmlCurrent.Project.PropertyGroup.Version = $newVersion -$commonPropsXmlCurrent.Save( $commonPropsFilePath ) -#check if it's updated... -$commonPropsXmlNew = [xml](Get-Content $commonPropsFilePath ) -$newVersionAfterUpdate = $commonPropsXmlNew.Project.PropertyGroup.Version +if ($newVersion -ne $currentVersion){ + # Update common.props for version attribute + $commonPropsXmlCurrent.Project.PropertyGroup.Version = $newVersion + $commonPropsXmlCurrent.Save( $commonPropsFilePath ) + #check if it's updated... + $commonPropsXmlNew = [xml](Get-Content $commonPropsFilePath ) + $newVersionAfterUpdate = $commonPropsXmlNew.Project.PropertyGroup.Version + echo "`n`nNew version updated as '$newVersionAfterUpdate' in $commonPropsFilePath`n" +} -echo "`n`nNew version updated as '$newVersionAfterUpdate' in $commonPropsFilePath`n" echo "`n-----=====[ PULLING ABP REPO - BRANCH: $branch ]=====-----`n" cd .. diff --git a/deploy/2-nuget-pack.ps1 b/deploy/2-nuget-pack.ps1 index 82d6b31180..4a7f4ec5dc 100644 --- a/deploy/2-nuget-pack.ps1 +++ b/deploy/2-nuget-pack.ps1 @@ -1,6 +1,10 @@ -echo "`n-----=====[ CREATING NUGET PACKAGES ]=====-----`n" +. ..\nupkg\common.ps1 +Write-Info "Creating NuGet packages" +echo "`n-----=====[ CREATING NUGET PACKAGES ]=====-----`n" cd ..\nupkg powershell -File pack.ps1 - echo "`n-----=====[ CREATING NUGET PACKAGES COMPLETED ]=====-----`n" + +Write-Info "Creating NuGet packages completed" +cd ..\deploy #always return to the deploy directory \ No newline at end of file diff --git a/deploy/3-nuget-push.ps1 b/deploy/3-nuget-push.ps1 index f99e9adf55..0db81cf618 100644 --- a/deploy/3-nuget-push.ps1 +++ b/deploy/3-nuget-push.ps1 @@ -2,6 +2,8 @@ param( [string]$nugetApiKey ) +. ..\nupkg\common.ps1 + if (!$nugetApiKey) { #reading password from file content @@ -19,9 +21,11 @@ if (!$nugetApiKey) $nugetApiKey = Read-Host "Enter the NuGet API KEY" } -echo "`n-----=====[ PUSHING PACKS TO NUGET ]=====-----`n" - +Write-Info "Pushing packages to NuGet" +echo "`n-----=====[ PUSHING PACKAGES TO NUGET ]=====-----`n" cd ..\nupkg powershell -File push_packages.ps1 $nugetApiKey +echo "`n-----=====[ PUSHING PACKAGES TO NUGET COMPLETED ]=====-----`n" +Write-Info "Pushing packages to NuGet Completed" -echo "`n-----=====[ PUSHING PACKS TO NUGET COMPLETED ]=====-----`n" +cd deploy #always return to the deploy directory \ No newline at end of file diff --git a/deploy/4-npm-publish.ps1 b/deploy/4-npm-publish-mvc.ps1 similarity index 56% rename from deploy/4-npm-publish.ps1 rename to deploy/4-npm-publish-mvc.ps1 index 1941f66994..e7fade4259 100644 --- a/deploy/4-npm-publish.ps1 +++ b/deploy/4-npm-publish-mvc.ps1 @@ -2,6 +2,8 @@ param( [string]$npmAuthToken ) +. ..\nupkg\common.ps1 + if (!$npmAuthToken) { #reading password from file content @@ -21,13 +23,17 @@ if (!$npmAuthToken) cd ..\npm -echo "`n-----=====[ SETTING NPM AUTH TOKEN ]=====-----`n" +#---------------------------------------------------------------------------- + +echo "`nSetting npmjs.org auth-token token`n" npm set //registry.npmjs.org/:_authToken $npmAuthToken +#---------------------------------------------------------------------------- + +Write-Info "Pushing MVC packages to NPM" echo "`n-----=====[ PUSHING MVC PACKS TO NPM ]=====-----`n" powershell -File publish-mvc.ps1 +echo "`n-----=====[ PUSHING MVC PACKS TO NPM COMPLETED ]=====-----`n" +Write-Info "Pushing MVC packages to NPM completed" -echo "`n-----=====[ PUSHING ANGULAR PACKS TO NPM ]=====-----`n" -powershell -File publish-ng.ps1 - -echo "`n-----=====[ PUSHING PACKS TO NPM COMPLETED ]=====-----`n" +cd ..\deploy #always return to the deploy directory \ No newline at end of file diff --git a/deploy/5-npm-publish-angular.ps1 b/deploy/5-npm-publish-angular.ps1 new file mode 100644 index 0000000000..0b2ac031e5 --- /dev/null +++ b/deploy/5-npm-publish-angular.ps1 @@ -0,0 +1,39 @@ +param( + [string]$npmAuthToken +) + +. ..\nupkg\common.ps1 + +if (!$npmAuthToken) +{ + #reading password from file content + $passwordFileName = "npm-auth-token.txt" + $pathExists = Test-Path -Path $passwordFileName -PathType Leaf + if ($pathExists) + { + $npmAuthToken = Get-Content $passwordFileName + echo "Using NPM Auth Token from $passwordFileName ..." + } +} + +if (!$npmAuthToken) +{ + $npmAuthToken = Read-Host "Enter the NPM Auth Token" +} + +cd ..\npm + +#---------------------------------------------------------------------------- + +echo "`nSetting npmjs.org auth-token token`n" +npm set //registry.npmjs.org/:_authToken $npmAuthToken + +#---------------------------------------------------------------------------- + +Write-Info "Pushing MVC packages to NPM" +echo "`n-----=====[ PUSHING MVC PACKS TO NPM ]=====-----`n" +powershell -File publish-ng.ps1 +echo "`n-----=====[ PUSHING MVC PACKS TO NPM COMPLETED ]=====-----`n" +Write-Info "Pushing MVC packages to NPM completed" + +cd ..\deploy #always return to the deploy directory diff --git a/deploy/5-git-commit.ps1 b/deploy/6-git-commit.ps1 similarity index 53% rename from deploy/5-git-commit.ps1 rename to deploy/6-git-commit.ps1 index 094f4b827f..e944bcff1f 100644 --- a/deploy/5-git-commit.ps1 +++ b/deploy/6-git-commit.ps1 @@ -1,8 +1,14 @@ +. ..\nupkg\common.ps1 + cd .. +Write-Info "Committing changes to GitHub" echo "`n-----=====[ COMMITTING CHANGES ]=====-----`n" git add . git commit -m Update_NPM_Package_Versions git push echo "`n-----=====[ COMMITTING CHANGES COMPLETED ]=====-----`n" +Write-Info "Committing changes to GitHub completed" + +cd deploy #always return to the deploy directory \ No newline at end of file diff --git a/deploy/6-new-github-release__NOT_ACTIVE_USE_MANUAL_WAY.ps1 b/deploy/7-new-github-release__NOT_ACTIVE_USE_MANUAL_WAY.ps1 similarity index 100% rename from deploy/6-new-github-release__NOT_ACTIVE_USE_MANUAL_WAY.ps1 rename to deploy/7-new-github-release__NOT_ACTIVE_USE_MANUAL_WAY.ps1 diff --git a/deploy/7-download-release-zip.ps1 b/deploy/8-download-release-zip.ps1 similarity index 71% rename from deploy/7-download-release-zip.ps1 rename to deploy/8-download-release-zip.ps1 index a2c3902955..2508cb2d48 100644 --- a/deploy/7-download-release-zip.ps1 +++ b/deploy/8-download-release-zip.ps1 @@ -1,7 +1,9 @@ param( [string]$password ) - + +. ..\nupkg\common.ps1 + if (!$password) { #reading password from file content @@ -20,11 +22,13 @@ if (!$password) $version = $commonPropsXml.Project.PropertyGroup.Version echo "`n---===[ Current version: $version ]===---" - - +#--------------------------------------------------------------------- +Write-Info "Downloading release zip into Natro" echo "`n---===[ Running SSH commands on NATRO ]===---" - echo "`nDownloading release file into Natro..." + plink.exe -ssh jenkins@94.73.164.234 -pw $password -P 22 -batch "powershell -File c:\ci\scripts\download-latest-abp-release.ps1 ${version}" -echo "`n---===[ COMPLETED ]===---" \ No newline at end of file +Write-Info "Downloading release zip into Natro completed" +echo "`n---===[ COMPLETED ]===---" +#---------------------------------------------------------------------