Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-24043

envvars not resolved for 'wait for ports' field

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      Trying to start a container providing the following:

      Docker command: Start Containers(s)
      Container ID(s): $DOCKER_CONTAINER_IDS
      Wait for ports: $DOCKER_CONTAINER_IDS 22

      error:

      [Docker] INFO: started container id df65196e50c8b48963d0f3cd8c1f3e548effe03d2b3b1ad4e36564985f6a1cf6
      [Docker] ERROR: command 'Start container(s)' failed: No such container $DOCKER_CONTAINER_IDS
      ERROR: No such container $DOCKER_CONTAINER_IDS
      ERROR: Publisher com.nirima.jenkins.plugins.docker.publisher.DockerPublisherControl aborted due to exception
      java.lang.NullPointerException
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:736)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:685)
      at hudson.model.Run.execute(Run.java:1757)
      at hudson.plugins.project_inheritance.projects.InheritanceBuild.run(InheritanceBuild.java:96)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:234)

      NOTE: I am not sure how to break down DOCKER_CONATAINER_IDS into individual ids when used in wait for ports field. At the moment I only create one container so problem yet.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Vojtech Juranek
          Path:
          src/main/java/org/jenkinsci/plugins/dockerbuildstep/cmd/StartCommand.java
          http://jenkins-ci.org/commit/docker-build-step-plugin/abe584574425da4ddd98ebc823889e942607e9da
          Log:
          [FIXED JENKINS-24043] Expand env. vars in wait for ports field

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vojtech Juranek Path: src/main/java/org/jenkinsci/plugins/dockerbuildstep/cmd/StartCommand.java http://jenkins-ci.org/commit/docker-build-step-plugin/abe584574425da4ddd98ebc823889e942607e9da Log: [FIXED JENKINS-24043] Expand env. vars in wait for ports field
          Hide
          vjuranek vjuranek added a comment -

          Hi,
          should be fixed now. However, it seems to me, that you use $DOCKER_CONTAINER_IDS in little different way than it was intended. It can be expanded in Container ID(s) field, however, it was intended rather to provide real container ID in this field and once the container is started, it will create $DOCKER_CONTAINER_IDS env. variable which is intended to be used in other build steps.

          Show
          vjuranek vjuranek added a comment - Hi, should be fixed now. However, it seems to me, that you use $DOCKER_CONTAINER_IDS in little different way than it was intended. It can be expanded in Container ID(s) field, however, it was intended rather to provide real container ID in this field and once the container is started, it will create $DOCKER_CONTAINER_IDS env. variable which is intended to be used in other build steps.
          Hide
          aikomastboom Aiko Mastboom added a comment -

          We are trying to configure a build-chain in which every job is a step towards production.
          For example: init_ws -> sanity_check -> build -> unit_test -> coverage -> package
          We would like to start the sanity_check with the resulting (tagged) image from the init_ws job, then use the resulting image for build step, and reuse the build result for unit and coverage steps. Then use the clean build step to create a package.

          If only we could pass the current jobs image tag to the next job which in turn will run that container as starting point.

          originally posted: https://github.com/jenkinsci/docker-plugin/issues/60

          Show
          aikomastboom Aiko Mastboom added a comment - We are trying to configure a build-chain in which every job is a step towards production. For example: init_ws -> sanity_check -> build -> unit_test -> coverage -> package We would like to start the sanity_check with the resulting (tagged) image from the init_ws job, then use the resulting image for build step, and reuse the build result for unit and coverage steps. Then use the clean build step to create a package. If only we could pass the current jobs image tag to the next job which in turn will run that container as starting point. originally posted: https://github.com/jenkinsci/docker-plugin/issues/60

            People

            • Assignee:
              vjuranek vjuranek
              Reporter:
              aikomastboom Aiko Mastboom
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: