diff --git a/.drone.starlark b/.drone.starlark index ec15bb3..5ca8ea0 100644 --- a/.drone.starlark +++ b/.drone.starlark @@ -12,6 +12,7 @@ def main(ctx): linux('amd64'), windows('1903'), windows('1809'), + windows('2022'), ] after = manifest() diff --git a/.drone.yml b/.drone.yml index 10262fd..87efc51 100644 --- a/.drone.yml +++ b/.drone.yml @@ -99,6 +99,38 @@ steps: - push - tag +--- +kind: pipeline +type: ssh +name: windows-2022-amd64 + +platform: + os: windows + +server: + host: + from_secret: windows_server_2022 + password: + from_secret: windows_password + user: + from_secret: windows_username + +steps: +- name: build + commands: + - docker login -u $env:USERNAME -p $env:PASSWORD + - docker build -f docker/Dockerfile.windows.2022 -t drone/git:windows-2022-amd64 . + - docker push drone/git:windows-2022-amd64 + environment: + USERNAME: + from_secret: docker_username + PASSWORD: + from_secret: docker_password + +trigger: + event: + - push + --- kind: pipeline type: ssh @@ -221,6 +253,7 @@ depends_on: - linux-amd64 - linux-arm64 - linux-arm +- windows-2022-amd64 - windows-1909-amd64 - windows-1903-amd64 - windows-1809-amd64 diff --git a/docker/Dockerfile.windows.2022 b/docker/Dockerfile.windows.2022 new file mode 100644 index 0000000..77e5572 --- /dev/null +++ b/docker/Dockerfile.windows.2022 @@ -0,0 +1,15 @@ +# escape=` + +FROM mcr.microsoft.com/powershell:nanoserver-ltsc2022 + +RUN ` + mkdir tmp && mkdir git` + && curl -sSfLo tmp/file.zip https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/MinGit-2.33.0.2-64-bit.zip ` + && tar -C c:\git -oxzf tmp/file.zip` + && rmdir /Q /S tmp + +RUN setx PATH "%PATH%;/git/cmd;/git/mingw64/bin;/git/usr/bin" + +ADD windows/* /bin/ + +CMD ["pwsh", "/bin/clone.ps1"] diff --git a/docker/manifest.tmpl b/docker/manifest.tmpl index 7a8ab73..db699f8 100644 --- a/docker/manifest.tmpl +++ b/docker/manifest.tmpl @@ -52,4 +52,10 @@ manifests: platform: architecture: amd64 os: windows - version: 1909 \ No newline at end of file + version: 1909 + - + image: drone/git:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-2022-amd64 + platform: + architecture: amd64 + os: windows + version: 2022 \ No newline at end of file diff --git a/windows/clone.ps1 b/windows/clone.ps1 index 4be8cc4..fd43a86 100644 --- a/windows/clone.ps1 +++ b/windows/clone.ps1 @@ -1,9 +1,5 @@ $ErrorActionPreference = 'Stop'; -# HACK: no clue how to set the PATH inside the Dockerfile, -# so am setting it here instead. This is not idea. -$Env:PATH += ';C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin' - # if the workspace is set we should make sure # it is the current working directory.