-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Invoke-Build script and updated documentation
- Loading branch information
Showing
8 changed files
with
104 additions
and
16 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
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,5 +1,5 @@ | ||
# Components | ||
|
||
- Debian Linux v11.3.0 | ||
- containerd.io v1.6.4-1 | ||
- containerd.io v1.6.6 | ||
- kubelet, kubectl, kubeadm (appropriate versions) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh -eu | ||
|
||
if [ "$(id -ur)" -ne "0" ]; then | ||
echo "$0 can only be run as root. Use sudo." | ||
exit 1 | ||
fi | ||
|
||
cat > /etc/kutti-release <<EOF_RELEASESTAMP | ||
Kutti Hyper-V Image Version: ${VM_VERSION} | ||
Debian Linux Version: $(cat /etc/debian_version) | ||
Containerd Version: $(containerd -v | cut -f3 -d " ") | ||
Kubernetes Version: $(kubectl version --client -o yaml | grep "gitVersion" | cut -f2 -d ":") | ||
EOF_RELEASESTAMP |
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,61 @@ | ||
Param( | ||
$VersionMajor = (property VERSION_MAJOR 0), | ||
$VersionMinor = (property VERSION_MINOR 1), | ||
$BuildNumber = (property BUILD_NUMBER 0), | ||
$PatchString = (property PATCH_NUMBER ""), | ||
$OSISOPath = (property OS_ISO_PATH "iso/debian-11.3.0-amd64-netinst.iso"), | ||
$OSISOChecksum = (property OS_ISO_CHECKSUM "md5:e7a5a4fc5804ae65f7487e68422368ad"), | ||
$KubeVersion = (property KUBE_VERSION "") | ||
) | ||
|
||
$VersionString = "$($VersionMajor).$($VersionMinor).$($BuildNumber)$($PatchString)" | ||
If ($KubeVersion -eq "") { | ||
$KubeVersionDescription = "latest" | ||
} Else { | ||
$KubeVersionDescription = $KubeVersion | ||
} | ||
|
||
|
||
$VMDescription = @" | ||
Kutti Hyper-V Image version: $($VersionString) | ||
Debian base image: $($OSISOPath) | ||
Kubernetes version: $($KubeVersionDescription) | ||
"@ | ||
|
||
# Synopsis: Show usage | ||
task . { | ||
Write-Host "Usage: Invoke-Build step1|step2|clean-step1|clean-step2|clean" | ||
} | ||
|
||
# Synopsis: Build debian base image | ||
task step1 -Outputs "output-kutti-base/Virtual Machines/box.xml" -Inputs kutti.step1.pkr.hcl { | ||
exec { | ||
packer build -var "iso-url=$($OSISOPath)" -var "iso-checksum=$($OSISOChecksum)" $Inputs | ||
} | ||
} | ||
|
||
# Synopsis: Build kutti image | ||
task step2 -Outputs "output-kutti-hyperv/Virtual Hard Disks/kutti-base.vhdx" -Inputs kutti.step2.pkr.hcl, "output-kutti-base/Virtual Machines/box.xml" { | ||
Write-Host "Building..." | ||
Write-Host $VMDescription | ||
exec { | ||
packer build -var "vm-version=$($VersionString)" -var "kube-version=$($KubeVersion)" kutti.step2.pkr.hcl | ||
} | ||
} | ||
|
||
# Synopsis: Build everything | ||
task all step1, step2 | ||
|
||
# Synopsis: Delete built debian base image | ||
task clean-step1 { | ||
Remove-Item -Recurse -Force output-kutti-base | ||
} | ||
|
||
# Synopsis: Delete built kutti image | ||
task clean-step2 { | ||
Remove-Item -Recurse -Force output-kutti-hyperv | ||
} | ||
|
||
# Synopsis: Delete all output | ||
task clean clean-step2, clean-step1 |
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