(CommandList
  children: [
    (C {(set)} {(-xe)})
    (C {(Lit_Other ':')} 
      {
        (BracedVarSub
          token: <VSub_Name OS>
          suffix_op: 
            (StringUnary
              op_id: VTest_ColonQMark
              arg_word: {(DQ ("Environment variable 'OS' must be set (e.g., OS=ubuntu:14.04)"))}
            )
          spids: [21 27]
        )
      }
    )
    (C {(Lit_Other ':')} 
      {
        (BracedVarSub
          token: <VSub_Name BUILDTOOL>
          suffix_op: 
            (StringUnary
              op_id: VTest_ColonQMark
              arg_word: 
                {(DQ ("Environment variable 'BUILDTOOL' must be set (e.g., BUILDTOOL=autotools)"))}
            )
          spids: [31 37]
        )
      }
    )
    (C {(Lit_Other ':')} 
      {
        (BracedVarSub
          token: <VSub_Name COMPILER>
          suffix_op: 
            (StringUnary
              op_id: VTest_ColonQMark
              arg_word: {(DQ ("Environment variable 'COMPILER' must be set (e.g., COMPILER=gcc)"))}
            )
          spids: [41 47]
        )
      }
    )
    (C {(Lit_Other ':')} 
      {
        (BracedVarSub
          token: <VSub_Name CONFIGURATION>
          suffix_op: 
            (StringUnary
              op_id: VTest_ColonQMark
              arg_word: 
                {
                  (DQ 
                    (
"Environment variable 'CONFIGURATION' must be set (e.g., CONFIGURATION='--enable-libevent --enable-ssl')"
                    )
                  )
                }
            )
          spids: [51 57]
        )
      }
    )
    (C {(Lit_Other ':')} 
      {
        (BracedVarSub
          token: <VSub_Name ENVIRONMENT>
          suffix_op: 
            (StringUnary
              op_id: VTest_ColonQMark
              arg_word: 
                {
                  (DQ 
                    (
"Environment variable 'ENVIRONMENT' must be set (e.g., ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1')"
                    )
                  )
                }
            )
          spids: [61 67]
        )
      }
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:MESOS_DIRECTORY)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (AndOr
                        children: [
                          (C {(cd)} 
                            {
                              (DQ 
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [(C {(dirname)} {(DQ ($ VSub_Number '$0'))})]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [79 87]
                                ) (/..)
                              )
                            }
                          )
                          (C {(pwd)})
                        ]
                        op_id: Op_DAmp
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [74 95]
              )
            }
          spids: [73]
        )
      ]
      spids: [73]
    )
    (C {(cd)} {(DQ ($ VSub_Name '$MESOS_DIRECTORY'))})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:DOCKERFILE)
          op: Equal
          rhs: {(DQ (Dockerfile))}
          spids: [113]
        )
      ]
      spids: [113]
    )
    (C {(rm)} {(-f)} {($ VSub_Name '$DOCKERFILE')})
    (FuncDef
      name: append_dockerfile
      body: 
        (BraceGroup
          children: [
            (SimpleCommand
              words: [{(echo)} {($ VSub_Number '$1')}]
              redirects: [
                (Redir
                  op_id: Redir_DGreat
                  fd: 16777215
                  arg_word: {($ VSub_Name '$DOCKERFILE')}
                  spids: [143]
                )
              ]
            )
          ]
          spids: [136]
        )
      spids: [132 135]
    )
    (Case
      to_match: {($ VSub_Name '$OS')}
      arms: [
        (case_arm
          pat_list: [{(centos) (Lit_Other '*')}]
          action: [
            (C {(append_dockerfile)} {(DQ ('FROM ') ($ VSub_Name '$OS'))})
            (C {(append_dockerfile)} {(DQ ('RUN yum install -y which'))})
            (C {(append_dockerfile)} {(DQ ("RUN yum groupinstall -y 'Development Tools'"))})
            (C {(append_dockerfile)} {(DQ ('RUN yum install -y epel-release'))})
            (C {(append_dockerfile)} {(DQ ('RUN yum install -y clang git maven cmake'))})
            (C {(append_dockerfile)} 
              {
                (DQ 
                  (
'RUN yum install -y java-1.8.0-openjdk-devel python-devel zlib-devel libcurl-devel openssl-devel cyrus-sasl-devel cyrus-sasl-md5 apr-devel subversion-devel apr-utils-devel libevent-devel libev-devel'
                  )
                )
              }
            )
            (C {(append_dockerfile)} {(DQ ('RUN adduser mesos'))})
          ]
          spids: [161 163 239 16777215]
        )
        (case_arm
          pat_list: [{(Lit_Other '*') (ubuntu) (Lit_Other '*')}]
          action: [
            (C {(append_dockerfile)} {(DQ ('FROM ') ($ VSub_Name '$OS'))})
            (C {(append_dockerfile)} {(DQ ('RUN rm -rf /var/lib/apt/lists/*'))})
            (AndOr
              children: [
                (C {(Lit_Other '[')} 
                  {
                    (DQ 
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(uname)} {(-m)})])
                        left_token: <Left_CommandSub '$('>
                        spids: [293 297]
                      )
                    )
                  } {(Lit_Other '=')} {(DQ (x86_64))} {(Lit_Other ']')}
                )
                (AndOr
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:CLANG_PKG)
                          op: Equal
                          rhs: {(clang-3.5)}
                          spids: [310]
                        )
                      ]
                      spids: [310]
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:CLANG_PKG)
                          op: Equal
                          rhs: {(SQ )}
                          spids: [315]
                        )
                      ]
                      spids: [315]
                    )
                  ]
                  op_id: Op_DPipe
                )
              ]
              op_id: Op_DAmp
            )
            (C {(append_dockerfile)} {(DQ ('RUN apt-get update'))})
            (C {(append_dockerfile)} 
              {
                (DQ ('RUN apt-get -y install build-essential ') ($ VSub_Name '$CLANG_PKG') 
                  (' git maven autoconf libtool cmake')
                )
              }
            )
            (C {(append_dockerfile)} 
              {
                (DQ 
                  (
'RUN apt-get -y install openjdk-7-jdk python-dev libcurl4-nss-dev libsasl2-dev libapr1-dev libsvn-dev libevent-dev libev-dev'
                  )
                )
              }
            )
            (C {(append_dockerfile)} {(DQ ('RUN apt-get -y install wget curl sed'))})
            (C {(append_dockerfile)} {(DQ ("RUN adduser --disabled-password --gecos '' mesos"))})
          ]
          spids: [242 245 360 16777215]
        )
        (case_arm
          pat_list: [{(Lit_Other '*')}]
          action: [(C {(echo)} {(DQ ('Unknown OS ') ($ VSub_Name '$OS'))}) (C {(exit)} {(1)})]
          spids: [363 364 380 16777215]
        )
      ]
      spids: [154 158 382]
    )
    (Case
      to_match: {($ VSub_Name '$COMPILER')}
      arms: [
        (case_arm
          pat_list: [{(gcc)}]
          action: [
            (C {(append_dockerfile)} {(DQ ('ENV CC gcc'))})
            (C {(append_dockerfile)} {(DQ ('ENV CXX g++'))})
          ]
          spids: [392 393 410 16777215]
        )
        (case_arm
          pat_list: [{(clang)}]
          action: [
            (Case
              to_match: {($ VSub_Name '$OS')}
              arms: [
                (case_arm
                  pat_list: [{(Lit_Other '*') (ubuntu) (Lit_Other '*')}]
                  action: [
                    (C {(append_dockerfile)} {(DQ ('ENV CC clang-3.5'))})
                    (C {(append_dockerfile)} {(DQ ('ENV CXX clang++-3.5'))})
                  ]
                  spids: [424 427 444 16777215]
                )
                (case_arm
                  pat_list: [{(Lit_Other '*')}]
                  action: [
                    (C {(append_dockerfile)} {(DQ ('ENV CC clang'))})
                    (C {(append_dockerfile)} {(DQ ('ENV CXX clang++'))})
                  ]
                  spids: [447 448 465 16777215]
                )
              ]
              spids: [417 421 468]
            )
          ]
          spids: [413 414 471 16777215]
        )
        (case_arm
          pat_list: [{(Lit_Other '*')}]
          action: [
            (C {(echo)} {(DQ ('Unknown Compiler ') ($ VSub_Name '$COMPILER'))})
            (C {(exit)} {(1)})
          ]
          spids: [474 475 491 16777215]
        )
      ]
      spids: [385 389 493]
    )
    (C {(append_dockerfile)} {(DQ ('WORKDIR mesos'))})
    (C {(append_dockerfile)} {(DQ ('COPY . /mesos/'))})
    (C {(append_dockerfile)} {(DQ ('RUN chown -R mesos /mesos'))})
    (C {(append_dockerfile)} {(DQ ('USER mesos'))})
    (C {(append_dockerfile)} {(DQ ('ENV GTEST_OUTPUT xml:report.xml'))})
    (C {(append_dockerfile)} {(DQ ('ENV DISTCHECK_CONFIGURE_FLAGS ') ($ VSub_Name '$CONFIGURATION'))})
    (C {(append_dockerfile)} {(DQ ('ENV ') ($ VSub_Name '$ENVIRONMENT'))})
    (If
      arms: [
        (if_arm
          cond: [(C {(Lit_Other '[')} {(-n)} {(DQ ($ VSub_Name '$COVERITY_TOKEN'))} {(Lit_Other ']')})]
          action: [
            (C {(append_dockerfile)} 
              {
                (DQ ('ENV MESOS_VERSION ') 
                  (CommandSubPart
                    command_list: 
                      (CommandList
                        children: [
                          (Pipeline
                            children: [
                              (C {(grep)} {(DQ (AC_INIT))} {(configure.ac)})
                              (C {(sed)} {(SQ <'s/AC_INIT[(]\\[mesos\\], \\[\\(.*\\)\\][)]/\\1/'>)})
                            ]
                            negated: False
                          )
                        ]
                      )
                    left_token: <Left_CommandSub '$('>
                    spids: [609 625]
                  )
                )
              }
            )
            (C {(append_dockerfile)} 
              {
                (DQ ('RUN wget https://scan.coverity.com/download/linux64  --post-data ') 
                  (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('token=') ($ VSub_Name '$COVERITY_TOKEN') ('&project=Mesos') 
                  (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' -O coverity_tool.tgz')
                )
              }
            )
            (C {(append_dockerfile)} 
              {(DQ ('RUN tar xvf coverity_tool.tgz; mv cov-analysis-linux* cov-analysis'))}
            )
            (C {(append_dockerfile)} 
              {
                (DQ ('CMD ./bootstrap && ./configure ') ($ VSub_Name '$CONFIGURATION') 
                  (
' &&  cov-analysis/bin/cov-build -dir cov-int make -j6 && tar czcf mesos.tgz cov-int && tail cov-int/build-log.txt && curl --form '
                  ) (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('token=') ($ VSub_Name '$COVERITY_TOKEN') 
                  (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' --form ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('email=dev@mesos.apache.org') 
                  (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('  --form ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('file=@mesos.tgz') 
                  (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' --form ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('version=') 
                  ($ VSub_Name '$MESOS_VERSION') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' --form ') 
                  (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ("description='Continious Coverity Build'") (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) 
                  ('   https://scan.coverity.com/builds?project=Mesos')
                )
              }
            )
          ]
          spids: [16777215 593]
        )
      ]
      else_action: [
        (Case
          to_match: {($ VSub_Name '$BUILDTOOL')}
          arms: [
            (case_arm
              pat_list: [{(autotools)}]
              action: [
                (C {(append_dockerfile)} 
                  {
                    (DQ ('CMD ./bootstrap && ./configure ') ($ VSub_Name '$CONFIGURATION') 
                      (' && make -j6 distcheck 2>&1')
                    )
                  }
                )
              ]
              spids: [693 694 706 16777215]
            )
            (case_arm
              pat_list: [{(cmake)}]
              action: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:CONFIGURATION)
                      op: Equal
                      rhs: 
                        {
                          (BracedVarSub
                            token: <VSub_Name CONFIGURATION>
                            suffix_op: 
                              (PatSub
                                pat: {(EscapedLiteralPart token:<Lit_EscapedChar "\\'">)}
                                replace: {(DQ )}
                                do_all: True
                                do_prefix: False
                                do_suffix: False
                              )
                            spids: [722 730]
                          )
                        }
                      spids: [721]
                    )
                  ]
                  spids: [721]
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:CONFIGURATION)
                      op: Equal
                      rhs: 
                        {
                          (BracedVarSub
                            token: <VSub_Name CONFIGURATION>
                            suffix_op: 
                              (PatSub
                                pat: {(-)}
                                replace: {(DQ (_))}
                                do_all: True
                                do_prefix: False
                                do_suffix: False
                              )
                            spids: [738 747]
                          )
                        }
                      spids: [737]
                    )
                  ]
                  spids: [737]
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:CONFIGURATION)
                      op: Equal
                      rhs: 
                        {
                          (BracedVarSub
                            token: <VSub_Name CONFIGURATION>
                            suffix_op: 
                              (PatSub
                                pat: {(__)}
                                replace: {(DQ (-D))}
                                do_all: True
                                do_prefix: False
                                do_suffix: False
                              )
                            spids: [755 764]
                          )
                        }
                      spids: [754]
                    )
                  ]
                  spids: [754]
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:CONFIGURATION)
                      op: Equal
                      rhs: 
                        {
                          (BracedVarSub
                            token: <VSub_Name CONFIGURATION>
                            suffix_op: (StringUnary op_id:VOp1_DCaret arg_word:{})
                            spids: [772 775]
                          )
                        }
                      spids: [771]
                    )
                  ]
                  spids: [771]
                )
                (SimpleCommand
                  words: [{(read)} {(-r)} {(-a)} {(array)}]
                  redirects: [
                    (Redir
                      op_id: Redir_TLess
                      fd: 16777215
                      arg_word: {(DQ ($ VSub_Name '$CONFIGURATION'))}
                      spids: [796]
                    )
                  ]
                  more_env: [(env_pair name:IFS val:{(SQ <' '>)} spids:[783])]
                )
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:CONFIGURATION)
                      op: Equal
                      rhs: {(DQ )}
                      spids: [804]
                    )
                  ]
                  spids: [804]
                )
                (ForEach
                  iter_name: element
                  iter_words: [
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name array>
                          bracket_op: (WholeArray op_id:Lit_At)
                          spids: [816 821]
                        )
                      )
                    }
                  ]
                  do_arg_iter: False
                  body: 
                    (DoGroup
                      children: [
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:CONFIGURATION)
                              op: Equal
                              rhs: 
                                {
                                  (DQ ($ VSub_Name '$CONFIGURATION') (' ') ($ VSub_Name '$element') 
                                    ('=1')
                                  )
                                }
                              spids: [828]
                            )
                          ]
                          spids: [828]
                        )
                      ]
                      spids: [825 837]
                    )
                  spids: [814 16777215]
                )
                (C {(append_dockerfile)} 
                  {
                    (DQ ('CMD ./bootstrap && mkdir build && cd build && cmake ') 
                      ($ VSub_Name '$CONFIGURATION') (' .. && make -j6 check && make -j6')
                    )
                  }
                )
              ]
              spids: [709 710 866 16777215]
            )
            (case_arm
              pat_list: [{(Lit_Other '*')}]
              action: [
                (C {(echo)} {(DQ ('Unknown build tool ') ($ VSub_Name '$BUILDTOOL'))})
                (C {(exit)} {(1)})
              ]
              spids: [869 870 886 16777215]
            )
          ]
          spids: [686 690 889]
        )
      ]
      spids: [679 891]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:TAG)
          op: Equal
          rhs: 
            {(mesos-) 
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [(C {(date)} {(Lit_Other '+') (Lit_Other '%') (s)})]
                  )
                left_token: <Left_Backtick '`'>
                spids: [899 905]
              ) (-) ($ VSub_Name '$RANDOM')
            }
          spids: [897]
        )
      ]
      spids: [897]
    )
    (C {(docker)} {(build)} {(--no-cache) (Lit_Other '=') (true)} {(-t)} {($ VSub_Name '$TAG')} {(.)})
    (C {(trap)} {(DQ ('docker rmi ') ($ VSub_Name '$TAG'))} {(EXIT)})
    (C {(docker)} {(run)} {(--privileged)} {(--rm)} {($ VSub_Name '$TAG')})
  ]
)