Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jenkinsci/docker-ssh-agent
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5.24.0
Choose a base ref
...
head repository: jenkinsci/docker-ssh-agent
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: refs/heads/master
Choose a head ref

Commits on Feb 19, 2024

  1. Bump Debian Bookworm Linux version to bookworm-20240211 (#364)

    * chore: Update the value of the base image (ARG DEBIAN_RELEASE) in the...
    
    ...  Dockerfile
    
    Made with ❤️️ by updatecli
    
    * chore: Update the default value of the variable DEBIAN_RELEASE in the...
    
    ...  docker-bake.hcl
    
    Made with ❤️️ by updatecli
    
    ---------
    
    Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Feb 19, 2024
    Copy the full SHA
    b94b5f1 View commit details
  2. chore(deps): bump release-drafter/release-drafter from 5.25.0 to 6.0.0 (

    #363)
    
    Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.25.0 to 6.0.0.
    - [Release notes](https://github.com/release-drafter/release-drafter/releases)
    - [Commits](release-drafter/release-drafter@v5.25.0...v6.0.0)
    
    ---
    updated-dependencies:
    - dependency-name: release-drafter/release-drafter
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 19, 2024
    Copy the full SHA
    b670db0 View commit details
  3. chore(deps): bump updatecli/updatecli-action from 2.54.0 to 2.55.0

    Bumps [updatecli/updatecli-action](https://github.com/updatecli/updatecli-action) from 2.54.0 to 2.55.0.
    - [Release notes](https://github.com/updatecli/updatecli-action/releases)
    - [Commits](updatecli/updatecli-action@v2.54.0...v2.55.0)
    
    ---
    updated-dependencies:
    - dependency-name: updatecli/updatecli-action
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Feb 19, 2024
    Copy the full SHA
    ada2d6e View commit details
  4. Merge pull request #365 from jenkinsci/dependabot/github_actions/mast…

    …er/updatecli/updatecli-action-2.55.0
    
    chore(deps): bump updatecli/updatecli-action from 2.54.0 to 2.55.0
    dduportal authored Feb 19, 2024
    Copy the full SHA
    64d43a1 View commit details

Commits on Feb 26, 2024

  1. Bump Git version on Windows to 2.44.0.windows.1 (#367)

    * chore: Update the Git Windows version for JDK11 Windows Server Core L...
    
    ... TSC2019
    
    Made with ❤️️ by updatecli
    
    * chore: Update the Git Windows version for JDK11 Windows Nanoserver 1809
    
    Made with ❤️️ by updatecli
    
    ---------
    
    Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Feb 26, 2024
    Copy the full SHA
    a093a97 View commit details

Commits on Mar 11, 2024

  1. Copy the full SHA
    b7346c3 View commit details

Commits on Mar 18, 2024

  1. Bump Debian Bookworm Linux version to bookworm-20240311 (#369)

    * chore: Update the default value of the variable DEBIAN_RELEASE in the...
    
    ...  docker-bake.hcl
    
    Made with ❤️️ by updatecli
    
    * chore: Update the value of the base image (ARG DEBIAN_RELEASE) in the...
    
    ...  Dockerfile
    
    Made with ❤️️ by updatecli
    
    ---------
    
    Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Mar 18, 2024
    Copy the full SHA
    2d69ed2 View commit details

Commits on Mar 21, 2024

  1. Copy the full SHA
    7becf2f View commit details

Commits on Mar 22, 2024

  1. feat(updatecli) Re-enable JDK updates

    Updatecli now wants us to get a more precise platform:  `linux/amd64` instead of `amd/64`, `windows/amd64` instead of `amd64`, and so on.
    gounthar committed Mar 22, 2024
    Copy the full SHA
    ca5e349 View commit details
  2. feat(updatecli) Re-enable JDK updates

    Updatecli now wants us to get a more precise platform:  `linux/amd64` instead of `amd/64`, `windows/amd64` instead of `amd64`, and so on.
    gounthar committed Mar 22, 2024
    Copy the full SHA
    146b8a1 View commit details
  3. Copy the full SHA
    8ea88c3 View commit details
  4. Copy the full SHA
    3580296 View commit details
  5. Copy the full SHA
    33aa1b6 View commit details
  6. Copy the full SHA
    3e52df1 View commit details
  7. Merge pull request #371 from gounthar/jdk-updates

    feat(updatecli) Re-enable JDK updates
    dduportal authored Mar 22, 2024
    Copy the full SHA
    393725c View commit details
  8. chore: Bump JDK11 default ARG version on Windows NanoServer Dockerfile

    Made with ❤️️ by updatecli
    github-actions[bot] committed Mar 22, 2024
    Copy the full SHA
    6dac8a7 View commit details
  9. chore: Bump JDK11 version for Linux images in the docker-bake.hcl file

    Made with ❤️️ by updatecli
    github-actions[bot] committed Mar 22, 2024
    Copy the full SHA
    19f26ea View commit details
  10. chore: Bump JDK11 default ARG version on Windows Server Core Dockerfile

    Made with ❤️️ by updatecli
    github-actions[bot] committed Mar 22, 2024
    Copy the full SHA
    00e717c View commit details
  11. chore: Bump JDK17 default ARG version on Debian Dockerfile

    Made with ❤️️ by updatecli
    github-actions[bot] committed Mar 22, 2024
    Copy the full SHA
    fc8bb46 View commit details
  12. chore: Bump JDK17 default ARG version on Alpine Dockerfile

    Made with ❤️️ by updatecli
    github-actions[bot] committed Mar 22, 2024
    Copy the full SHA
    f39be87 View commit details
  13. chore: Bump JDK17 version for Linux images in the docker-bake.hcl file

    Made with ❤️️ by updatecli
    github-actions[bot] committed Mar 22, 2024
    Copy the full SHA
    ccd6a2b View commit details
  14. Merge pull request #373 from jenkinsci/updatecli_master_ede384d7ffd63…

    …1f6a72f5eabdbd0823f5a6eef943223027f02d4ecaec0677c0e
    
    Bump JDK11 version to 11.0.22_7
    dduportal authored Mar 22, 2024
    Copy the full SHA
    1af5d3b View commit details
  15. Merge pull request #374 from jenkinsci/updatecli_master_6c4048cdd93e1…

    …4efa20a546c382ac7904426124d2de704e33ead280679c267a3
    
    Bump JDK17 version to 17.0.10_7
    dduportal authored Mar 22, 2024
    Copy the full SHA
    e6bf13f View commit details

Commits on Mar 25, 2024

  1. chore: Updates bats version in the Makefile

    Made with ❤️️ by updatecli
    github-actions[bot] committed Mar 25, 2024
    Copy the full SHA
    801cb17 View commit details
  2. Merge branch 'master' into updatecli_master_9f664485b4f41bedae50aa205…

    …de10aba67434e12e42af3134f4acf47c4de4012
    lemeurherve authored Mar 25, 2024
    Copy the full SHA
    04041ff View commit details
  3. Merge pull request #378 from jenkinsci/updatecli_master_9f664485b4f41…

    …bedae50aa205de10aba67434e12e42af3134f4acf47c4de4012
    
    chore(tests): Bump `bats` version to v1.11.0
    dduportal authored Mar 25, 2024
    Copy the full SHA
    518f9fe View commit details

Commits on Mar 26, 2024

  1. Copy the full SHA
    ace49aa View commit details

Commits on Mar 27, 2024

  1. feat(windows): refactor docker-ssh-agent build process like `docker…

    …-agent` (#289)
    
    * chore(windows): refactor `docker-ssh-agent` build process like `docker-agent`
    
    * adapt jdk11 updatecli manifest
    
    * remove --interactive from tests
    lemeurherve authored Mar 27, 2024
    Copy the full SHA
    68ce94b View commit details
  2. Copy the full SHA
    fb91ec4 View commit details
  3. chore: Bump JDK11 version for Windows images in the build-windows.yam…

    …... (#381)
    
    ... l file
    
    Made with ❤️️ by updatecli
    
    Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Mar 27, 2024
    Copy the full SHA
    642c030 View commit details
  4. chore(updatecli/jdk21) only update Docker Bake file but not Dockerfil…

    …es as JDK17 is still the default
    
    Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
    dduportal committed Mar 27, 2024
    Copy the full SHA
    83db53f View commit details
  5. Merge pull request #382 from dduportal/chore/updatecli/jdk21-not-default

    chore(updatecli/jdk21) only update Docker Bake file but not Dockerfiles as JDK17 is still the default
    dduportal authored Mar 27, 2024
    Copy the full SHA
    aea61a3 View commit details
  6. chore: Bump JDK21 version for Linux images in the docker-bake.hcl file

    Made with ❤️️ by updatecli
    github-actions[bot] committed Mar 27, 2024
    Copy the full SHA
    f1a62cf View commit details
  7. Merge pull request #383 from jenkinsci/updatecli_master_4f7e118f17074…

    …3177696dcb8484ea036901472b31edfaad1b303bd59818d2a00
    
    Bump JDK21 version to 21.0.2_13
    dduportal authored Mar 27, 2024
    Copy the full SHA
    e25b322 View commit details
  8. Copy the full SHA
    448c1c9 View commit details
  9. Copy the full SHA
    4a9e5c3 View commit details
  10. Copy the full SHA
    3f40102 View commit details
  11. updatecli

    lemeurherve committed Mar 27, 2024
    Copy the full SHA
    0244410 View commit details
  12. Merge pull request #384 from lemeurherve/add-windows-jdk17-and-jdk21

    feat(Windows): add JDK17 as default and JDK21
    dduportal authored Mar 27, 2024
    Copy the full SHA
    30da4ec View commit details
  13. Copy the full SHA
    e1c29ca View commit details
  14. Copy the full SHA
    f534e1f View commit details

Commits on Mar 29, 2024

  1. Merge pull request #318 from lemeurherve/fix-git-lfs-3-4-0-installation

    fix(windows): correct `git-lfs` installation and bump of its version to 3.4.1
    dduportal authored Mar 29, 2024
    Copy the full SHA
    bc23b5d View commit details
  2. chore: Update the git-lfs Windows version for Windows Core Server

    Made with ❤️️ by updatecli
    github-actions[bot] committed Mar 29, 2024
    Copy the full SHA
    01dbcec View commit details
  3. chore: Update the git-lfs Windows version for Windows Nanoserver

    Made with ❤️️ by updatecli
    github-actions[bot] committed Mar 29, 2024
    Copy the full SHA
    c6f573e View commit details
  4. chore: Update the git-lfs Windows version in tests

    Made with ❤️️ by updatecli
    github-actions[bot] committed Mar 29, 2024
    Copy the full SHA
    2ffce9a View commit details
  5. Merge pull request #387 from jenkinsci/updatecli_master_0af9fa03de480…

    …0958730c0202f9d36787ba56eeddf496e50e546f287dbfa768c
    
    Bump `git-lfs` version on Windows to 3.5.1
    dduportal authored Mar 29, 2024
    Copy the full SHA
    f7beb0f View commit details
  6. Merge pull request #385 from lemeurherve/issue245-ltsc2022-support

    feat(Windows): add Windows LTSC 2022 support
    dduportal authored Mar 29, 2024
    Copy the full SHA
    5384bcc View commit details
  7. Merge pull request #370 from gounthar/s390x-jdk21

    feat(JDK21) Use official Temurin build for linux/s390x
    dduportal authored Mar 29, 2024
    Copy the full SHA
    0222d7a View commit details
  8. chore(Windows): add OpenSSH updatecli manifest (#386)

    * chore(Windows): add OpenSSH updatecli manifest
    lemeurherve authored Mar 29, 2024
    Copy the full SHA
    ff05308 View commit details

Commits on Apr 15, 2024

  1. Bump Debian Bookworm Linux version to bookworm-20240408 (#389)

    * chore: Update the default value of the variable DEBIAN_RELEASE in the...
    
    ...  docker-bake.hcl
    
    Made with ❤️️ by updatecli
    
    * chore: Update the value of the base image (ARG DEBIAN_RELEASE) in the...
    
    ...  Dockerfile
    
    Made with ❤️️ by updatecli
    
    ---------
    
    Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Apr 15, 2024
    Copy the full SHA
    189c72c View commit details
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -11,12 +11,12 @@ updates:
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: docker
directory: "/windows/nanoserver-ltsc2019"
directory: "/windows/nanoserver"
schedule:
interval: weekly
open-pull-requests-limit: 10
- package-ecosystem: docker
directory: "/windows/windowsservercore-ltsc2019"
directory: "/windows/windowsservercore"
schedule:
interval: weekly
open-pull-requests-limit: 10
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -14,6 +14,6 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into the default branch
- uses: release-drafter/release-drafter@v5.25.0
- uses: release-drafter/release-drafter@v6.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/updatecli.yaml
Original file line number Diff line number Diff line change
@@ -15,15 +15,15 @@ jobs:
uses: actions/checkout@v4

- name: Install Updatecli in the runner
uses: updatecli/updatecli-action@v2.54.0
uses: updatecli/updatecli-action@v2.78.1

- name: Run Updatecli in Dry Run mode
run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml
run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml --values ./updatecli/values.temurin.yaml
env:
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Updatecli in Apply mode
if: github.ref == 'refs/heads/master'
run: updatecli apply --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml
run: updatecli apply --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml --values ./updatecli/values.temurin.yaml
env:
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -3,3 +3,4 @@ bats-core/
bats/
target/
/.vscode/
build-windows.yaml
146 changes: 78 additions & 68 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,85 +1,95 @@
def agentSelector(String imageType) {
// Linux agent
if (imageType == 'linux') {
return 'linux'
}
// Windows Server Core 2022 agent
if (imageType.contains('2022')) {
return 'windows-2022'
}
// Windows Server Core 2019 agent (for nanoserver 1809 & ltsc2019 and for windowservercore ltsc2019)
return 'windows-2019'
}

pipeline {
agent none

options {
buildDiscarder(logRotator(daysToKeepStr: '10'))
timestamps()
}

stages {
stage('Build Docker Image') {
parallel {
stage('Windows') {
agent {
label "docker-windows"
}
options {
timeout(time: 60, unit: 'MINUTES')
}
environment {
DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}"
stage('docker-ssh-agent') {
environment {
DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}"
}
matrix {
axes {
axis {
name 'IMAGE_TYPE'
values 'linux', 'nanoserver-1809', 'nanoserver-ltsc2019', 'nanoserver-ltsc2022', 'windowsservercore-ltsc2019', 'windowsservercore-ltsc2022'
}
steps {
powershell '& ./make.ps1 test'
script {
def branchName = "${env.BRANCH_NAME}"
if (branchName ==~ 'master') {
// we can't use dockerhub builds for windows
// so we publish here
infra.withDockerCredentials {
powershell '& ./make.ps1 publish'
}
stages {
stage('Main') {
agent {
label agentSelector(env.IMAGE_TYPE)
}
options {
timeout(time: 60, unit: 'MINUTES')
}
stages {
stage('Prepare Docker') {
when {
environment name: 'IMAGE_TYPE', value: 'linux'
}
}

def tagName = "${env.TAG_NAME}"
if(tagName =~ /\d(\.\d)+(-\d+)?/) {
// we need to build and publish the tagged version
infra.withDockerCredentials {
powershell "& ./make.ps1 -PushVersions -VersionTag $tagName publish"
steps {
sh 'make docker-init'
}
}
}
}
}
stage('Linux') {
agent {
label "docker&&linux"
}
options {
timeout(time: 30, unit: 'MINUTES')
}
steps {
script {
infra.withDockerCredentials {
def branchName = "${env.BRANCH_NAME}"
if (infra.isTrusted()) {
if (branchName ==~ 'master') {
sh '''
docker buildx create --use
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx bake --push --file docker-bake.hcl linux
'''
} else if (env.TAG_NAME != null) {
sh """
export ON_TAG=true
export VERSION=$TAG_NAME
docker buildx create --use
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx bake --push --file docker-bake.hcl linux
"""
stage('Build and Test') {
// This stage is the "CI" and should be run on all code changes triggered by a code change
when {
not { buildingTag() }
}
steps {
script {
if(isUnix()) {
sh 'make build'
sh 'make test'
// If the tests are passing for Linux AMD64, then we can build all the CPU architectures
sh 'make every-build'
} else {
powershell '& ./build.ps1 test'
}
}
} else {
sh 'make build'
try {
sh 'make test'
} finally {
junit('target/*.xml')
}
post {
always {
junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results.xml')
}
}
}
stage('Deploy to DockerHub') {
// This stage is the "CD" and should only be run when a tag triggered the build
when {
buildingTag()
}
environment {
ON_TAG = 'true'
VERSION = "${env.TAG_NAME}"
}
steps {
script {
// This function is defined in the jenkins-infra/pipeline-library
infra.withDockerCredentials {
if (isUnix()) {
sh 'make publish'
} else {
powershell '& ./build.ps1 publish'
}
}
}
sh '''
docker buildx create --use
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx bake --file docker-bake.hcl linux
'''
}
}
}
24 changes: 18 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -22,10 +22,11 @@ check_cli = type "$(1)" >/dev/null 2>&1 || { echo "Error: command '$(1)' require
## Check if a given image exists in the current manifest docker-bake.hcl
check_image = make --silent list | grep -w '$(1)' >/dev/null 2>&1 || { echo "Error: the image '$(1)' does not exist in manifest for the platform 'linux/$(ARCH)'. Please check the output of 'make list'. Exiting." ; exit 1 ; }
## Base "docker buildx base" command to be reused everywhere
bake_base_cli := docker buildx bake -f docker-bake.hcl --load
bake_base_cli := docker buildx bake --file docker-bake.hcl
bake_cli := $(bake_base_cli) --load

.PHONY: build
.PHONY: test test-alpine test-archlinux test-debian test-jdk11 test-jdk11-alpine
.PHONY: test test-alpine test-debian

check-reqs:
## Build requirements
@@ -37,26 +38,37 @@ check-reqs:
@$(call check_cli,curl)
@$(call check_cli,jq)

## This function is specific to Jenkins infrastructure and isn't required in other contexts
docker-init: check-reqs
@set -x; docker buildx create --use
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

build: check-reqs
@set -x; $(bake_base_cli) --set '*.platform=linux/$(ARCH)' $(shell make --silent list)
@set -x; $(bake_cli) $(shell make --silent list) --set '*.platform=linux/$(ARCH)'

build-%:
@$(call check_image,$*)
@set -x; $(bake_base_cli) --set '*.platform=linux/$(ARCH)' '$*'
@set -x; $(bake_cli) '$*' --set '*.platform=linux/$(ARCH)'

every-build: check-reqs
@set -x; $(bake_base_cli) linux

show:
@$(bake_base_cli) linux --print
@$(bake_cli) linux --print

list: check-reqs
@set -x; make --silent show | jq -r '.target | path(.. | select(.platforms[] | contains("linux/$(ARCH)"))?) | add'

bats:
git clone --branch v1.10.0 https://github.com/bats-core/bats-core bats
git clone --branch v1.11.1 https://github.com/bats-core/bats-core bats

prepare-test: bats check-reqs
git submodule update --init --recursive
mkdir -p target

publish:
@set -x; $(bake_base_cli) linux --push

## Define bats options based on environment
# common flags for all tests
bats_flags := $(TEST_SUITES)
76 changes: 69 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -94,6 +94,7 @@ Should you want to build this image on your machine (before submitting a pull re
* Docker BuildX plugin [installed](https://github.com/docker/buildx#installing) on older versions of Docker (from `19.03`). Docker Buildx is included in recent versions of Docker Desktop for Windows, macOS, and Linux. Docker Linux packages also include Docker Buildx when installed using the DEB or RPM packages.
* [GNU Make](https://www.gnu.org/software/make/) [installed](https://command-not-found.com/make)
* jq [installed](https://command-not-found.com/jq)
* yq [installed](https://github.com/mikefarah/yq) (for Windows)
* [GNU Bash](https://www.gnu.org/software/bash/) [installed](https://command-not-found.com/bash)
* git [installed](https://command-not-found.com/git)
* curl [installed](https://command-not-found.com/curl)
@@ -120,22 +121,23 @@ If you want to build a specific image, you can issue the following command:
make build-<OS>_<JDK_VERSION>
```

That would give for JDK 11 on Alpine Linux:
That would give for JDK 17 on Alpine Linux:

```bash
make build-alpine_jdk11
make build-alpine_jdk17
```

#### Building all images
Then, you can build all the images by running:
#### Building images supported by your current architecture

Then, you can build the images supported by your current architecture by running:

```bash
make build
```

#### Testing all images

If you want to test the images, you can run:
If you want to test these images, you can run:

```bash
make test
@@ -148,10 +150,18 @@ If you want to test a specific image, you can run:
make test-<OS>_<JDK_VERSION>
```

That would give for JDK 11 on Alpine Linux:
That would give for JDK 17 on Alpine Linux:

```bash
make test-alpine_jdk11
make test-alpine_jdk17
```

#### Building all images

You can build all images (even those unsupported by your current architecture) by running:

```bash
make every-build
```

#### Other `make` targets
@@ -196,6 +206,58 @@ make bats
make: 'bats' is up to date.
```
`publish` allows the publication of all images targeted by 'linux' to a registry.
`docker-init` is dedicated to Jenkins infrastructure for initializing docker and isn't required in other contexts.
### Building and testing on Windows
#### Building all images
Run `.\build.ps1` to launch the build of the images corresponding to the "windows" target of docker-bake.hcl.
Internally, the first time you'll run this script and if there is no build-windows.yaml file in your repository, it will use a combination of `docker buildx bake` and `yq` to generate a build-windows.yaml docker compose file containing all Windows image definitions from docker-bake.hcl. Then it will run `docker compose` on this file to build these images.
You can modify this docker compose file as you want, then rerun `.\build.ps1`.
It won't regenerate the docker compose file from docker-bake.hcl unless you add the `-OverwriteDockerComposeFile` build.ps1 parameter: `.\build.ps1 -OverwriteDockerComposeFile`.
Note: you can generate this docker compose file from docker-bake.hcl yourself with the following command (require `docker buildx` and `yq`):
```console
# - Use docker buildx bake to output image definitions from the "windows" bake target
# - Convert with yq to the format expected by docker compose
# - Store the result in the docker compose file
$ docker buildx bake --progress=plain --file=docker-bake.hcl windows --print `
| yq --prettyPrint '.target[] | del(.output) | {(. | key): {\"image\": .tags[0], \"build\": .}}' | yq '{\"services\": .}' `
| Out-File -FilePath build-windows.yaml
```
Note that you don't need build.ps1 to build (or to publish) your images from this docker compose file, you can use `docker compose --file=build-windows.yaml build`.
#### Testing all images
Run `.\build.ps1 test` if you also want to run the tests harness suit.
Run `.\build.ps1 test -TestsDebug 'debug'` to also get commands & stderr of tests, displayed on top of them.
You can set it to `'verbose'` to also get stdout of every test command.
Note that instead of passing `-TestsDebug` parameter to build.ps1, you can set the $env:TESTS_DEBUG environment variable to the desired value.
Also note that contrary to the Linux part, you have to build the images before testing them.
#### Dry run
Add the `-DryRun` parameter to print out any build, publish or tests commands instead of executing them: `.\build.ps1 test -DryRun`
#### Building and testing a specific image
You can build (and test) only one image type by setting `-ImageType` to a combination of Windows flavors ("nanoserver" & "windowsservercore") and Windows versions ("1809", "ltsc2019", "ltsc2022").
Ex: `.\build.ps1 -ImageType 'nanoserver-ltsc2019'`
Warning: trying to build `windowsservercore-1809` will fail as there is no corresponding image from Microsoft.
## Changelog
See [GitHub Releases](https://github.com/jenkinsci/docker-ssh-agent/releases/latest).
Loading