Skip to content

Commit aacfc21

Browse files
committed
Test CI
1 parent d9ffc13 commit aacfc21

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

ConfluencePS.build.ps1

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -160,36 +160,45 @@ task ConvertMarkdown -Partial @ConvertMarkdown InstallPandoc, {process {
160160
# endregion
161161

162162
# region publish
163-
task Deploy -If (
163+
task Deploy <# -If (
164164
# Only deploy if the master branch changes
165165
$env:APPVEYOR_REPO_BRANCH -eq 'master' -and
166166
# Do not deploy if this is a pull request (because it hasn't been approved yet)
167167
(-not ($env:APPVEYOR_PULL_REQUEST_NUMBER)) -and
168168
# Do not deploy if the commit contains the string "skip-deploy"
169169
# Meant for major/minor version publishes with a .0 build/patch version (like 2.1.0)
170170
$env:APPVEYOR_REPO_COMMIT_MESSAGE -notlike '*skip-deploy*'
171-
) {
172-
Remove-Module ConfluencePS -ErrorAction SilentlyContinue
173-
}, PublishToGallery, UpdateHomepage
171+
) #> PublishToGallery, UpdateHomepage
174172

175173
task PublishToGallery {
176-
assert ($env:PSGalleryAPIKey) "No key for the PSGallery"
174+
# assert ($env:PSGalleryAPIKey) "No key for the PSGallery"
177175

178-
Import-Module $releasePath\ConfluencePS\ConfluencePS.psd1 -ErrorAction Stop
179-
Publish-Module -Name ConfluencePS -NuGetApiKey $env:PSGalleryAPIKey
176+
# Remove-Module ConfluencePS -ErrorAction SilentlyContinue
177+
# Import-Module $releasePath\ConfluencePS\ConfluencePS.psd1 -ErrorAction Stop
178+
# Publish-Module -Name ConfluencePS -NuGetApiKey $env:PSGalleryAPIKey
180179
}
181180

182181
task UpdateHomepage {
183-
exec { git clone https://github.com/AtlassianPS/AtlassianPS.github.io } -ErrorAction SilentlyContinue
184-
Set-Location "AtlassianPS.github.io/"
185-
exec { git submodule foreach git pull origin master }
186-
exec { git add modules/ConfluencePS }
187-
$status = exec { git status -s }
188-
if ($status) {
189-
Write-Warning "Git status: $($status -join ', ')"
182+
try {
183+
# Get the repo of the homepage
184+
exec { git clone https://github.com/AtlassianPS/AtlassianPS.github.io } -ErrorAction SilentlyContinue
185+
Set-Location "AtlassianPS.github.io/"
186+
187+
# Update all submodules
188+
exec { git submodule foreach git pull origin master }
189+
190+
# Check if this repo was changed
191+
$status = exec { git status -s }
192+
if ($status -contains " M modules/ConfluencePS") {
193+
# Update the repo in the homepage repo
194+
exec { git add modules/ConfluencePS }
195+
exec { git commit -m "Update module ConfluencePS" } -ErrorAction SilentlyContinue
196+
exec { git push }
197+
}
198+
}
199+
catch {
200+
throw "Failed to updated the website"
190201
}
191-
exec { git commit -m "Update module ConfluencePS" } -ErrorAction SilentlyContinue
192-
exec { git push }
193202
}
194203
# endregion
195204

0 commit comments

Comments
 (0)