Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set PATH in Dockerfile Instead of Clone Script #42

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add server 2022 images
  • Loading branch information
viceice committed Sep 8, 2021
commit 06d6564bc0f12bfe122a59badaad763829df0a5c
1 change: 1 addition & 0 deletions .drone.starlark
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ def main(ctx):
linux('amd64'),
windows('1903'),
windows('1809'),
windows('2022'),
]

after = manifest()
33 changes: 33 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions docker/Dockerfile.windows.2022
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# escape=`

FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS git
SHELL ["powershell.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
Invoke-WebRequest -UseBasicParsing https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/MinGit-2.33.0.2-64-bit.zip -OutFile git.zip; `
Expand-Archive git.zip -DestinationPath C:\git;

FROM mcr.microsoft.com/powershell:nanoserver-ltsc2022
COPY --from=git /git /git

ADD windows/* /bin/

# https://github.com/PowerShell/PowerShell/issues/6211#issuecomment-367477137
USER ContainerAdministrator
RUN setx /M PATH "%PATH%;C:\Program Files\PowerShell"

SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
CMD [ "pwsh", "C:\\bin\\clone.ps1" ]
8 changes: 7 additions & 1 deletion docker/manifest.tmpl
Original file line number Diff line number Diff line change
@@ -52,4 +52,10 @@ manifests:
platform:
architecture: amd64
os: windows
version: 1909
version: 1909
-
image: drone/git:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-2022-amd64
platform:
architecture: amd64
os: windows
version: 2022