@@ -731,7 +731,14 @@ If you know what you're doing and would like to suppress this warning, use one o
731731 await Utils . spawn ( [ this . argv . containerExecutable , "cp" , `${ fileVariablesDir } /.` , `${ containerId } :${ fileVariablesDir } ` ] , argv . cwd ) ;
732732 this . refreshLongRunningSilentTimeout ( writeStreams ) ;
733733 }
734- await Utils . spawn ( [ this . argv . containerExecutable , "cp" , `${ argv . stateDir } /builds/.docker/.` , `${ containerId } :${ this . ciProjectDir } ` ] , argv . cwd ) ;
734+ const cmd = "sed -E -e 's,^[.]?/,,' -e '/^[.]git/d' /data/src/.dockerignore >/data/ignore 2>/dev/null; rsync -avh --exclude-from /data/ignore /data/src/. /data/dest" ;
735+ await Utils . spawn ( [
736+ this . argv . containerExecutable , "run" , "--rm" ,
737+ "-v" , `${ this . argv . cwd } /${ this . argv . stateDir } /builds/.docker:/data/src:ro` ,
738+ "-v" , `${ this . buildVolumeName } :/data/dest:rw` ,
739+ this . argv . helperImage ,
740+ "bash" , "-c" , cmd ,
741+ ] ) ;
735742 await Utils . spawn ( [ this . argv . containerExecutable , "start" , "--attach" , containerId ] , argv . cwd ) ;
736743 await Utils . spawn ( [ this . argv . containerExecutable , "rm" , "-vf" , containerId ] , argv . cwd ) ;
737744 const endTime = process . hrtime ( time ) ;
@@ -1336,12 +1343,19 @@ If you know what you're doing and would like to suppress this warning, use one o
13361343 writeStreams . stdout ( chalk `${ this . formattedJobName } {magentaBright imported artifacts} in {magenta ${ prettyHrtime ( endTime ) } }\n` ) ;
13371344 }
13381345
1339- copyIn ( source : string ) {
1346+ async copyIn ( source : string ) {
13401347 const safeJobName = this . safeJobName ;
13411348 if ( ! this . imageName ( this . _variables ) && this . argv . shellIsolation ) {
13421349 return Utils . spawn ( [ "rsync" , "-a" , `${ source } /.` , `${ this . argv . cwd } /${ this . argv . stateDir } /builds/${ safeJobName } ` ] ) ;
13431350 }
1344- return Utils . spawn ( [ this . argv . containerExecutable , "cp" , `${ source } /.` , `${ this . _containerId } :${ this . ciProjectDir } ` ] ) ;
1351+ const cmd = "sed -E -e 's,^[.]?/,,' -e '/^[.]git/d' /data/src/.dockerignore >/data/ignore 2>/dev/null; rsync -avh --exclude-from /data/ignore /data/src/. /data/dest" ;
1352+ return Utils . spawn ( [
1353+ this . argv . containerExecutable , "run" , "--rm" ,
1354+ "-v" , `${ source } :/data/src:ro` ,
1355+ "-v" , `${ this . buildVolumeName } :/data/dest:rw` ,
1356+ this . argv . helperImage ,
1357+ "bash" , "-c" , cmd ,
1358+ ] ) ;
13451359 }
13461360
13471361 private async copyCacheOut ( writeStreams : WriteStreams , expanded : { [ key : string ] : string } ) {
0 commit comments