Merge pull request #6 from donny-dont/fix-stuff [ci skip]

Fix netrc on Windows
This commit is contained in:
Brad Rydzewski 2018-12-14 18:28:18 -08:00 committed by GitHub
commit 7bb19442db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View File

@ -14,7 +14,5 @@ ADD windows/* /bin/
USER ContainerAdministrator USER ContainerAdministrator
RUN setx /M PATH "%PATH%;C:\Program Files\PowerShell" RUN setx /M PATH "%PATH%;C:\Program Files\PowerShell"
ENV HOME C:\\Users\\ContainerAdministrator
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
CMD [ "pwsh", "C:\\bin\\clone.ps1" ] CMD [ "pwsh", "C:\\bin\\clone.ps1" ]

View File

@ -14,7 +14,5 @@ ADD windows/* /bin/
USER ContainerAdministrator USER ContainerAdministrator
RUN setx /M PATH "%PATH%;C:\Program Files\PowerShell" RUN setx /M PATH "%PATH%;C:\Program Files\PowerShell"
ENV HOME C:\\Users\\ContainerAdministrator
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
CMD [ "pwsh", "C:\\bin\\clone.ps1" ] CMD [ "pwsh", "C:\\bin\\clone.ps1" ]

View File

@ -5,9 +5,13 @@ if ($Env:PLUGIN_DEPTH) {
} }
if (!(Test-Path .git)) { if (!(Test-Path .git)) {
Write-Host 'git init';
git init git init
Write-Host "git remote add origin $Env:DRONE_REMOTE_URL"
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}:" Write-Host "git fetch $FLAGS origin +refs/heads/${Env:DRONE_COMMIT_BRANCH}:";
git checkout $Env:DRONE_COMMIT_SHA -b $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;

View File

@ -15,11 +15,11 @@ if ($Env:DRONE_WORKSPACE) {
# the netrc file. # the netrc file.
if ($Env:DRONE_NETRC_MACHINE) { if ($Env:DRONE_NETRC_MACHINE) {
@"
$netrc=[string]::Format("{0}\_netrc",$Env:HOME); machine $Env:DRONE_NETRC_MACHINE
"machine $Env:CI_NETRC_MACHINE" >> $netrc; login $Env:DRONE_NETRC_USERNAME
"login $Env:CI_NETRC_USERNAME" >> $netrc; password $Env:DRONE_NETRC_PASSWORD
"password $Env:CI_NETRC_PASSWORD" >> $netrc; "@ > (Join-Path $Env:USERPROFILE '_netrc');
} }
# configure git global behavior and parameters via the # configure git global behavior and parameters via the