Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit fdaf1c7

Browse files
Merge pull request #12 from SubPointSolutions/beta
additional CRM and SQL Server resources
2 parents 0cdf0f9 + 77dca6c commit fdaf1c7

26 files changed

+963
-178
lines changed

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
3+
# packer
4+
**/packer_cache/**/*
5+
**/packer_builds/**/*
6+
**/packer_boxes/**/*
7+
**/packer/build/**/*
8+
9+
# vagrant
10+
**/.vagrant/**/*
11+
**/.vagrant.d/**/*
12+
13+
# puppet
14+
**/puppet/ssl/**/*
15+
16+
# kitchen
17+
**/.kitchen/**/*
18+
19+
**/.uplift.vagrant.yaml
20+
21+
uplift-download/repo
22+
23+
gocd/server/godata
24+
uplift-download/uplift-repository
25+
26+
node_modules
27+
**/.build/**/*
28+
.build
29+
30+
**/*.gem
31+
uplift-packer\packer\packer_templates
32+
33+
uplift-packer/packer-ci-build/**/*
34+
uplift-vagrant/vagrant-uplift/Gemfile.lock
35+
36+
Gemfile.lock
37+
38+
# all build folders
39+
build-*
40+
41+
# all output folders
42+
output
43+
44+
# all uplift local repositories
45+
uplift-local-repository
46+
uplift-local-resources

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ This repository contains reusable PowerShell modules used in the uplift project.
33

44
The uplift project offers consistent Packer/Vagrant workflows and Vagrant boxes specifically designed for SharePoint professionals. It heavy lifts low-level details of the creation of domain controllers, SQL servers, SharePoint farms and Visual Studio installs by providing a codified workflow using Packer/Vagrant tooling.
55

