-
Notifications
You must be signed in to change notification settings - Fork 221
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 #23 from Ben-m-s/develop
New build process and folder renaming among other changes
- Loading branch information
Showing
156 changed files
with
4,329 additions
and
722 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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
sitecore/*/*.zip | ||
license.xml | ||
*-Local.ps1 | ||
Files/ | ||
Files/ | ||
*.zip | ||
Assets/ | ||
ExternalAssets/ | ||
.vs/ |
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,48 @@ | ||
**CREDITS** | ||
|
||
Below is a list of people which contributions in the community have be helpful for this repository to progress. | ||
|
||
**Per Bering**: One of the first promoters of Docker for Sitecore. He is a major contributor to this repository, and actively helps peers with Docker related matters on different channels. | ||
https://github.com/sitecore/docker-images | ||
https://github.com/Sitecore/docker-demo | ||
https://github.com/pbering/SitecoreContainers | ||
https://github.com/sitecoreops/sitecore-images | ||
https://github.com/pbering/sitecore-nine-docker | ||
https://github.com/pbering/SockerVS2017 | ||
https://github.com/pbering/solrwin | ||
|
||
**Joost Meijles (Aviva Solutions)**: His contributions in GitHub have been a source of inspiration. He is also active in community discussions about using Docker with Sitecore. | ||
https://github.com/avivasolutionsnl/sitecore-commerce-docker | ||
https://github.com/joostmeijles/sitecore-commerce-docker | ||
https://github.com/avivasolutionsnl/sitecore-docker | ||
https://github.com/sitecoreops/sitecore-images | ||
|
||
|
||
**Benjamin Moles Segovia (ClearPeople)**: He is a major contributor on the two official Sitecore's Docker related repositories on GitHub. | ||
https://github.com/Ben-m-s/Bendev.Assets.Management | ||
https://github.com/sitecore/docker-images | ||
https://github.com/Sitecore/docker-demo | ||
|
||
**Jonne Kats**: His contributions in GitHub have been a source of inspiration. | ||
https://github.com/avivasolutionsnl/sitecore-commerce-docker | ||
https://github.com/avivasolutionsnl/sitecore-docker | ||
|
||
**Richard Brisley**: His repository was very useful to create the first XPSingle version. | ||
https://bitbucket.org/sagittarius_rbrisley/sitecore-commerce-docker-xp0.git | ||
|
||
**Mikkel Valentin Sørensen**: He contributed to the repository that was used as seed of the current Sitecore/docker-images repository. | ||
https://github.com/sitecoreops/sitecore-images | ||
|
||
**Jeremy Davis**: His PowerShell script to install SOLR was used in the Sitecore Docker images. | ||
https://gist.github.com/jermdavis/8d8a79f680505f1074153f02f70b9105 | ||
|
||
**Kam Figy**: His PowerShell script to setup SSL was used in the Sitecore Docker images. | ||
https://gist.github.com/kamsar/c3c8322c1ec40eac64c7dd546e5124de#file-anexample-ps1 | ||
|
||
**Warren Frame**: Code used to prioritise docker images in the build process, based on their dependencies between each other | ||
https://github.com/RamblingCookieMonster/PSDepend/ | ||
|
||
**Gabe Streza**: His PowerShell script to validate Sitecore pre-requisites was used during some developments. | ||
http://www.sitecoregabe.com/2018/04/sitecore-9-machine-prerequisites-check.html | ||
|
||
|
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
88 changes: 88 additions & 0 deletions
88
modules/Sitecore.DockerImages.Management/Functions/Get-ImageBuildFolders.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
function Get-ImageBuildFolders { | ||
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory = $true)] | ||
[ValidateScript( {Test-Path $_ -PathType 'Container'})] | ||
[string]$BuildRootPath, | ||
[Parameter(Mandatory = $true)] | ||
[ValidateNotNullOrEmpty()] | ||
[string]$VersionsFilter, | ||
[Parameter(Mandatory = $true)] | ||
[ValidateScript( {Test-Path $_ -PathType 'Container'})] | ||
[string]$AssetsSourcePath, | ||
[Parameter(Mandatory = $false)] | ||
[ValidateScript( {$_ -eq $null -Or (Test-Path $_ -PathType 'Container')})] | ||
[string]$AssetsTransformPath, | ||
[Parameter(Mandatory = $true)] | ||
[ValidateNotNullOrEmpty()] | ||
[string]$Registry | ||
) | ||
if ([String]::IsNullOrWhiteSpace($AssetsTransformPath)){ | ||
$AssetsTransformPath = $AssetsSourcePath; | ||
} | ||
$versionFolderPaths = Get-ChildItem -Path $BuildRootPath -Filter 'build.json' -Recurse | Select-Object -ExpandProperty Directory | Select-Object -ExpandProperty FullName -Unique | Select-String -Pattern $VersionsFilter | ||
if ($versionFolderPaths){ | ||
|
||
Get-Item -LiteralPath $versionFolderPaths | Foreach-Object { | ||
$imageFolder = $_ | ||
$buildFilePath = Join-Path $imageFolder.FullName "\build.json" | ||
|
||
if (Test-Path $buildFilePath -PathType Leaf) { | ||
$data = Get-Content -Path $buildFilePath | ConvertFrom-Json | ||
$assets = [Asset]::ParseArray(@($data.assets)) | ||
|
||
# Build up tag to use | ||
$repository = $data.repository | ||
$tags = $data.tags | ||
$mainTag = "{0}/{1}:{2}" -f $Registry, $repository, $tags[0] | ||
$baseImage = '<None>' | ||
if ($data.args) { | ||
$args = $data.args | ||
$args.PSobject.Properties | ForEach-Object { | ||
if ($_.value -is [string]) { | ||
$_.value = $_.value.Replace('${Registry}', $Registry) | ||
} | ||
} | ||
$baseImage = $args.PSobject.Properties | ForEach-Object { if ($_.name -match "BASE_IMAGE") {Write-Output $_.value}} | ||
} | ||
|
||
$baseImages = Get-ChildItem -Path $imageFolder.FullName -Filter "Dockerfile" | Foreach-Object { | ||
$dockerfilePath = $_.FullName | ||
$fromClauses = Get-Content -Path $dockerfilePath | Where-Object { $_.StartsWith("FROM ") } | ||
|
||
$fromClauses | ForEach-Object { | ||
$image = $_ | ||
|
||
if ($image -like "* as *") { | ||
$image = $image.Substring(0, $image.IndexOf(" as ")) | ||
} | ||
|
||
if ([string]::IsNullOrEmpty($image)) { | ||
throw ("Invalid dockerfile '{0}', FROM image could not be read." -f $dockerfilePath) | ||
} | ||
|
||
#$image = $image.Replace('${BASE_IMAGE}', $baseImage) | ||
|
||
Write-Output $image | ||
} | ||
} | ||
$baseImages = $baseImages | Select-Object -Unique | ForEach-Object { Write-Output $_.Replace("FROM ", "").Trim() } | ForEach-Object { Write-Output $_.Replace('${BASE_IMAGE}', $baseImage) } | ||
|
||
Write-Output (New-Object PSObject -Property @{ | ||
Repository = $repository; | ||
Tags = $tags; | ||
Args = $args; | ||
MainTag = $mainTag; | ||
Memory = $data.memory; | ||
Path = $imageFolder.FullName; | ||
BaseImages = $baseImages; | ||
Assets = $assets; | ||
}) | ||
} | ||
else { | ||
throw ("Invalid version folder '{0}', file not found: '{1}'." -f $imageFolder.Name, $buildFilePath) | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.