(List (Com {[LIT_CHARS set]} {[LIT_CHARS -e]} ) (FunctionDef cleanup [] (Com {[LIT_CHARS rm]} {[LIT_CHARS -rf]} {[LIT_CHARS flannel] [LIT_OTHER "*"]} {[LIT_CHARS kubernetes] [LIT_OTHER "*"]} {[LIT_CHARS etcd] [LIT_OTHER "*"]} {[LIT_CHARS binaries]} {[LIT_CHARS out]} ) ) (Com {[LIT_CHARS trap]} {[LIT_CHARS cleanup]} {[LIT_CHARS SIGHUP]} {[LIT_CHARS SIGINT]} {[LIT_CHARS SIGTERM]} ) (Com {[LIT_CHARS pushd]} {[ComSub (Com {[LIT_CHARS dirname]} {[VarSub 0]})]} ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[LIT_CHARS binaries/master]} ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[LIT_CHARS binaries/minion]} ) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[LIT_CHARS out]} ) (= scope= flags=0 words=[] bindings=[('FLANNEL_VERSION', {[VarSub FLANNEL_VERSION test_op=VS_TEST_COLON_HYPHEN {[DQ [LIT_CHARS 0.5.5]]}]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Prepare flannel "][VarSub FLANNEL_VERSION][LIT_CHARS " release ..."]]} ) (AndOr OP_OR_IF (Com {[LIT_CHARS grep]} {[LIT_CHARS -q]} {[DQ [LIT_CHARS "^"][VarSub FLANNEL_VERSION][\ LIT_ESCAPED_CHAR "\\$"]]} {[LIT_CHARS binaries/.flannel]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) (List (AndOr OP_OR_IF (Subshell (AndOr OP_AND_IF (Com {[LIT_CHARS curl]} {[LIT_CHARS --fail]} {[LIT_CHARS -L]} {[LIT_CHARS https] [LIT_OTHER ":"] [LIT_CHARS //github.com/coreos/flannel/releases/download/v] [VarSub FLANNEL_VERSION] [LIT_CHARS /flannel-] [VarSub FLANNEL_VERSION] [LIT_CHARS -linux-amd64.tar.gz]} {[LIT_CHARS -o]} {[LIT_CHARS flannel.tar.gz]} ) (Com {[LIT_CHARS tar]} {[LIT_CHARS xzf]} {[LIT_CHARS flannel.tar.gz]} {[LIT_CHARS flannel-] [VarSub FLANNEL_VERSION] [LIT_CHARS /flanneld]} {[LIT_CHARS -O]} < (FilenameRedirectNode filename={[LIT_CHARS out/flanneld]} "> 1), > ) ) ) (Subshell (AndOr OP_AND_IF (Com {[LIT_CHARS curl]} {[LIT_CHARS --fail]} {[LIT_CHARS -L]} {[LIT_CHARS https] [LIT_OTHER ":"] [LIT_CHARS //github.com/coreos/flannel/releases/download/v] [VarSub FLANNEL_VERSION] [LIT_CHARS /flannel-v] [VarSub FLANNEL_VERSION] [LIT_CHARS -linux-amd64.tar.gz]} {[LIT_CHARS -o]} {[LIT_CHARS flannel.tar.gz]} ) (Com {[LIT_CHARS tar]} {[LIT_CHARS xzf]} {[LIT_CHARS flannel.tar.gz]} {[LIT_CHARS flanneld]} {[LIT_CHARS -O]} < (FilenameRedirectNode filename={[LIT_CHARS out/flanneld]} "> 1), > ) ) ) ) (Com {[LIT_CHARS chmod]} {[LIT_CHARS 0755]} {[LIT_CHARS out/flanneld]} ) (Com {[LIT_CHARS cp]} {[LIT_CHARS out/flanneld]} {[LIT_CHARS binaries/master]} ) (Com {[LIT_CHARS cp]} {[LIT_CHARS out/flanneld]} {[LIT_CHARS binaries/minion]} ) (Com {[LIT_CHARS echo]} {[VarSub FLANNEL_VERSION]} < (FilenameRedirectNode filename={[LIT_CHARS binaries/.flannel]} "> 1), > ) ) ) (= scope= flags=0 words=[] bindings=[('ETCD_VERSION', {[VarSub ETCD_VERSION test_op=VS_TEST_COLON_HYPHEN {[DQ [LIT_CHARS 2.3.1]]}]})]) (= scope= flags=0 words=[] bindings=[('ETCD', {[DQ [LIT_CHARS etcd-v][VarSub ETCD_VERSION][LIT_CHARS -linux-amd64]]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Prepare etcd "][VarSub ETCD_VERSION][LIT_CHARS " release ..."]]} ) (AndOr OP_OR_IF (Com {[LIT_CHARS grep]} {[LIT_CHARS -q]} {[DQ [LIT_CHARS "^"][VarSub ETCD_VERSION][\ LIT_ESCAPED_CHAR "\\$"]]} {[LIT_CHARS binaries/.etcd]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) (List (Com {[LIT_CHARS curl]} {[LIT_CHARS -L]} {[LIT_CHARS https] [LIT_OTHER ":"] [LIT_CHARS //github.com/coreos/etcd/releases/download/v] [VarSub ETCD_VERSION] [LIT_CHARS /] [VarSub ETCD] [LIT_CHARS .tar.gz]} {[LIT_CHARS -o]} {[LIT_CHARS etcd.tar.gz]} ) (Com {[LIT_CHARS tar]} {[LIT_CHARS xzf]} {[LIT_CHARS etcd.tar.gz]} ) (Com {[LIT_CHARS cp]} {[VarSub ETCD] [LIT_CHARS /etcd]} {[VarSub ETCD] [LIT_CHARS /etcdctl]} {[LIT_CHARS binaries/master]} ) (Com {[LIT_CHARS echo]} {[VarSub ETCD_VERSION]} < (FilenameRedirectNode filename={[LIT_CHARS binaries/.etcd]} "> 1), > ) ) ) (FunctionDef get_latest_version_number [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('latest_url', {[DQ [LIT_CHARS "https://storage.googleapis.com/kubernetes-release/release/stable.txt"]]})]) (If (DBracket {B1 UNARY_STRING_n {[ComSub (Com {[LIT_CHARS which]} {[LIT_CHARS wget]})]}}) (Com {[LIT_CHARS wget]} {[LIT_CHARS -qO-]} {[VarSub latest_url]} ) (DBracket {B1 UNARY_STRING_n {[ComSub (Com {[LIT_CHARS which]} {[LIT_CHARS curl]})]}}) (Com {[LIT_CHARS curl]} {[LIT_CHARS -Ss]} {[VarSub latest_url]} ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Couldn't find curl or wget. Bailing out."]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 4]} ) ) ) ) ) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -z]} {[DQ [VarSub KUBE_VERSION]]} {[LIT_DBRACKET_LIKE "]"]} ) (= scope= flags=0 words=[] bindings=[('KUBE_VERSION', {[ComSub (Pipeline (Com {[LIT_CHARS get_latest_version_number]}) (Com {[LIT_CHARS sed]} {[SQ ]}) )]})]) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Prepare kubernetes "][VarSub KUBE_VERSION][LIT_CHARS " release ..."]]} ) (AndOr OP_OR_IF (Com {[LIT_CHARS grep]} {[LIT_CHARS -q]} {[DQ [LIT_CHARS "^"][VarSub KUBE_VERSION][\ LIT_ESCAPED_CHAR "\\$"]]} {[LIT_CHARS binaries/.kubernetes]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2), > ) (List (Com {[LIT_CHARS curl]} {[LIT_CHARS -L]} {[LIT_CHARS https] [LIT_OTHER ":"] [LIT_CHARS //storage.googleapis.com/kubernetes-release/release/v] [VarSub KUBE_VERSION] [LIT_CHARS /kubernetes-client-linux-amd64.tar.gz]} {[LIT_CHARS -o]} {[LIT_CHARS kubernetes-client-linux-amd64.tar.gz]} ) (Com {[LIT_CHARS curl]} {[LIT_CHARS -L]} {[LIT_CHARS https] [LIT_OTHER ":"] [LIT_CHARS //storage.googleapis.com/kubernetes-release/release/v] [VarSub KUBE_VERSION] [LIT_CHARS /kubernetes-server-linux-amd64.tar.gz]} {[LIT_CHARS -o]} {[LIT_CHARS kubernetes-server-linux-amd64.tar.gz]} ) (Com {[LIT_CHARS tar]} {[LIT_CHARS xzf]} {[LIT_CHARS kubernetes-client-linux-amd64.tar.gz]} ) (Com {[LIT_CHARS tar]} {[LIT_CHARS xzf]} {[LIT_CHARS kubernetes-server-linux-amd64.tar.gz]} ) (Com {[LIT_CHARS cp]} {[LIT_CHARS kubernetes/client/bin/kubectl]} {[LIT_CHARS binaries/]} ) (Com {[LIT_CHARS cp]} {[LIT_CHARS kubernetes/server/bin/kube-apiserver]} {[LIT_CHARS kubernetes/server/bin/kube-controller-manager]} {[LIT_CHARS kubernetes/server/bin/kube-scheduler]} {[LIT_CHARS binaries/master]} ) (Com {[LIT_CHARS cp]} {[LIT_CHARS kubernetes/server/bin/kubelet]} {[LIT_CHARS kubernetes/server/bin/kube-proxy]} {[LIT_CHARS binaries/minion]} ) (Com {[LIT_CHARS echo]} {[VarSub KUBE_VERSION]} < (FilenameRedirectNode filename={[LIT_CHARS binaries/.kubernetes]} "> 1), > ) ) ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -rf]} {[LIT_CHARS flannel] [LIT_OTHER "*"]} {[LIT_CHARS kubernetes] [LIT_OTHER "*"]} {[LIT_CHARS etcd] [LIT_OTHER "*"]} {[LIT_CHARS out]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Done! All your binaries locate in kubernetes/cluster/ubuntu/binaries directory"]]} ) (Com {[LIT_CHARS popd]} ) )