Browse Source

Update deploy scripts

pull/10934/head
Alper Ebicoglu 4 years ago
parent
commit
58622ad403
  1. 22
      deploy/1-fetch-and-build.ps1
  2. 8
      deploy/2-nuget-pack.ps1
  3. 10
      deploy/3-nuget-push.ps1
  4. 16
      deploy/4-npm-publish-mvc.ps1
  5. 39
      deploy/5-npm-publish-angular.ps1
  6. 6
      deploy/6-git-commit.ps1
  7. 0
      deploy/7-new-github-release__NOT_ACTIVE_USE_MANUAL_WAY.ps1
  8. 14
      deploy/8-download-release-zip.ps1

22
deploy/1-fetch-and-build.ps1

@ -15,17 +15,23 @@ $currentVersion = $commonPropsXmlCurrent.Project.PropertyGroup.Version.Trim()
if (!$newVersion) 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 if ($newVersion -ne $currentVersion){
$commonPropsXmlCurrent.Project.PropertyGroup.Version = $newVersion # Update common.props for version attribute
$commonPropsXmlCurrent.Save( $commonPropsFilePath ) $commonPropsXmlCurrent.Project.PropertyGroup.Version = $newVersion
#check if it's updated... $commonPropsXmlCurrent.Save( $commonPropsFilePath )
$commonPropsXmlNew = [xml](Get-Content $commonPropsFilePath ) #check if it's updated...
$newVersionAfterUpdate = $commonPropsXmlNew.Project.PropertyGroup.Version $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" echo "`n-----=====[ PULLING ABP REPO - BRANCH: $branch ]=====-----`n"
cd .. cd ..

8
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 cd ..\nupkg
powershell -File pack.ps1 powershell -File pack.ps1
echo "`n-----=====[ CREATING NUGET PACKAGES COMPLETED ]=====-----`n" echo "`n-----=====[ CREATING NUGET PACKAGES COMPLETED ]=====-----`n"
Write-Info "Creating NuGet packages completed"
cd ..\deploy #always return to the deploy directory

10
deploy/3-nuget-push.ps1

@ -2,6 +2,8 @@ param(
[string]$nugetApiKey [string]$nugetApiKey
) )
. ..\nupkg\common.ps1
if (!$nugetApiKey) if (!$nugetApiKey)
{ {
#reading password from file content #reading password from file content
@ -19,9 +21,11 @@ if (!$nugetApiKey)
$nugetApiKey = Read-Host "Enter the NuGet API KEY" $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 cd ..\nupkg
powershell -File push_packages.ps1 $nugetApiKey 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

16
deploy/4-npm-publish.ps1 → deploy/4-npm-publish-mvc.ps1

@ -2,6 +2,8 @@ param(
[string]$npmAuthToken [string]$npmAuthToken
) )
. ..\nupkg\common.ps1
if (!$npmAuthToken) if (!$npmAuthToken)
{ {
#reading password from file content #reading password from file content
@ -21,13 +23,17 @@ if (!$npmAuthToken)
cd ..\npm cd ..\npm
echo "`n-----=====[ SETTING NPM AUTH TOKEN ]=====-----`n" #----------------------------------------------------------------------------
echo "`nSetting npmjs.org auth-token token`n"
npm set //registry.npmjs.org/:_authToken $npmAuthToken npm set //registry.npmjs.org/:_authToken $npmAuthToken
#----------------------------------------------------------------------------
Write-Info "Pushing MVC packages to NPM"
echo "`n-----=====[ PUSHING MVC PACKS TO NPM ]=====-----`n" echo "`n-----=====[ PUSHING MVC PACKS TO NPM ]=====-----`n"
powershell -File publish-mvc.ps1 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" cd ..\deploy #always return to the deploy directory
powershell -File publish-ng.ps1
echo "`n-----=====[ PUSHING PACKS TO NPM COMPLETED ]=====-----`n"

39
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

6
deploy/5-git-commit.ps1 → deploy/6-git-commit.ps1

@ -1,8 +1,14 @@
. ..\nupkg\common.ps1
cd .. cd ..
Write-Info "Committing changes to GitHub"
echo "`n-----=====[ COMMITTING CHANGES ]=====-----`n" echo "`n-----=====[ COMMITTING CHANGES ]=====-----`n"
git add . git add .
git commit -m Update_NPM_Package_Versions git commit -m Update_NPM_Package_Versions
git push git push
echo "`n-----=====[ COMMITTING CHANGES COMPLETED ]=====-----`n" echo "`n-----=====[ COMMITTING CHANGES COMPLETED ]=====-----`n"
Write-Info "Committing changes to GitHub completed"
cd deploy #always return to the deploy directory

0
deploy/6-new-github-release__NOT_ACTIVE_USE_MANUAL_WAY.ps1 → deploy/7-new-github-release__NOT_ACTIVE_USE_MANUAL_WAY.ps1

14
deploy/7-download-release-zip.ps1 → deploy/8-download-release-zip.ps1

@ -1,7 +1,9 @@
param( param(
[string]$password [string]$password
) )
. ..\nupkg\common.ps1
if (!$password) if (!$password)
{ {
#reading password from file content #reading password from file content
@ -20,11 +22,13 @@ if (!$password)
$version = $commonPropsXml.Project.PropertyGroup.Version $version = $commonPropsXml.Project.PropertyGroup.Version
echo "`n---===[ Current version: $version ]===---" echo "`n---===[ Current version: $version ]===---"
#---------------------------------------------------------------------
Write-Info "Downloading release zip into Natro"
echo "`n---===[ Running SSH commands on NATRO ]===---" echo "`n---===[ Running SSH commands on NATRO ]===---"
echo "`nDownloading release file into 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}" 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 ]===---" Write-Info "Downloading release zip into Natro completed"
echo "`n---===[ COMPLETED ]===---"
#---------------------------------------------------------------------
Loading…
Cancel
Save