tweaks for docker on windows
This commit is contained in:
parent
906a7fccee
commit
451671cd88
4 changed files with 70 additions and 55 deletions
|
@ -13,8 +13,13 @@ RUN powershell -NoProfile -InputFormat None -Command `
|
|||
mkdir c:\jenkins ; `
|
||||
Invoke-WebRequest -Uri %SWARM_PLUGIN_URL% -OutFile %SWARM_PLUGIN_JAR%
|
||||
|
||||
# network storage for build results
|
||||
VOLUME C:\results
|
||||
# install gsutils to access Google Cloud Storage
|
||||
RUN powershell -NoProfile -InputFormat None -Command `
|
||||
(New-Object Net.WebClient).DownloadFile("https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe", "$env:Temp\GoogleCloudSDKInstaller.exe") ; `
|
||||
& $env:Temp\GoogleCloudSDKInstaller.exe ; `
|
||||
del $env:Temp\GoogleCloudSDKInstaller.exe
|
||||
VOLUME C:\credentials
|
||||
VOLUME C:\Temp
|
||||
|
||||
# start swarm plugin
|
||||
COPY start_agent.bat c:\jenkins
|
||||
|
|
|
@ -16,6 +16,11 @@ set JENKINS_SERVER=jenkins.local
|
|||
|
||||
set AGENT_ROOT=C:\ws
|
||||
set WORKSPACE=%AGENT_ROOT%\workspace
|
||||
if not exist "%WORKSPACE%" mkdir "%WORKSPACE%"
|
||||
|
||||
@rem authenticate gsutil
|
||||
gcloud auth activate-service-account --key-file C:\credentials\build-agent-results_key.json
|
||||
|
||||
set TEMP=C:\TEMP
|
||||
set TMP=%TEMP%
|
||||
|
||||
java -jar %SWARM_PLUGIN_JAR% -master http://%JENKINS_SERVER%:8080 -executors 1 -fsroot %AGENT_ROOT% -labels windows
|
|
@ -29,7 +29,7 @@ If ($LastExitCode -ne 0) {
|
|||
}
|
||||
|
||||
# mount a persistent workspace for experiments
|
||||
docker run -it -v D:\:C:\ws $IMAGE_NAME $CMD
|
||||
docker run -it -v D:\:C:\ws -v C:\credentials:C:\credentials $IMAGE_NAME $CMD
|
||||
If ($LastExitCode -ne 0) {
|
||||
exit
|
||||
}
|
|
@ -19,6 +19,11 @@ $JENKINS_SERVER="jenkins.local"
|
|||
$AGENT_ROOT="D:\"
|
||||
$SWARM_PLUGIN_JAR="C:\jenkins\swarm-client.jar"
|
||||
|
||||
# move temp dir to local SSD
|
||||
mkdir D:\temp
|
||||
$env:temp="D:\temp"
|
||||
$env:tmp=$env:temp
|
||||
|
||||
java -jar ${SWARM_PLUGIN_JAR} `
|
||||
-master http://${JENKINS_SERVER}:8080 `
|
||||
-executors 1 `
|
||||
|
|
Loading…
Reference in a new issue