6+
## Build status
7+
| Branch | Status |
8+
| ------------- | ------------- |
9+
| master| [![Build status](https://ci.appveyor.com/api/projects/status/4khhqjvhbscpt3qc/branch/master?svg=true)](https://ci.appveyor.com/project/SubPointSupport/uplift-powershell/branch/master) |
10+
| beta | [![Build status](https://ci.appveyor.com/api/projects/status/4khhqjvhbscpt3qc/branch/beta?svg=true)](https://ci.appveyor.com/project/SubPointSupport/uplift-powershell/branch/beta) |
11+
| dev | [![Build status](https://ci.appveyor.com/api/projects/status/4khhqjvhbscpt3qc/branch/dev?svg=true)](https://ci.appveyor.com/project/SubPointSupport/uplift-powershell/branch/dev) |
612
## How this works
713
The uplift project is split into several repositories to address particular a piece of functionality:
814

_shared/.build.ps1

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ task UnitTest {
5050
Write-Build Green " [~] Unit testing..."
5151

5252
exec {
53-
pwsh -c 'Invoke-Pester ./tests/unit* -EnableExit'
53+
if($null -ne $script:PS6 ) {
54+
pwsh -c 'Invoke-Pester ./tests/unit* -EnableExit'
55+
} else {
56+
Write-Build Green " [~] Using PowerShell"
57+
powershell -c 'Invoke-Pester ./tests/unit* -EnableExit'
58+
}
5459
}
5560
}
5661

@@ -60,7 +65,13 @@ task IntegrationTest {
6065
Write-Build Green " [~] Integration testing..."
6166

6267
exec {
63-
pwsh -c 'Invoke-Pester ./tests/integration* -EnableExit'
68+
if($null -ne $script:PS6 ) {
69+
Write-Build Green " [~] Using PS6"
70+
pwsh -c 'Invoke-Pester ./tests/integration* -EnableExit'
71+
} else {
72+
Write-Build Green " [~] Using PowerShell"
73+
powershell -c 'Invoke-Pester ./tests/integration* -EnableExit'
74+
}
6475
}
6576
}
6677

@@ -77,8 +88,8 @@ task PrepareModule {
7788

7889
# Synopsis: Versions package with giving or timestamped value
7990
task VersionModule {
80-
$dateStamp = Get-Date -f "yyyyMMdd"
81-
$timeStamp = Get-Date -f "HHmmss"
91+
$dateStamp = [System.DateTime]::UtcNow.ToString("yyyyMMdd")
92+
$timeStamp = [System.DateTime]::UtcNow.ToString("HHmmss")
8293

8394
$stamp = "$dateStamp.$timeStamp"
8495

@@ -93,9 +104,25 @@ task VersionModule {
93104
# PowerShell does not allow string value in the Version
94105
# It seems to map to .NET Version object, so no -alpha/-beta tags
95106
# $script:Version = "0.1.0-alpha$stamp"
96-
97-
$script:Version = "0.1.$stamp"
98107

108+
$script:Version = "0.1.$stamp"
109+
110+
if($null -ne $env:APPVEYOR_REPO_BRANCH) {
111+
Write-Build Green " [~] Running under APPVEYOR branch: $($env:APPVEYOR_REPO_BRANCH)"
112+
113+
if($env:APPVEYOR_REPO_BRANCH -ine "beta" -and $env:APPVEYOR_REPO_BRANCH -ine "master") {
114+
Write-Build Green " skipping APPVEYOR versioning for branch: $($env:APPVEYOR_REPO_BRANCH)"
115+
} else {
116+
Write-Build Green " using APPVEYOR versioning for branch: $($env:APPVEYOR_REPO_BRANCH)"
117+
118+
## 1902.build-no
119+
$stamp = [System.DateTime]::UtcNow.ToString("yyMM")
120+
$buildNumber = $env:APPVEYOR_BUILD_NUMBER;
121+
122+
$script:Version = "0.2.$stamp.$buildNumber"
123+
}
124+
}
125+
99126
if($null -ne $buildVersion ) {
100127
Write-Build Yello " [+] Using version from params: $buildVersion"
101128
$script:Version = $buildVersion
@@ -141,19 +168,19 @@ task BuildModule {
141168

142169
# Synopsis: Installes a PowerShell module
143170
task InstallModule {
144-
171+
145172
Write-Build Green "[~] ensuring repository: $devRepositoryName"
146173
New-UpliftPSRepository $devRepositoryName `
147174
$moduleRepositoryFolder `
148175
$moduleRepositoryFolder
149-
176+
150177
Write-Build Green " [+] Fetching repo: $devRepositoryName"
151178
Get-PSRepository $devRepositoryName
152179

153180
Write-Build Green " [~] Find-Module -Name $moduleName"
154181
Find-Module -Name $moduleName -Repository $devRepositoryName
155182

156-
Write-Build Green " [~] Install-Module -Name $moduleName -Force"
183+
Write-Build Green " [~] Install-Module -Name $moduleName -Repository $devRepositoryName -Force"
157184
Install-Module -Name $moduleName -Repository $devRepositoryName -Force
158185

159186
Write-Build Green " [~] Get-InstalledModule -Name $moduleName"
@@ -189,6 +216,27 @@ task ValidateInstalledModule {
189216
# Synopsis: Publishes module to the giving repository
190217
task PublishModule {
191218

219+
if($null -ne $env:APPVEYOR_REPO_BRANCH) {
220+
Write-Build Green " [~] Running under APPVEYOR branch: $($env:APPVEYOR_REPO_BRANCH)"
221+
222+
if($env:APPVEYOR_REPO_BRANCH -ine "dev" -and $env:APPVEYOR_REPO_BRANCH -ine "beta" -and $env:APPVEYOR_REPO_BRANCH -ine "master") {
223+
Write-Build Green " skipping publishing for branch: $($env:APPVEYOR_REPO_BRANCH)"
224+
return;
225+
}
226+
227+
$repoNameEnvName = ("SPS_REPO_NAME_" + $env:APPVEYOR_REPO_BRANCH)
228+
$repoSrcEnvName = ("SPS_REPO_SRC_" + $env:APPVEYOR_REPO_BRANCH)
229+
$repoPushEnvName = ("SPS_REPO_PUSH_" + $env:APPVEYOR_REPO_BRANCH)
230+
$repoKeyEnvName = ("SPS_REPO_KEY_" + $env:APPVEYOR_REPO_BRANCH)
231+
232+
$publishRepoName = (get-item env:$repoNameEnvName).Value;
233+
234+
$publishRepoSourceLocation = (get-item env:$repoSrcEnvName).Value;
235+
$publishRepoPublishLocation = (get-item env:$repoPushEnvName).Value;
236+
237+
$publishRepoNuGetApiKey = (get-item env:$repoKeyEnvName).Value;
238+
}
239+
192240
Confirm-Variable "publishRepoName" $publishRepoName "publishRepoName"
193241

194242
Confirm-Variable "publishRepoSourceLocation" $publishRepoSourceLocation "publishRepoSourceLocation"
@@ -221,6 +269,11 @@ task PublishModule {
221269
Write-Build Green "Completed!"
222270
}
223271

272+
# Synopsis: Executes Appveyor specific setup
273+
task AppveyorPrepare {
274+
npm install http-server -g
275+
}
276+
224277
# Synopsis: Runs PSScriptAnalyzer
225278
task AnalyzeModule {
226279
exec {
@@ -251,4 +304,7 @@ task . DefaultBuild
251304
task QA AnalyzeModule, DefaultBuild, IntegrationTest
252305

253306
# Synopsis: Default module publishing task
254-
task ReleaseModule AnalyzeModule, DefaultBuild, IntegrationTest, PublishModule
307+
task ReleaseModule AnalyzeModule, DefaultBuild, IntegrationTest, PublishModule
308+
309+
task Appveyor AppveyorPrepare,
310+
ReleaseModule

appveyor.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
test: off
2+
3+
build_script:
4+
- ps: Install-Module -Name InvokeBuild -Force
5+
- ps: pwsh -c Install-Module -Name InvokeBuild -Force
6+
- ps: cd $env:APPVEYOR_BUILD_FOLDER/invoke-uplift; pwsh -c invoke-build Appveyor
7+
- ps: cd $env:APPVEYOR_BUILD_FOLDER/uplift.core; powershell -c invoke-build Appveyor

invoke-uplift/.build.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ $moduleName = "InvokeUplift"
2020
. "$dirPath/../_shared/.build-helpers.ps1"
2121
. "$dirPath/../_shared/.build.ps1"
2222

23+
$script:PS6 = $true;
24+
2325
task PrepareResourceFiles -After PrepareModule {
2426

2527
New-Item "$moduleFolder/$moduleName/resource-files" -ItemType directory -Force | Out-Null

invoke-uplift/src/Invoke-Uplift-ActionResourceDownload.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ function Write-LatestMetadata($resourceContainer, $customFileName) {
4444
$metadata | Add-Member -Name 'file_name' `
4545
-Type NoteProperty -Force -Value $fileName
4646

47+
$metadata | Add-Member -Name 'metadata' `
48+
-Type NoteProperty -Force -Value $resourceContainer.ResourceMetadata
49+
4750
# checksum file always follows name convention:
4851
# "file-name.extention" + ".sha256"
4952
# we should not even expose it here
@@ -99,6 +102,7 @@ function Get-ResourceContainer($resource, $dstDir, $force = $false) {
99102

100103
$container = New-Object PsObject -Property @{
101104
Resource = $resource
105+
ResourceMetadata = $resource.metadata
102106

103107
ResourceId = $id
104108
ResourceType = Get-ResourceType $resource
@@ -114,8 +118,8 @@ function Get-ResourceContainer($resource, $dstDir, $force = $false) {
114118
StagingDirPath = (Join-Path -Path $resourceDir -ChildPath "download-staging")
115119
StagingFilePath = (Join-Path -Path $resourceDir -ChildPath "download-staging" -AdditionalChildPath $resourceFileName)
116120

117-
CacheDirPath = (Join-Path -Path $resourceDir -ChildPath "download-cache")
118-
CacheFilePath = (Join-Path -Path $resourceDir -ChildPath "download-cache" -AdditionalChildPath $resourceFileName)
121+
CacheDirPath = (Join-Path -Path $resourceDir -ChildPath "cache")
122+
CacheFilePath = (Join-Path -Path $resourceDir -ChildPath "cache" -AdditionalChildPath $resourceFileName)
119123

120124
ResourceDirPath = $resourceDir
121125
DestinationPath = $dstDir
@@ -171,7 +175,7 @@ function Invoke-ResourceFolderDownload($resourceContainer, $src, $dst) {
171175
Write-DebugMessage " -dst: $dst"
172176

173177
# download
174-
$preferredTool = Get-CommandOptionValue @("-t", "-tool") $null "wget"
178+
$preferredTool = Get-CommandOptionValue @("-t", "-tool") $null $null
175179
Invoke-DownloadFile `
176180
$src `
177181
$dst `

invoke-uplift/src/Invoke-Uplift-ActionResourceDownloadLocal.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function Get-LocalResourceContainer($resourceId, $dstDir, $force = $false) {
3535

3636
Metadata = $null
3737

38-
CacheDirPath = (Join-Path -Path $resourceDir -ChildPath "download-cache")
38+
CacheDirPath = (Join-Path -Path $resourceDir -ChildPath "cache")
3939

4040
LocalRepositoryPath = $dstDir
4141
ResourceDirPath = $resourceDir
@@ -132,7 +132,7 @@ function Invoke-LocalStagingDownload($resourceContainer) {
132132
Write-InfoMessage "[~] checking if /download-staging is OK"
133133
$result = Confirm-LocalFileValidity $resourceContainer.StagingFilePath
134134

135-
$preferredTool = Get-CommandOptionValue @("-t", "-tool") $null "wget"
135+
$preferredTool = Get-CommandOptionValue @("-t", "-tool") $null $null
136136

137137
if($result -eq $False) {
138138
Write-InfoMessage "[~] downloading files..."

invoke-uplift/src/Invoke-Uplift-ActionResourceDownloadVS17.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,16 @@ function Invoke-DownloadResourceVS17Dist ($resourceContainer, $vsClientPath) {
131131

132132
Write-InfoMessage "[~] ensuring vs layour folder"
133133
$vsClientPath = $resourceContainer.CacheFilePath
134-
$layoutFolderPath = Join-Path -Path $resourceContainer.CacheDirPath -ChildPath "vs17-layout"
134+
$layoutFolderPath = Join-Path -Path $resourceContainer.CacheDirPath -ChildPath "vs17"
135+
136+
if($layoutFolderPath.Length -gt 80) {
137+
138+
$help = "error 5007 when trying to install Visual Studio 2017 15.5.7 from offline layout folder - https://developercommunity.visualstudio.com/content/problem/292951/error-5007-when-trying-to-install-visual-studio-20.html"
139+
$err = "Layout folder for VS17 is greater than 80 chars! - $help"
140+
141+
Write-ErrorMessage $err
142+
throw $err
143+
}
135144

136145
New-Folder $layoutFolderPath
137146

invoke-uplift/src/Invoke-Uplift-HTTP.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,16 @@ function Invoke-DownloadFile($src, $dst, $preferredTool = $null) {
181181
if( $tools.wget.IsAvailable -eq $True) {
182182
Invoke-DownloadFileAsWget $tools.wget $src $dst
183183
return
184+
} else {
185+
Write-DebugMessage "wget is not here, fallback: wget -> curl -> InvokeWebRequest"
184186
}
185187

186188
# is curl available?
187189
if( $tools.curl.IsAvailable -eq $True) {
188190
Invoke-DownloadFileAsCurl $tools.curl $src $dst
189191
return
192+
} else {
193+
Write-DebugMessage "curl is not here, fallback: wget -> curl -> InvokeWebRequest"
190194
}
191195

192196
# default is Invoke-WebRequest

invoke-uplift/src/InvokeUplift.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@
106106
)
107107

108108
#A URL to the license for this module.
109-
LicenseUri = 'https://github.com/SubPointSolutions/invoke-uplift'
109+
LicenseUri = 'https://github.com/SubPointSolutions/uplift-powershell'
110110

111111
#A URL to the main website for this project.
112-
ProjectUri = 'https://github.com/SubPointSolutions/invoke-uplift'
112+
ProjectUri = 'https://github.com/SubPointSolutions/uplift-powershell'
113113

114114
#A URL to an icon representing this module.
115115
IconUri = ''

invoke-uplift/src/resource-files/ms-dynamics-crm.resource.json

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"resources": [
3+
4+
{
5+
"id": "ms-dynamics-crm2016-server-lang-pack-sv",
6+
"uri": "https://download.microsoft.com/download/1/F/7/1F7CBA49-5C7B-492A-982A-8D26B9608399/CRM2016-Mui-SVE-amd64.exe",
7+
8+
"checksum": "6E6291E25C676D862435A61E6BBD7408DDB382CB8B35514E9D3AD490D666BF08",
9+
"checksum_type": "sha256",
10+
11+
"metadata": {
12+
"identifyingNumber": "0C524DC1-141D-0080-8121-88490F4D5549",
13+
"languageCode": "1053"
14+
}
15+
},
16+
17+
{
18+
"id": "ms-dynamics-crm2016-server-lang-pack-ru",
19+
"uri": " https://download.microsoft.com/download/6/E/0/6E073DDF-613C-49CA-BB93-7BD6579B368C/CRM2016-Mui-RUS-amd64.exe",
20+
21+
"checksum": "9C1176CFD8AB5CEF109C6A00646B2D1F93BDC8186A02DC2BEA569A560F7CC85D",
22+
"checksum_type": "sha256",
23+
24+
"metadata": {
25+
"identifyingNumber": "0C524DC1-1419-0080-8121-88490F4D5549",
26+
"languageCode": "1049"
27+
}
28+
}
29+
30+
]
31+
}

0 commit comments

Comments
 (0)