Bamboo Specs export with multiline Dockerfile produces invalid Java

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 9.0.0
    • Affects Version/s: 8.2.3
    • Component/s: Bamboo Specs
    • None
    • 1
    • Severity 3 - Minor

      Issue Summary

      Bamboo Specs export with multiline Dockerfile produces invalid Java

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Add a Docker task of type Build to your build plan
      2. Add a multiline Dockerfile such as:
        FROM node:12-alpine
        RUN apk add --no-cache python2 g++ make
        
      3. Plan Configuration >> Actions >> Export as Java Specs

      Expected Results

      Java generated is valid

      Actual Results

      The Java generated is invalid, it contains a multiline string:

       new DockerBuildImageTask()
               .imageName("asdsadas")
               .useCache(true)
               .dockerfile("FROM node:12.18.1
      RUN apk add --no-cache python2 g++ make"),
      

      This causes compilation errors when publishing:

      [ERROR] COMPILATION ERROR :
      [INFO] -------------------------------------------------------------
      [ERROR] /Users/user/stored-spec/bamboo-specs/src/main/java/tutorial/PlanSpec.java:[47,49] unclosed string literal
      

      Workaround

      Manually change the Java Spec after exporting it to use newline characters E.g.

           .dockerfile("FROM node:12.18.1\nRUN apk add --no-cache python2 g++ make"),
      

              Assignee:
              Mateusz Szmal
              Reporter:
              Jeremy Owen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: