-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from RWS/develop
Develop
- Loading branch information
Showing
202 changed files
with
12,085 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:3.1-bionic | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get --yes install git && apt-get -f install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Automation/Modules/SDLDevTools/0.3/Get-SDLOpenSourceHeaderFormat.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Automation/Modules/SDLDevTools/0.3/Test-SDLOpenSourceHeader.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env groovy | ||
|
||
def pwsh(command) { | ||
println 'About to run pwsh Command' | ||
println '---------------------------------------------------' | ||
println command | ||
println '---------------------------------------------------' | ||
|
||
def filename = UUID.randomUUID().toString() + '.ps1' | ||
writeFile file: filename, text: command | ||
// CLIXML output --> https://github.com/PowerShell/PowerShell/issues/5912 | ||
sh "pwsh -NonInteractive -NoProfile -OutputFormat Text -Command \" & './${filename}' \"" | ||
} | ||
|
||
pipeline { | ||
options { | ||
buildDiscarder(logRotator(numToKeepStr: '5')) | ||
durabilityHint('PERFORMANCE_OPTIMIZED') | ||
timeout(time: 1, unit: 'HOURS') | ||
} | ||
|
||
agent { | ||
dockerfile { | ||
dir 'Automation' | ||
filename 'Dockerfile' | ||
label 'docker' | ||
args '-u root' | ||
} | ||
} | ||
|
||
triggers { | ||
cron('H 2 * * *') | ||
} | ||
|
||
parameters { | ||
choice(choices: ['Nexus', 'PSGallery'], description: 'Select the repository the modules should be published to: Nexus(.sdl.com) or PSGallery', name: 'Repository') | ||
} | ||
|
||
stages { | ||
stage('Publish the ISHBootstrap Module') { | ||
when { | ||
beforeAgent true | ||
anyOf { | ||
triggeredBy cause: 'UserIdCause'; | ||
triggeredBy cause: 'TimerTriggerCause'; | ||
} | ||
} | ||
steps { | ||
wrap([$class: 'BuildUser']) { | ||
withCredentials([string(credentialsId: "NexusApiKey", variable: "APIKEY")]) { | ||
pwsh "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; & ./Automation/Publish-ISHBootstrapModule.ps1 -Repository '${params.Repository}'" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
script { | ||
currentBuild.result = currentBuild.result ?: 'SUCCESS' | ||
notifyBitbucket() | ||
} | ||
} | ||
cleanup { | ||
sh 'chmod -R 777 .' | ||
deleteDir() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<# | ||
.Synopsis | ||
Publish the ISHBootstrap powershell module to one of the supported repositories | ||
.DESCRIPTION | ||
Publish the ISHBootstrap powershell module to one of the supported repositories | ||
#> | ||
[CmdletBinding(SupportsShouldProcess = $true)] | ||
param( | ||
[Parameter(Mandatory = $true)] | ||
[ValidateSet("Nexus", "PSGallery")] | ||
[string]$Repository, | ||
[Parameter(Mandatory = $false)] | ||
[switch]$PreRelease = $false #Future usage, to support pubishing prerelase versions to e.g. PSGallery (and Nexus?) | ||
) | ||
|
||
if ($PSBoundParameters['Debug']) { | ||
$DebugPreference = 'Continue' | ||
} | ||
|
||
Write-Debug "PSCmdlet.ParameterSetName=$($PSCmdlet.ParameterSetName)" | ||
foreach ($psbp in $PSBoundParameters.GetEnumerator()) { Write-Debug "$($psbp.Key)=$($psbp.Value)" } | ||
|
||
$publishModulePath = "$PSScriptRoot" | ||
|
||
switch ($Repository) { | ||
"Nexus" { | ||
Write-Host "Register the $Repository repository if needed" | ||
Get-PSRepository -WarningAction SilentlyContinue | Where-Object { $_.Name -eq $Repository } | Unregister-PSRepository | ||
|
||
$psRepositoryHashSDLNexus = @{ | ||
SourceLocation = "https://nexus.sdl.com/service/local/nuget/releases_powershell/" | ||
PublishLocation = "https://nexus.sdl.com/service/local/nuget/releases_powershell/" | ||
InstallationPolicy = "Trusted" | ||
} | ||
Register-PSRepository @psRepositoryHashSDLNexus -Name $Repository | ||
|
||
$RepositoryToPublish = $Repository | ||
$ApiKey = "$env:APIKEY" | ||
|
||
# Install the required dependend modules otherwise Test-ModuleManifest fails (https://github.com/PowerShell/PowerShell/issues/7722) | ||
& $publishModulePath/../Source/Builders/Default/Install-ISHBootstrapPrerequisites.ps1 -FTP -ISHVersion 14.0.3 | ||
|
||
& $publishModulePath/Publish-Module.ps1 -DevRepository $RepositoryToPublish -NuGetApiKey $ApiKey | ||
break | ||
} | ||
"PSGallery" { | ||
# Explicitely set to $null, Publish-Module is executed with -WhatIf (https://jira.sdl.com/browse/SYS-2796) | ||
Write-Warning "Force omitting NuGetApiKey. Publish-Module will be executed with -WhatIf for PSGallery (See SYS-2796)." | ||
#$ApiKey = "$env:APIKEY_DOCS_PSGALLERY" | ||
$ApiKey = $null | ||
# Install the required dependend modules otherwise Test-ModuleManifest fails (https://github.com/PowerShell/PowerShell/issues/7722) | ||
& $publishModulePath/../Source/Builders/Default/Install-ISHBootstrapPrerequisites.ps1 -FTP -ISHVersion 14.0.3 | ||
|
||
if ($null -eq $ApiKey ) { | ||
& $publishModulePath/Publish-Module.ps1 | ||
} | ||
else { | ||
& $publishModulePath/Publish-Module.ps1 -NuGetApiKey $ApiKey | ||
} | ||
break | ||
} | ||
default { | ||
# Should not happen, because of the ValidateSet on the Repository parameter. | ||
throw "Unsupported Repository used: $Repository" | ||
break | ||
} | ||
} |
Oops, something went wrong.