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

Commit d861e70

Browse files
author
Mano Marks
authored
Merge pull request #10 from ManoMarks/master
Added support for copying iis configuration files
2 parents 526d5d3 + e4bf43b commit d861e70

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Artifacts/IIS/Generate.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ $Manifest = '{0}\{1}.json' -f $ManifestPath, $ArtifactName
1919
$Artifact = Get-Content -Path $Manifest -Raw | ConvertFrom-Json
2020

2121
if ($Artifact.Status -eq 'Present') {
22+
Write-Verbose ('Copying {0} configuration files' -f $ArtifactName)
23+
$ConfigPath = $Artifact.Websites.MountPath + "\" + "Windows\System32\inetsrv\config"
24+
Copy-Item $ConfigPath $ManifestPath -Recurse
2225
$Result = '
2326
RUN powershell.exe -ExecutionPolicy Bypass -Command \
2427
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebserverRole, IIS-WebServer, IIS-WebServerManagementTools;'
@@ -30,15 +33,15 @@ RUN powershell.exe -ExecutionPolicy Bypass -Command \
3033
$Result += '\{1}New-Item -Path {0} -ItemType directory; \{1}' -f $Artifact.Websites.PhysicalPath[$i], "`r`n"
3134
$Result += 'New-Website -Name ''{0}'' -PhysicalPath "{1}";' -f ($Artifact.Websites.Name[$i] -replace "'","''"), $Artifact.Websites.PhysicalPath[$i], "`r`n"
3235
Write-Verbose -Message ('Copying files for {0} site' -f $Artifact.Websites.Name[$i])
33-
Copy-Item $SitePath $ManifestPath
34-
$Add += "ADD {0} {1}`r`n" -f (Split-Path $Artifact.Websites.PhysicalPath[$i] -Leaf),$Artifact.Websites.PhysicalPath[$i]
36+
Copy-Item $SitePath $ManifestPath -Recurse
37+
$Add += "ADD {0} {1}`r`n" -f (Split-Path $Artifact.Websites.PhysicalPath[$i] -Leaf),($Artifact.Websites.PhysicalPath[$i] -Replace "\\","/")
3538
}
3639

3740
### Add IIS HTTP handlers to the Dockerfile
3841
foreach ($HttpHandler in $Artifact.HttpHandlers) {
3942
$Result += 'New-WebHandler -Name "{0}" -Path "{1}" -Verb "{2}" \{3}' -f $HttpHandler.Name, $HttpHandler.Path, $HttpHandler.Verb, "`r`n"
4043
}
41-
44+
$Add += "Add config Windows/System32/inetsrv/"
4245
Write-Output -InputObject ($Result + $Add)
4346

4447
}

Image2Docker.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'Image2Docker.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.4'
15+
ModuleVersion = '1.5'
1616

1717
# Supported PSEditions
1818
### NOTE: This module will not work with PowerShell Core.

0 commit comments

Comments
 (0)