@@ -323,7 +323,7 @@ export class Job {
323323 predefinedVariables [ "CI_NODE_INDEX" ] = `${ opt . nodeIndex } ` ;
324324 }
325325 predefinedVariables [ "CI_NODE_TOTAL" ] = `${ opt . nodesTotal } ` ;
326- predefinedVariables [ "CI_REGISTRY" ] = `local-registry.${ this . gitData . remote . host } ` ;
326+ predefinedVariables [ "CI_REGISTRY" ] = predefinedVariables [ "CI_REGISTRY" ] = this . argv . registry ? Utils . gclRegistryPrefix : `local-registry.${ this . gitData . remote . host } ` ;
327327 predefinedVariables [ "CI_REGISTRY_IMAGE" ] = `$CI_REGISTRY/${ predefinedVariables [ "CI_PROJECT_PATH" ] . toLowerCase ( ) } ` ;
328328 return predefinedVariables ;
329329 }
@@ -829,6 +829,11 @@ export class Job {
829829 } ) ;
830830 }
831831
832+ if ( this . argv . registry ) {
833+ expanded [ "CI_REGISTRY_USER" ] = expanded [ "CI_REGISTRY_USER" ] ?? `${ Utils . gclRegistryPrefix } .user` ;
834+ expanded [ "CI_REGISTRY_PASSWORD" ] = expanded [ "CI_REGISTRY_PASSWORD" ] ?? `${ Utils . gclRegistryPrefix } .password` ;
835+ }
836+
832837 this . refreshLongRunningSilentTimeout ( writeStreams ) ;
833838
834839 if ( imageName && ! this . _containerId ) {
@@ -897,9 +902,6 @@ export class Job {
897902 dockerCmd += `--network ${ Utils . gclRegistryPrefix } .net ` ;
898903 dockerCmd += `--volume ${ Utils . gclRegistryPrefix } .certs:/etc/containers/certs.d:ro ` ;
899904 dockerCmd += `--volume ${ Utils . gclRegistryPrefix } .certs:/etc/docker/certs.d:ro ` ;
900- expanded [ "CI_REGISTRY" ] = Utils . gclRegistryPrefix ;
901- expanded [ "CI_REGISTRY_USER" ] = expanded [ "CI_REGISTRY_USER" ] ?? `${ Utils . gclRegistryPrefix } .user` ;
902- expanded [ "CI_REGISTRY_PASSWORD" ] = expanded [ "CI_REGISTRY_PASSWORD" ] ?? `${ Utils . gclRegistryPrefix } .password` ;
903905 }
904906
905907 dockerCmd += `--volume ${ buildVolumeName } :${ this . ciProjectDir } ` ;
0 commit comments