File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -657,13 +657,19 @@ def call(){
657657 agent{
658658 label ' linux && docker && x86'
659659 }
660+ environment{
661+ DOCKER_CRED = credentials(' jenkins-nexus' )
662+ }
660663 steps{
661664 script{
662665 configFileProvider([configFile(fileId : ' getmarc_deployapi' , variable : ' CONFIG_FILE' )]) {
663666 def CONFIG = readJSON(file : CONFIG_FILE )[' deploy' ]
664667 echo " CONFIG = ${ CONFIG} "
665668 def build_args = CONFIG [' docker' ][' build' ][' buildArgs' ]. collect{" --build-arg=${ it} " }. join(' ' )
666669 def dockerImage = docker. build(" ${ IMAGE_NAME} :${ DOCKER_TAG} " , " ${ build_args} ." )
670+ withEnv([' DOCKER_REGISTRY=${CONFIG["docker"]["server"]["registry"]}' ]){
671+ sh ' docker login $DOCKER_REGISTRY -u $DOCKER_CRED_USR -p $DOCKER_CRED_PSW'
672+ }
667673// docker.withRegistry(CONFIG['docker']['server']['registry'], 'jenkins-nexus'){
668674// dockerImage.push()
669675// dockerImage.push('latest')
You can’t perform that action at this time.
0 commit comments