Skip to content

Commit

Permalink
#369 - PowerShell script for building and pushing docker image.
Browse files Browse the repository at this point in the history
  • Loading branch information
maraf committed Oct 5, 2021
1 parent c155d60 commit 83f03bd
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tools/Build-Docker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Example: .\tools\Pack-Patch.ps1 v338.7
param(
[Parameter(Mandatory=$true)][string]$versionName,
[Parameter(Mandatory=$false)][switch]$push
)

# VersionName is required.
if ($null -eq $versionName)
{
Write-Output "Missing required 'versionName' parameter.";
return;
}

Push-Location $PSScriptRoot;

# Update version file.
Invoke-Expression ".\Update-Version.ps1 $versionName";

$versionName = $versionName.Substring(1);
$tagName = "neptuo/is4wfw:$versionName";

# Build docker image
Invoke-Expression "docker build .. -f ..\docker\is4wfw\dockerfile -t $tagName";

Write-Host "Docker image built and tagged as '$tagName'.";

if ($push) {
Invoke-Expression "docker push $tagName";
Write-Host "Docker image pushed.";
}

Pop-Location;

0 comments on commit 83f03bd

Please sign in to comment.