[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Deploy Docker image to OKD 3.11 from Jenkins pipeline



Hi

In Jenkins multibranch project I have Jenkins file that creates docker container and deploys it into Nexus:

stage ('Deployment Stage') {
      steps {
        withMaven(maven : 'apache-maven-3.6.3') {
          sh 'mvn deploy'
        }
      }
    }
    stage('Building image') {
      steps {
        script {
          dockerImage = docker.build DOCKER_REGISTRY + "/" + CONTAINER_NAME + ":$POM_VERSION"
        }
      }
    }
    stage('Deploy Image') {
      steps {
        script {
          docker.withRegistry( "https://" + DOCKER_REGISTRY, DOCKER_CREDENTIAL ) {
            dockerImage.push()
          }
        }
      }
    }

How can I deploy this docker image to OKD (OpenShift) 3.11? I would like to extend my Jenkins file to perform that task automatically (using OpenShift Jenkins Plugin).

Any tip is much appreciated.

Thank you,
Milan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]