Skip to content

Commit

Permalink
Fix CI pipeline
Browse files Browse the repository at this point in the history
fix git commands that would throw and cause the CI to fail
  • Loading branch information
lipkau committed Mar 23, 2018
1 parent f3de4e7 commit a524399
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions ConfluencePS.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -468,32 +468,38 @@ task PublishToGallery {

# Synopsis: Update the HEAD of this git repo in the homepage repository
task UpdateHomepage {
$originalErrorActionPreference = $ErrorActionPreference
try {
$ErrorActionPreference = 'Continue'
# Get the repo of the homepage
exec { git clone https://github.com/AtlassianPS/AtlassianPS.github.io --recursive 2>$null }
git clone https://github.com/AtlassianPS/AtlassianPS.github.io --recursive 2>$null
Write-Host "Cloned"
Set-Location "AtlassianPS.github.io/"

# Update all submodules
exec { git submodule foreach git pull origin master 2>$null }
Write-Host "Fetched"
# git submodule foreach git pull origin master 2>$null
# Write-Host "Fetched"

# Check if this repo was changed
$status = exec { git status -s 2>$null }
$status = git status -s 2>$null
Write-Host $status
if ($status -contains " M modules/$PROJECT_NAME") {
Write-Host "Has changes"
# Update the repo in the homepage repo
exec { git add modules/$PROJECT_NAME 2>$null }
git add modules/$PROJECT_NAME 2>$null
Write-Host "Added"
exec { git commit -m "Update module $PROJECT_NAME" 2>$null }
git commit -m "Update module $PROJECT_NAME" 2>$null
Write-Host "Commited"
exec { git push 2>$null }
git push 2>$null
Write-Host "Pushed"
}
}
catch {
throw $_
}
finally {
$ErrorActionPreference = $originalErrorActionPreference
}
}

# Synopsis: Create a zip package file of the release
Expand Down

0 comments on commit a524399

Please sign in to comment.