diff --git a/docker/Dockerfile.linux.amd64 b/docker/Dockerfile.linux.amd64 index 3c4cb6b..2858df3 100644 --- a/docker/Dockerfile.linux.amd64 +++ b/docker/Dockerfile.linux.amd64 @@ -1,5 +1,5 @@ -FROM alpine:3.6 -RUN apk add --no-cache ca-certificates git openssh curl perl +FROM alpine:3.7 +RUN apk add --no-cache ca-certificates git git-lfs openssh curl perl ADD posix/* /usr/local/bin/ ENTRYPOINT ["/usr/local/bin/clone"] diff --git a/docker/Dockerfile.linux.arm b/docker/Dockerfile.linux.arm index cc548d5..a32fa35 100644 --- a/docker/Dockerfile.linux.arm +++ b/docker/Dockerfile.linux.arm @@ -1,5 +1,5 @@ -FROM arm32v6/alpine:3.6 -RUN apk add --no-cache ca-certificates git openssh curl perl +FROM arm32v6/alpine:3.7 +RUN apk add --no-cache ca-certificates git git-lfs openssh curl perl ADD posix/* /usr/local/bin/ ENTRYPOINT ["/usr/local/bin/clone"] diff --git a/docker/Dockerfile.linux.arm6 b/docker/Dockerfile.linux.arm6 index cc548d5..a32fa35 100644 --- a/docker/Dockerfile.linux.arm6 +++ b/docker/Dockerfile.linux.arm6 @@ -1,5 +1,5 @@ -FROM arm32v6/alpine:3.6 -RUN apk add --no-cache ca-certificates git openssh curl perl +FROM arm32v6/alpine:3.7 +RUN apk add --no-cache ca-certificates git git-lfs openssh curl perl ADD posix/* /usr/local/bin/ ENTRYPOINT ["/usr/local/bin/clone"] diff --git a/docker/Dockerfile.linux.arm64 b/docker/Dockerfile.linux.arm64 index f8991fb..5ea1800 100644 --- a/docker/Dockerfile.linux.arm64 +++ b/docker/Dockerfile.linux.arm64 @@ -1,5 +1,5 @@ -FROM arm64v8/alpine:3.6 -RUN apk add --no-cache ca-certificates git openssh curl perl +FROM arm64v8/alpine:3.7 +RUN apk add --no-cache ca-certificates git git-lfs openssh curl perl ADD posix/* /usr/local/bin/ ENTRYPOINT ["/usr/local/bin/clone"] diff --git a/docker/Dockerfile.linux.arm7 b/docker/Dockerfile.linux.arm7 index cc548d5..a32fa35 100644 --- a/docker/Dockerfile.linux.arm7 +++ b/docker/Dockerfile.linux.arm7 @@ -1,5 +1,5 @@ -FROM arm32v6/alpine:3.6 -RUN apk add --no-cache ca-certificates git openssh curl perl +FROM arm32v6/alpine:3.7 +RUN apk add --no-cache ca-certificates git git-lfs openssh curl perl ADD posix/* /usr/local/bin/ ENTRYPOINT ["/usr/local/bin/clone"] diff --git a/docker/Dockerfile.linux.arm8 b/docker/Dockerfile.linux.arm8 index f8991fb..5ea1800 100644 --- a/docker/Dockerfile.linux.arm8 +++ b/docker/Dockerfile.linux.arm8 @@ -1,5 +1,5 @@ -FROM arm64v8/alpine:3.6 -RUN apk add --no-cache ca-certificates git openssh curl perl +FROM arm64v8/alpine:3.7 +RUN apk add --no-cache ca-certificates git git-lfs openssh curl perl ADD posix/* /usr/local/bin/ ENTRYPOINT ["/usr/local/bin/clone"] diff --git a/docker/Dockerfile.windows.1709 b/docker/Dockerfile.windows.1709 index 33d8cae..1faea53 100644 --- a/docker/Dockerfile.windows.1709 +++ b/docker/Dockerfile.windows.1709 @@ -14,7 +14,5 @@ ADD windows/* /bin/ USER ContainerAdministrator RUN setx /M PATH "%PATH%;C:\Program Files\PowerShell" -ENV HOME C:\\Users\\ContainerAdministrator - SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] CMD [ "pwsh", "C:\\bin\\clone.ps1" ] diff --git a/docker/Dockerfile.windows.1803 b/docker/Dockerfile.windows.1803 index a68a5e3..59b4ff2 100644 --- a/docker/Dockerfile.windows.1803 +++ b/docker/Dockerfile.windows.1803 @@ -14,7 +14,5 @@ ADD windows/* /bin/ USER ContainerAdministrator RUN setx /M PATH "%PATH%;C:\Program Files\PowerShell" -ENV HOME C:\\Users\\ContainerAdministrator - SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] CMD [ "pwsh", "C:\\bin\\clone.ps1" ] diff --git a/windows/clone-commit.ps1 b/windows/clone-commit.ps1 index d0426fd..43566c5 100644 --- a/windows/clone-commit.ps1 +++ b/windows/clone-commit.ps1 @@ -5,9 +5,13 @@ if ($Env:PLUGIN_DEPTH) { } if (!(Test-Path .git)) { + Write-Host 'git init'; git init + Write-Host "git remote add origin $Env:DRONE_REMOTE_URL" git remote add origin $Env:DRONE_REMOTE_URL } -git fetch $FLAGS origin "+refs/heads/${Env:DRONE_COMMIT_BRANCH}:" -git checkout $Env:DRONE_COMMIT_SHA -b $Env:DRONE_COMMIT_BRANCH +Write-Host "git fetch $FLAGS origin +refs/heads/${Env:DRONE_COMMIT_BRANCH}:"; +git fetch $FLAGS origin "+refs/heads/${Env:DRONE_COMMIT_BRANCH}:"; +Write-Host "git checkout $Env:DRONE_COMMIT_SHA -f $Env:DRONE_COMMIT_BRANCH"; +git checkout $Env:DRONE_COMMIT_SHA -b $Env:DRONE_COMMIT_BRANCH; diff --git a/windows/clone.ps1 b/windows/clone.ps1 index a4c25cf..ca0c322 100644 --- a/windows/clone.ps1 +++ b/windows/clone.ps1 @@ -15,11 +15,11 @@ if ($Env:DRONE_WORKSPACE) { # the netrc file. if ($Env:DRONE_NETRC_MACHINE) { - -$netrc=[string]::Format("{0}\_netrc",$Env:HOME); -"machine $Env:CI_NETRC_MACHINE" >> $netrc; -"login $Env:CI_NETRC_USERNAME" >> $netrc; -"password $Env:CI_NETRC_PASSWORD" >> $netrc; +@" +machine $Env:DRONE_NETRC_MACHINE +login $Env:DRONE_NETRC_USERNAME +password $Env:DRONE_NETRC_PASSWORD +"@ > (Join-Path $Env:USERPROFILE '_netrc'); } # configure git global behavior and parameters via the