(CommandList
  children: [
    (C {(set)} {(Lit_Other '+') (xe)})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:SCRIPT_VER)
          op: Equal
          rhs: {(DQ ('Wed Apr 20 18:30:19 UTC 2016'))}
          spids: [11]
        )
      ]
      spids: [11]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:ec) op:Equal rhs:{(0)} spids:[60])]
      spids: [60]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:uniques) op:Equal rhs:{(1)} spids:[63])]
      spids: [63]
    )
    (C {(echo)} {(INFO) (Lit_Other ':')} {(Started)} {(at)} 
      {
        (CommandSubPart
          command_list: (CommandList children:[(C {(date)})])
          left_token: <Left_Backtick '`'>
          spids: [75 77]
        ) (.)
      } {(Script)} {(version)} {($ VSub_Name '$SCRIPT_VER')}
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:ip)
          op: Equal
          rhs: 
            {
              (DQ 
                (BracedVarSub
                  token: <VSub_Name DOCKER_HOST>
                  suffix_op: 
                    (StringUnary
                      op_id: VOp1_Pound
                      arg_word: {('*:') (Lit_Slash /) (Lit_Slash /)}
                    )
                  spids: [115 121]
                )
              )
            }
          spids: [113]
        )
      ]
      spids: [113]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:port_outer)
          op: Equal
          rhs: 
            {
              (DQ 
                (BracedVarSub
                  token: <VSub_Name ip>
                  suffix_op: (StringUnary op_id:VOp1_Pound arg_word:{('*:')})
                  spids: [126 130]
                )
              )
            }
          spids: [124]
        )
      ]
      spids: [124]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:port_inner)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (Pipeline
                        children: [
                          (C {(echo)} {(DQ ($ VSub_Name '$port_outer'))})
                          (C {(sed)} {(-E)} {(SQ <'s/(.)(.)$/\\2\\1/'>)})
                        ]
                        negated: False
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [137 153]
              )
            }
          spids: [136]
        )
      ]
      spids: [136]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:ip)
          op: Equal
          rhs: 
            {
              (DQ 
                (BracedVarSub
                  token: <VSub_Name ip>
                  suffix_op: (StringUnary op_id:VOp1_DPercent arg_word:{(':*')})
                  spids: [157 161]
                )
              )
            }
          spids: [155]
        )
      ]
      spids: [155]
    )
    (C {(echo)} 
      {
        (DQ ('INFO: IP=') ($ VSub_Name '$ip') (' PORT_OUTER=') ($ VSub_Name '$port_outer') 
          (' PORT_INNER=') ($ VSub_Name '$port_inner')
        )
      }
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other '[')} {(-n)} {(DQ ($ VSub_Name '$DOCKER_TLS_VERIFY'))} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:protocol) op:Equal rhs:{(https)} spids:[196])]
              spids: [196]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(-z)} {(DQ ($ VSub_Name '$DOCKER_MACHINE_NAME'))} 
                          {(Lit_Other ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [(assign_pair lhs:(LhsName name:ec) op:Equal rhs:{(1)} spids:[216])]
                      spids: [216]
                    )
                    (C {(echo)} {(DQ ('ERROR: DOCKER_MACHINE_NAME is undefined'))})
                  ]
                  spids: [16777215 213]
                )
              ]
              spids: [16777215 227]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:certs)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (C {(echo)} 
                                {(TildeSubPart prefix:'') (/.docker/machine/machines/) 
                                  ($ VSub_Name '$DOCKER_MACHINE_NAME')
                                }
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [231 237]
                      )
                    }
                  spids: [230]
                )
              ]
              spids: [230]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:curlopts)
                  op: Equal
                  rhs: 
                    {
                      (DQ ('--cacert ') ($ VSub_Name '$certs') ('/ca.pem --cert ') 
                        ($ VSub_Name '$certs') ('/cert.pem --key ') ($ VSub_Name '$certs') (/key.pem)
                      )
                    }
                  spids: [240]
                )
              ]
              spids: [240]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:run_extra_args)
                  op: Equal
                  rhs: {(DQ ('-v tlscerts:/etc/docker'))}
                  spids: [252]
                )
              ]
              spids: [252]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:daemon_extra_args)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (
'--tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem'
                        )
                      )
                    }
                  spids: [258]
                )
              ]
              spids: [258]
            )
          ]
          spids: [16777215 193]
        )
      ]
      else_action: [
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:protocol) op:Equal rhs:{(http)} spids:[266])]
          spids: [266]
        )
      ]
      spids: [263 269]
    )
    (C {(export)} 
      {(Lit_VarLike 'MAIN_DOCKER_HOST=') 
        (DQ ('tcp://') ($ VSub_Name '$ip') (':') ($ VSub_Name '$port_inner'))
      }
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:reply)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (C {(curl)} {(-s)} {($ VSub_Name '$curlopts')} 
                                {($ VSub_Name '$protocol') (Lit_Other ':') (//) ($ VSub_Name '$ip') 
                                  (Lit_Other ':') ($ VSub_Name '$port_outer') (/_ping)
                                }
                              )
                            ]
                          )
                        left_token: <Left_Backtick '`'>
                        spids: [306 320]
                      )
                    }
                  spids: [305]
                )
              ]
              spids: [305]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$reply'))} 
                          {(KW_Bang '!') (Lit_Other '=')} {(DQ (OK))} {(Lit_Other ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [(assign_pair lhs:(LhsName name:ec) op:Equal rhs:{(1)} spids:[344])]
                      spids: [344]
                    )
                    (C {(echo)} 
                      {
                        (DQ 
                          (
"ERROR: Failed to get an 'OK' response from the docker daemon on the Linux node"
                          )
                        )
                      }
                    )
                    (C {(echo)} 
                      {
                        (DQ ('       at ') ($ VSub_Name '$ip') (':') ($ VSub_Name '$port_outer') 
                          (" when called with an http request for '_ping'. This implies that")
                        )
                      }
                    )
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'       either the daemon has crashed/is not running, or the Linux node is unavailable.'
                          )
                        )
                      }
                    )
                    (C {(echo)})
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'       A regular ping to the remote Linux node is below. It should reply. If not, the'
                          )
                        )
                      }
                    )
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'       machine cannot be reached at all and may have crashed. If it does reply, it is'
                          )
                        )
                      }
                    )
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'       likely a case of the Linux daemon not running or having crashed, which requires'
                          )
                        )
                      }
                    )
                    (C {(echo)} {(DQ ('       further investigation.'))})
                    (C {(echo)})
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'       Try re-running this CI job, or ask on #docker-dev or #docker-maintainers'
                          )
                        )
                      }
                    )
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'       for someone to perform further diagnostics, or take this node out of rotation.'
                          )
                        )
                      }
                    )
                    (C {(echo)})
                    (C {(ping)} {($ VSub_Name '$ip')})
                  ]
                  spids: [16777215 341]
                )
              ]
              else_action: [
                (C {(echo)} {(DQ ('INFO: The Linux nodes outer daemon replied to a ping. Good!'))})
              ]
              spids: [429 439]
            )
          ]
          spids: [16777215 302]
        )
      ]
      spids: [16777215 442]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:remoteVersion)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(curl)} {(-s)} {($ VSub_Name '$curlopts')} 
                                    {($ VSub_Name '$protocol') (Lit_Other ':') (//) 
                                      ($ VSub_Name '$ip') (Lit_Other ':') ($ VSub_Name '$port_outer') (/version)
                                    }
                                  )
                                  (C {(jq)} {(-c)} {(SQ <.Version>)})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_Backtick '`'>
                        spids: [468 492]
                      )
                    }
                  spids: [467]
                )
              ]
              spids: [467]
            )
            (C {(echo)} 
              {
                (DQ ('INFO: Remote daemon is running docker version ') ($ VSub_Name '$remoteVersion'))
              }
            )
          ]
          spids: [16777215 464]
        )
      ]
      spids: [16777215 502]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:uniques)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(docker)} {(version)})
                                  (C {(grep)} {(Version)})
                                  (C {(/usr/bin/sort)} {(-u)})
                                  (C {(wc)} {(-l)})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_Backtick '`'>
                        spids: [525 547]
                      )
                    }
                  spids: [524]
                )
              ]
              spids: [524]
            )
          ]
          spids: [16777215 521]
        )
      ]
      spids: [16777215 549]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-d)} {(hack)} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'ERROR: Are you sure this is being launched from a the root of docker repository?'
                          )
                        )
                      }
                    )
                    (C {(echo)} 
                      {
                        (DQ ('       If this is a Windows CI machine, it should be c:') 
                          (Lit_Other '\\') (jenkins) (Lit_Other '\\') (gopath) (Lit_Other '\\') (src) (Lit_Other '\\') (github.com) (Lit_Other '\\') 
                          (docker) (Lit_Other '\\') (docker.)
                        )
                      }
                    )
                    (C {(echo)} 
                      {
                        (DQ ('       Current directory is ') 
                          (CommandSubPart
                            command_list: (CommandList children:[(C {(pwd)})])
                            left_token: <Left_Backtick '`'>
                            spids: [617 619]
                          )
                        )
                      }
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [(assign_pair lhs:(LhsName name:ec) op:Equal rhs:{(1)} spids:[623])]
                      spids: [623]
                    )
                  ]
                  spids: [16777215 584]
                )
              ]
              spids: [16777215 627]
            )
          ]
          spids: [16777215 568]
        )
      ]
      spids: [16777215 629]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other '[')} 
                  {
                    (CommandSubPart
                      command_list: 
                        (CommandList
                          children: [
                            (Pipeline
                              children: [
                                (C {(grep)} {(DOCKER_CLIENTONLY)} {(Makefile)})
                                (C {(wc)} {(-l)})
                              ]
                              negated: False
                            )
                          ]
                        )
                      left_token: <Left_Backtick '`'>
                      spids: [639 651]
                    )
                  } {(-gt)} {(0)} {(Lit_Other ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:splitBinary) op:Equal rhs:{(0)} spids:[663])]
              spids: [663]
            )
            (C {(echo)} {(DQ ('INFO: Running in single binary mode'))})
          ]
          spids: [16777215 660]
        )
      ]
      else_action: [
        (Assignment
          keyword: Assign_None
          pairs: [(assign_pair lhs:(LhsName name:splitBinary) op:Equal rhs:{(1)} spids:[676])]
          spids: [676]
        )
        (C {(echo)} {(DQ ('INFO: Running in split binary mode'))})
      ]
      spids: [673 686]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(export)} 
              {(Lit_VarLike 'COMMITHASH=') 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [(C {(git)} {(rev-parse)} {(--short)} {(HEAD)})]
                    )
                  left_token: <Left_CommandSub '$('>
                  spids: [712 720]
                )
              }
            )
            (C {(echo)} {(INFO) (Lit_Other ':')} {(Commit)} {(hash)} {(is)} {($ VSub_Name '$COMMITHASH')})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(-z)} {($ VSub_Name '$COMMITHASH')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'ERROR: Failed to get commit hash. Are you sure this is a docker repository?'
                          )
                        )
                      }
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [(assign_pair lhs:(LhsName name:ec) op:Equal rhs:{(1)} spids:[758])]
                      spids: [758]
                    )
                  ]
                  spids: [16777215 748]
                )
              ]
              spids: [16777215 762]
            )
          ]
          spids: [16777215 706]
        )
      ]
      spids: [16777215 764]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(export)} {(Lit_VarLike 'TEMP=') (/c/CI/CI-) ($ VSub_Name '$COMMITHASH')})
            (C {(export)} {(Lit_VarLike 'TMP=') ($ VSub_Name '$TEMP')})
            (C {(/usr/bin/mkdir)} {(-p)} {($ VSub_Name '$TEMP')})
          ]
          spids: [16777215 792]
        )
      ]
      spids: [16777215 817]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} {(INFO) (Lit_Other ':')} {(Deleting)} {(pre-existing)} {(containers)} {(and)} 
              {(images...)}
            )
            (Sentence
              child: 
                (Pipeline
                  children: [
                    (C {(docker)} {(rm)} {(-f)} 
                      {
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (C {(docker)} {(ps)} {(-aq)} {(--filter)} 
                                  {(DQ ('ancestor=docker:') ($ VSub_Name '$COMMITHASH'))}
                                )
                              ]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [869 882]
                        )
                      }
                    )
                  ]
                  negated: True
                )
              terminator: <Op_Amp '&'>
            )
            (SimpleCommand
              redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[885])]
            )
            (Sentence
              child: 
                (Pipeline
                  children: [
                    (C {(docker)} {(rm)} {(-f)} 
                      {
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (C {(docker)} {(ps)} {(-aq)} {(--filter)} 
                                  {(DQ ('name=docker-') ($ VSub_Name '$COMMITHASH'))}
                                )
                              ]
                            )
                          left_token: <Left_CommandSub '$('>
                          spids: [903 916]
                        )
                      }
                    )
                  ]
                  negated: True
                )
              terminator: <Op_Amp '&'>
            )
            (SimpleCommand
              redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[919])]
            )
            (Pipeline
              children: [
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (C {(Lit_Other '[')} {(KW_Bang '!')} 
                              {
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [
                                        (Pipeline
                                          children: [(C {(docker)} {(ps)} {(-aq)}) (C {(wc)} {(-l)})]
                                          negated: False
                                        )
                                      ]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [940 952]
                                )
                              } {(-eq)} {(0)} {(Lit_Other ']')}
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (C {(echo)} {(WARN) (Lit_Other ':')} {(There)} {(were)} {(some)} {(leftover)} 
                          {(containers.)} {(Cleaning)} {(them)} {(up.)}
                        )
                        (Pipeline
                          children: [
                            (C {(docker)} {(rm)} {(-f)} 
                              {
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [(C {(docker)} {(ps)} {(-aq)})]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [994 1000]
                                )
                              }
                            )
                          ]
                          negated: True
                        )
                      ]
                      spids: [16777215 961]
                    )
                  ]
                  spids: [16777215 1003]
                )
              ]
              negated: True
            )
            (Sentence
              child: 
                (Pipeline
                  children: [(C {(docker)} {(rmi)} {(-f)} {(DQ (docker-) ($ VSub_Name '$COMMITHASH'))})]
                  negated: True
                )
              terminator: <Op_Amp '&'>
            )
            (SimpleCommand
              redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[1026])]
            )
          ]
          spids: [16777215 836]
        )
      ]
      spids: [16777215 1029]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} {(INFO) (Lit_Other ':')} {(Docker)} {(version)} {(and)} {(info)} {(of)} {(the)} 
              {(outer)} {(daemon)} {(on)} {(the)} {(Linux)} {(node)}
            )
            (C {(echo)})
            (C {(docker)} {(version)})
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:ec)
                  op: Equal
                  rhs: {($ VSub_QMark '$?')}
                  spids: [1092]
                )
              ]
              spids: [1092]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(0)} {(-ne)} {($ VSub_Name '$ec')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'ERROR: The main linux daemon does not appear to be running. Has the Linux node crashed?'
                          )
                        )
                      }
                    )
                  ]
                  spids: [16777215 1109]
                )
              ]
              spids: [16777215 1119]
            )
            (C {(echo)})
          ]
          spids: [16777215 1051]
        )
      ]
      spids: [16777215 1124]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)})
            (C {(docker)} {(info)})
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:ec)
                  op: Equal
                  rhs: {($ VSub_QMark '$?')}
                  spids: [1154]
                )
              ]
              spids: [1154]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(0)} {(-ne)} {($ VSub_Name '$ec')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (
'ERROR: The main linux daemon does not appear to be running. Has the Linux node crashed?'
                          )
                        )
                      }
                    )
                  ]
                  spids: [16777215 1171]
                )
              ]
              spids: [16777215 1181]
            )
            (C {(echo)})
          ]
          spids: [16777215 1143]
        )
      ]
      spids: [16777215 1186]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} 
              {(DQ ('INFO: Running docker build on Linux host at ') ($ VSub_Name '$DOCKER_HOST'))}
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {($ VSub_Name '$splitBinary')} {(-eq)} {(0)} 
                          {(Lit_Other ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(set)} {(-x)})
                    (C {(docker)} {(build)} {(--rm)} {(--force-rm)} {(--build-arg)} 
                      {(Lit_VarLike 'APT_MIRROR=') (cdn-fastly.deb.debian.org)} {(-t)} {(DQ ('docker:') ($ VSub_Name '$COMMITHASH'))} {(.)}
                    )
                    (Pipeline
                      children: [
                        (SimpleCommand
                          words: [{(cat)}]
                          redirects: [
                            (HereDoc
                              op_id: Redir_DLess
                              fd: 16777215
                              body: 
                                {
                                  (DQ ('FROM docker:') ($ VSub_Name '$COMMITHASH') ('\n') 
                                    ('RUN hack/make.sh binary\n') ('RUN cp bundles/latest/binary/docker /bin/docker \n') ('CMD dockerd -D -H tcp://0.0.0.0:') 
                                    ($ VSub_Name '$port_inner') (' ') ($ VSub_Name '$daemon_extra_args') ('\n')
                                  )
                                }
                              do_expansion: True
                              here_end: EOF
                              was_filled: True
                              spids: [1262]
                            )
                          ]
                        )
                        (C {(docker)} {(build)} {(--rm)} {(--force-rm)} {(-t)} 
                          {(DQ ('docker:') ($ VSub_Name '$COMMITHASH'))} {(-)}
                        )
                      ]
                      negated: False
                    )
                  ]
                  spids: [16777215 1229]
                )
              ]
              else_action: [
                (C {(set)} {(-x)})
                (C {(docker)} {(build)} {(--rm)} {(--force-rm)} {(--build-arg)} 
                  {(Lit_VarLike 'APT_MIRROR=') (cdn-fastly.deb.debian.org)} {(-t)} {(DQ ('docker:') ($ VSub_Name '$COMMITHASH'))} {(.)}
                )
                (Pipeline
                  children: [
                    (SimpleCommand
                      words: [{(cat)}]
                      redirects: [
                        (HereDoc
                          op_id: Redir_DLess
                          fd: 16777215
                          body: 
                            {
                              (DQ ('FROM docker:') ($ VSub_Name '$COMMITHASH') ('\n') 
                                ('RUN hack/make.sh binary\n') ('RUN cp bundles/latest/binary-daemon/dockerd /bin/dockerd \n') ('CMD dockerd -D -H tcp://0.0.0.0:') 
                                ($ VSub_Name '$port_inner') (' ') ($ VSub_Name '$daemon_extra_args') ('\n')
                              )
                            }
                          do_expansion: True
                          here_end: EOF
                          was_filled: True
                          spids: [1329]
                        )
                      ]
                    )
                    (C {(docker)} {(build)} {(--rm)} {(--force-rm)} {(-t)} 
                      {(DQ ('docker:') ($ VSub_Name '$COMMITHASH'))} {(-)}
                    )
                  ]
                  negated: False
                )
              ]
              spids: [1296 1364]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:ec)
                  op: Equal
                  rhs: {($ VSub_QMark '$?')}
                  spids: [1367]
                )
              ]
              spids: [1367]
            )
            (C {(set)} {(Lit_Other '+') (x)})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(0)} {(-ne)} {($ VSub_Name '$ec')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(echo)} {(DQ ('ERROR: docker build failed'))})]
                  spids: [16777215 1390]
                )
              ]
              spids: [16777215 1400]
            )
          ]
          spids: [16777215 1205]
        )
      ]
      spids: [16777215 1402]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} 
              {(DQ ('INFO: Starting build of a Linux daemon to test against, and starting it...'))}
            )
            (C {(set)} {(-x)})
            (C {(docker)} {(run)} {(-d)} {($ VSub_Name '$run_extra_args')} {(-e)} 
              {(Lit_VarLike 'DOCKER_GRAPHDRIVER=') (aufs)} {(--pid)} {(host)} {(--privileged)} {(--name)} {(DQ (docker-) ($ VSub_Name '$COMMITHASH'))} {(--net)} 
              {(host)} {(DQ ('docker:') ($ VSub_Name '$COMMITHASH'))}
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:ec)
                  op: Equal
                  rhs: {($ VSub_QMark '$?')}
                  spids: [1476]
                )
              ]
              spids: [1476]
            )
            (C {(set)} {(Lit_Other '+') (x)})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(0)} {(-ne)} {($ VSub_Name '$ec')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(echo)} {(DQ ('ERROR: Failed to compile and start the linux daemon'))})]
                  spids: [16777215 1499]
                )
              ]
              spids: [16777215 1509]
            )
          ]
          spids: [16777215 1421]
        )
      ]
      spids: [16777215 1511]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} {(DQ ('INFO: Starting local build of Windows binary...'))})
            (C {(set)} {(-x)})
            (C {(export)} {(Lit_VarLike 'TIMEOUT=') (DQ (120m))})
            (C {(export)} 
              {(Lit_VarLike 'DOCKER_HOST=') 
                (DQ ('tcp://') ($ VSub_Name '$ip') (':') ($ VSub_Name '$port_inner'))
              }
            )
            (C {(export)} 
              {(Lit_VarLike 'DOCKER_TEST_HOST=') 
                (DQ ('tcp://') ($ VSub_Name '$ip') (':') ($ VSub_Name '$port_inner'))
              }
            )
            (C {(unset)} {(DOCKER_CLIENTONLY)})
            (C {(export)} {(Lit_VarLike 'DOCKER_REMOTE_DAEMON=') (1)})
            (C {(hack/make.sh)} {(binary)})
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:ec)
                  op: Equal
                  rhs: {($ VSub_QMark '$?')}
                  spids: [1596]
                )
              ]
              spids: [1596]
            )
            (C {(set)} {(Lit_Other '+') (x)})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(0)} {(-ne)} {($ VSub_Name '$ec')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(echo)} {(DQ ('ERROR: Build of binary on Windows failed'))})]
                  spids: [16777215 1619]
                )
              ]
              spids: [16777215 1629]
            )
          ]
          spids: [16777215 1530]
        )
      ]
      spids: [16777215 1631]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:VERSION)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (SimpleCommand
                                redirects: [
                                  (Redir
                                    op_id: Redir_Less
                                    fd: 16777215
                                    arg_word: {(./VERSION)}
                                    spids: [1655]
                                  )
                                ]
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [1654 1658]
                      )
                    }
                  spids: [1653]
                )
              ]
              spids: [1653]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {($ VSub_Name '$splitBinary')} {(-eq)} {(0)} 
                          {(Lit_Other ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(cp)} {(bundles/) ($ VSub_Name '$VERSION') (/binary/docker.exe)} 
                      {($ VSub_Name '$TEMP')}
                    )
                  ]
                  spids: [16777215 1674]
                )
              ]
              else_action: [
                (C {(cp)} {(bundles/) ($ VSub_Name '$VERSION') (/binary-client/docker.exe)} 
                  {($ VSub_Name '$TEMP')}
                )
              ]
              spids: [1686 1698]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:ec)
                  op: Equal
                  rhs: {($ VSub_QMark '$?')}
                  spids: [1701]
                )
              ]
              spids: [1701]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(0)} {(-ne)} {($ VSub_Name '$ec')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('ERROR: Failed to copy built binary to ') ($ VSub_Name '$TEMP'))})
                  ]
                  spids: [16777215 1718]
                )
              ]
              spids: [16777215 1729]
            )
            (C {(export)} 
              {(Lit_VarLike 'PATH=') ($ VSub_Name '$TEMP') (Lit_Other ':') ($ VSub_Name '$PATH')}
            )
          ]
          spids: [16777215 1650]
        )
      ]
      spids: [16777215 1739]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} {(DQ ('INFO: Running Integration tests...'))})
            (C {(set)} {(-x)})
            (C {(export)} 
              {(Lit_VarLike 'DOCKER_TEST_TLS_VERIFY=') (DQ ($ VSub_Name '$DOCKER_TLS_VERIFY'))}
            )
            (C {(export)} 
              {(Lit_VarLike 'DOCKER_TEST_CERT_PATH=') (DQ ($ VSub_Name '$DOCKER_CERT_PATH'))}
            )
            (C {(hack/make.sh)} {(test-integration-cli)})
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:ec)
                  op: Equal
                  rhs: {($ VSub_QMark '$?')}
                  spids: [1799]
                )
              ]
              spids: [1799]
            )
            (C {(set)} {(Lit_Other '+') (x)})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(0)} {(-ne)} {($ VSub_Name '$ec')} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ('ERROR: CLI test failed.'))})
                    (C {(docker)} {(-H) (Lit_Other '=') ($ VSub_Name '$MAIN_DOCKER_HOST')} {(logs)} 
                      {(--tail)} {(100)} {(DQ (docker-) ($ VSub_Name '$COMMITHASH'))}
                    )
                  ]
                  spids: [16777215 1822]
                )
              ]
              spids: [16777215 1854]
            )
          ]
          spids: [16777215 1758]
        )
      ]
      spids: [16777215 1856]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {($ VSub_Name '$COMMITHASH')} 
                  {(Lit_Other ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(C {(rm)} {(-rf)} {($ VSub_Name '$TEMP')})]
          spids: [16777215 1875]
        )
      ]
      spids: [16777215 1884]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:GOVER_DOCKERFILE)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (Pipeline
                        children: [
                          (C {(grep)} {(SQ <'ENV GO_VERSION'>)} {(Dockerfile)})
                          (C {(awk)} {(SQ <'{print $3}'>)})
                        ]
                        negated: False
                      )
                    ]
                  )
                left_token: <Left_Backtick '`'>
                spids: [1891 1907]
              )
            }
          spids: [1890]
        )
      ]
      spids: [1890]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:GOVER_INSTALLED)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (Pipeline
                        children: [(C {(go)} {(version)}) (C {(awk)} {(SQ <'{print $3}'>)})]
                        negated: False
                      )
                    ]
                  )
                left_token: <Left_Backtick '`'>
                spids: [1910 1922]
              )
            }
          spids: [1909]
        )
      ]
      spids: [1909]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other '[')} 
                  {
                    (DQ 
                      (BracedVarSub
                        token: <VSub_Name GOVER_INSTALLED>
                        suffix_op: (Slice begin:(ArithWord w:{(Lit_Digits 2)}))
                        spids: [1929 1933]
                      )
                    )
                  } {(KW_Bang '!') (Lit_Other '=')} {(DQ ($ VSub_Name '$GOVER_DOCKERFILE'))} {(Lit_Other ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)})
            (C {(echo)} 
              {(DQ (---------------------------------------------------------------------------))}
            )
            (C {(echo)} 
              {
                (DQ ('WARN: CI should be using go version ') ($ VSub_Name '$GOVER_DOCKERFILE') 
                  (', but is using ') 
                  (BracedVarSub
                    token: <VSub_Name GOVER_INSTALLED>
                    suffix_op: (Slice begin:(ArithWord w:{(Lit_Digits 2)}))
                    spids: [1969 1973]
                  )
                )
              }
            )
            (C {(echo)} 
              {(DQ ('      Please ping #docker-maintainers on IRC to get this CI server updated.'))}
            )
            (C {(echo)} 
              {(DQ (---------------------------------------------------------------------------))}
            )
            (C {(echo)})
          ]
          spids: [16777215 1946]
        )
      ]
      spids: [16777215 1993]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$uniques'))} {(-ne)} {(1)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:ec) op:Equal rhs:{(0)} spids:[2017])]
              spids: [2017]
            )
            (C {(echo)})
            (C {(echo)} 
              {(DQ (---------------------------------------------------------------------------))}
            )
            (C {(echo)} 
              {(DQ ('ERROR: This CI node is not running the same version of docker as the daemon.'))}
            )
            (C {(echo)} {(DQ ('       This is a CI configuration issue.'))})
            (C {(echo)} 
              {(DQ (---------------------------------------------------------------------------))}
            )
            (C {(echo)})
          ]
          spids: [16777215 2014]
        )
      ]
      spids: [16777215 2057]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Name '$ec')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} {(INFO) (Lit_Other ':')} {(Completed)} {(successfully)} {(at)} 
              {
                (CommandSubPart
                  command_list: (CommandList children:[(C {(date)})])
                  left_token: <Left_Backtick '`'>
                  spids: [2090 2092]
                ) (.)
              }
            )
          ]
          spids: [16777215 2076]
        )
      ]
      else_action: [
        (C {(echo)} {(ERROR) (Lit_Other ':')} {(Failed)} {(with)} {(exitcode)} {($ VSub_Name '$ec')} {(at)} 
          {
            (CommandSubPart
              command_list: (CommandList children:[(C {(date)})])
              left_token: <Left_Backtick '`'>
              spids: [2114 2116]
            ) (.)
          }
        )
      ]
      spids: [2096 2119]
    )
    (C {(exit)} {($ VSub_Name '$ec')})
  ]
)