Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Ubuntu base build |
| 3 | |
| 4 | # vim: ts=4 sw=4 sts=4 et tw=72 : |
| 5 | |
| 6 | # force any errors to cause the script and job to end in failure |
| 7 | set -xeu -o pipefail |
| 8 | |
| 9 | rh_systems() { |
| 10 | echo 'No changes to apply' |
| 11 | } |
| 12 | |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 13 | ubuntu_systems() { |
Matteo Scandolo | bb71099 | 2019-03-06 14:50:47 -0800 | [diff] [blame] | 14 | DISTRO=$(lsb_release -cs) |
| 15 | |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 16 | apt-get clean |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 17 | |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 18 | # get prereqs for PPA and apt-over-HTTPS support |
| 19 | apt-get update |
| 20 | apt-get install -y apt-transport-https software-properties-common |
| 21 | |
Zack Williams | daf691d | 2020-02-10 10:55:59 -0700 | [diff] [blame] | 22 | # set up git backports repo |
| 23 | add-apt-repository -y ppa:git-core/ppa |
| 24 | |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 25 | # set up docker repo |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 26 | apt-key adv --keyserver keyserver.ubuntu.com --recv 0EBFCD88 |
| 27 | add-apt-repository \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 28 | "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ |
| 29 | $(lsb_release -cs) \ |
| 30 | stable" |
| 31 | |
Zack Williams | 6ecb83c | 2018-08-29 13:22:21 -0700 | [diff] [blame] | 32 | # set up golang repo |
Zack Williams | c9abcdc | 2019-05-09 21:23:38 -0700 | [diff] [blame] | 33 | # docs: https://github.com/golang/go/wiki/Ubuntu |
| 34 | add-apt-repository ppa:longsleep/golang-backports |
Zack Williams | 6ecb83c | 2018-08-29 13:22:21 -0700 | [diff] [blame] | 35 | |
Zack Williams | 7722ef2 | 2018-10-16 14:08:29 -0700 | [diff] [blame] | 36 | # set up kubernetes repo |
| 37 | cat << EOF | base64 -d > /tmp/k8s-apt-key.gpg |
| 38 | mQENBFUd6rIBCAD6mhKRHDn3UrCeLDp7U5IE7AhhrOCPpqGF7mfTemZYHf/5JdjxcOxoSFlK |
| 39 | 7zwmFr3lVqJ+tJ9L1wd1K6P7RrtaNwCiZyeNPf/Y86AJ5NJwBe0VD0xHTXzPNTqRSByVYtdN |
| 40 | 94NoltXUYFAAPZYQls0x0nUD1hLMlOlC2HdTPrD1PMCnYq/NuL/Vk8sWrcUt4DIS+0RDQ8tK |
| 41 | Ke5PSV0+PnmaJvdF5CKawhh0qGTklS2MXTyKFoqjXgYDfY2EodI9ogT/LGr9Lm/+u4OFPvmN |
| 42 | 9VN6UG+s0DgJjWvpbmuHL/ZIRwMEn/tpuneaLTO7h1dCrXC849PiJ8wSkGzBnuJQUbXnABEB |
| 43 | AAG0QEdvb2dsZSBDbG91ZCBQYWNrYWdlcyBBdXRvbWF0aWMgU2lnbmluZyBLZXkgPGdjLXRl |
| 44 | YW1AZ29vZ2xlLmNvbT6JAT4EEwECACgFAlUd6rICGy8FCQWjmoAGCwkIBwMCBhUIAgkKCwQW |
| 45 | AgMBAh4BAheAAAoJEDdGwginMXsPcLcIAKi2yNhJMbu4zWQ2tM/rJFovazcY28MF2rDWGOnc |
| 46 | 9giHXOH0/BoMBcd8rw0lgjmOosBdM2JT0HWZIxC/Gdt7NSRA0WOlJe04u82/o3OHWDgTdm9M |
| 47 | S42noSP0mvNzNALBbQnlZHU0kvt3sV1YsnrxljoIuvxKWLLwren/GVshFLPwONjw3f9Fan6G |
| 48 | WxJyn/dkX3OSUGaduzc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IpzQ749ogYQ1eode |
| 62 | xPNhLzekKR3XhGrNXJ95r5KO10VrsLFNd8KwAgAD |
| 63 | EOF |
| 64 | |
| 65 | sudo apt-key add /tmp/k8s-apt-key.gpg |
| 66 | echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list |
| 67 | |
Matteo Scandolo | bb71099 | 2019-03-06 14:50:47 -0800 | [diff] [blame] | 68 | # set up NodeJS repo |
Zack Williams | 6a1d454 | 2019-03-09 09:04:26 -0700 | [diff] [blame] | 69 | # Instructions: https://github.com/nodesource/distributions/blob/master/README.md#manual-installation |
Matteo Scandolo | bb71099 | 2019-03-06 14:50:47 -0800 | [diff] [blame] | 70 | |
| 71 | cat << EOF | base64 -d > /tmp/nodejs-apt-key.gpg |
| 72 | LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tClZlcnNpb246IEdudVBHIHYxCkNvbW1lbnQ6IEdQR1Rvb2xzIC0gaHR0cHM6Ly9ncGd0b29scy5vcmcKCm1RSU5CRk9iSkxZQkVBRGtGVzhITWpzb1lSSlE0bkNZQy82RWgweUxXSFdmQ2grLzlaU0lqNHcvcE9lMlY2VisKVzZESFkza0szYSsyYnhyYXg5RXFLZTd1eGtTS2Y5NWdmbnMrSTkrUitSSmZScGIxcXZsalVScjU0eTM1SVpncwpmTUcyMk5wK1RtTTJSTGdkRkNaYTE4aDArUmJIOWkwYitackI5WFBabUxiL2g5b3U3U293R3FRM3d3T3RUM1Z5CnFtaWYwQTJHQ2NqRlRxV1c2VFhhWThlWko5QkNFcVczay8wQ2p3N0svbVN5L3V0eFlpVUl2Wk5LZ2FHL1A4VTcKODlReXZ4ZVJ4QWY5M1lGQVZ6TVhob0t4dTEySXVINFZuU3dBZmI4Z1F5eEtSeWlHT1V3azBZb0JQcHFSbk1tRApEbDdTZG1ZM29RSEVKekJlbFRNalRNOEFqYkI5bVdvUEJYNUc4dDR1NDcvRlo2UGdkZm1S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jhyVkZkd0ZwamJ2d0hNUUJXaHJxZnUKRzNLYWVQdmJuT2JLSFhwZklLb0FNN1gycWZPK0lGbkxHVFB5aEZUY3JsNnZaQlRNWlRmWmlDMVhEUUx1R1VuZApzY2t1WElOSVUzREZXelpHcjBRcnFrdUUvanlyN0ZYZVVKajlCN2NMbytzL1RYbytSYVZmaTNrT2M5Qm94SXZ5Ci9xaU5Hcy9US3kyL1VqcXAvYWZmbUlNb01YU296S21nYTgxSlN3a0FETzFKTWdVeTZkQXBYejlrUDRFRTNnPT0KPUNMR0YKLS0tLS1FTkQgUEdQIFBVQkxJQyBLRVkgQkxPQ0stLS0tLQo= |
| 73 | EOF |
| 74 | |
| 75 | sudo apt-key add /tmp/nodejs-apt-key.gpg |
| 76 | NODE_VERSION=node_7.x |
| 77 | echo "deb https://deb.nodesource.com/$NODE_VERSION $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list |
| 78 | echo "deb-src https://deb.nodesource.com/$NODE_VERSION $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list |
| 79 | |
Zack Williams | 7722ef2 | 2018-10-16 14:08:29 -0700 | [diff] [blame] | 80 | # update after adding apt repos to sources |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 81 | apt-get update |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 82 | |
| 83 | # install basic sofware requirements |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 84 | apt-get install -y \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 85 | "docker-ce=17.06*" \ |
Andy Bavier | b781c4c | 2018-09-20 08:16:52 -0700 | [diff] [blame] | 86 | apt-transport-https \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 87 | build-essential \ |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 88 | bzip2 \ |
| 89 | curl \ |
Andy Bavier | b781c4c | 2018-09-20 08:16:52 -0700 | [diff] [blame] | 90 | ebtables \ |
Zack Williams | fd1d626 | 2019-12-18 16:42:30 -0700 | [diff] [blame] | 91 | enchant \ |
Andy Bavier | b781c4c | 2018-09-20 08:16:52 -0700 | [diff] [blame] | 92 | ethtool \ |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 93 | git \ |
Zack Williams | c9abcdc | 2019-05-09 21:23:38 -0700 | [diff] [blame] | 94 | golang-1.12-go \ |
Zack Williams | 7b3da53 | 2019-12-18 10:41:29 -0700 | [diff] [blame] | 95 | graphviz \ |
Andy Bavier | b781c4c | 2018-09-20 08:16:52 -0700 | [diff] [blame] | 96 | jq \ |
Kailash | 3be4df0 | 2019-02-05 12:43:00 -0800 | [diff] [blame] | 97 | kafkacat \ |
Zack Williams | 2dc7cf8 | 2019-04-01 12:36:06 -0700 | [diff] [blame] | 98 | "kubeadm=1.12.7-*" \ |
| 99 | "kubelet=1.12.7-*" \ |
| 100 | "kubectl=1.12.7-*" \ |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 101 | less \ |
Zack Williams | 9d661a4 | 2018-10-01 15:43:21 -0700 | [diff] [blame] | 102 | libmysqlclient-dev \ |
Zack Williams | 68f4310 | 2018-07-07 12:57:13 -0700 | [diff] [blame] | 103 | libpcap-dev \ |
Zack Williams | cfe0b94 | 2018-04-12 11:47:57 -0700 | [diff] [blame] | 104 | libxml2-utils \ |
Kailash Khalasi | 1ddc7c6 | 2018-04-20 08:47:56 -0700 | [diff] [blame] | 105 | maven \ |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 106 | nodejs \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 107 | python \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 108 | python-dev \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 109 | python-pip \ |
Zack Williams | 4b54baf | 2019-03-08 18:04:37 -0700 | [diff] [blame] | 110 | python3-dev \ |
Zack Williams | 40c06f0 | 2018-04-15 20:31:34 -0700 | [diff] [blame] | 111 | ruby \ |
Andy Bavier | bd79f0d | 2019-09-20 13:45:47 -0700 | [diff] [blame] | 112 | screen \ |
Zack Williams | eb842ae | 2018-05-15 17:07:32 -0700 | [diff] [blame] | 113 | socat \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 114 | ssh \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 115 | sshpass \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 116 | zip |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 117 | # end of apt-get install list |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 118 | |
Zack Williams | 32e17c1 | 2020-02-11 09:38:44 -0700 | [diff] [blame] | 119 | # remove apt installed incompatible python tools |
Zack Williams | 0716145 | 2020-02-11 11:04:56 -0700 | [diff] [blame] | 120 | # NOTE: Python3 versions are not removed, as cloud-init depends on them |
Zack Williams | 32e17c1 | 2020-02-11 09:38:44 -0700 | [diff] [blame] | 121 | apt-get -y remove \ |
| 122 | python-enum34 \ |
| 123 | python-cryptography \ |
| 124 | python-openssl \ |
| 125 | python-ndg-httpsclient \ |
| 126 | python-requests \ |
Zack Williams | 32e17c1 | 2020-02-11 09:38:44 -0700 | [diff] [blame] | 127 | python-six \ |
Zack Williams | 0716145 | 2020-02-11 11:04:56 -0700 | [diff] [blame] | 128 | python-urllib3 |
Zack Williams | 32e17c1 | 2020-02-11 09:38:44 -0700 | [diff] [blame] | 129 | |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 130 | # install python modules |
Zack Williams | 2d28bf8 | 2020-02-10 17:13:25 -0700 | [diff] [blame] | 131 | # upgrade pip or other installations may fail in unusual ways |
| 132 | pip install --upgrade pip |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 133 | pip install \ |
| 134 | Jinja2 \ |
Zack Williams | 0716145 | 2020-02-11 11:04:56 -0700 | [diff] [blame] | 135 | ansible \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 136 | ansible-lint \ |
Zack Williams | ac92296 | 2018-07-24 13:02:26 -0700 | [diff] [blame] | 137 | astroid==1.* \ |
Zack Williams | 958bc4e | 2018-10-18 21:08:25 -0700 | [diff] [blame] | 138 | coverage \ |
Zack Williams | 32e17c1 | 2020-02-11 09:38:44 -0700 | [diff] [blame] | 139 | certifi \ |
| 140 | cryptography \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 141 | docker-compose==1.20.1 \ |
| 142 | docker==3.2.1 \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 143 | gitpython \ |
Zack Williams | 0716145 | 2020-02-11 11:04:56 -0700 | [diff] [blame] | 144 | git-review \ |
Luca Prete | 90bfa5e | 2018-03-06 20:41:56 -0800 | [diff] [blame] | 145 | graphviz \ |
Kailash Khalasi | e15b27a | 2018-06-26 13:28:20 -0700 | [diff] [blame] | 146 | grpcio-tools \ |
Zack Williams | 0716145 | 2020-02-11 11:04:56 -0700 | [diff] [blame] | 147 | httpie==1.0.3 \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 148 | isort \ |
Zack Williams | d4f9d11 | 2020-02-24 16:08:54 -0700 | [diff] [blame] | 149 | git+https://github.com/linkchecker/linkchecker.git@v9.4.0 \ |
Zack Williams | 941e036 | 2019-09-23 16:29:50 -0700 | [diff] [blame] | 150 | more-itertools==5.0.0 \ |
Zack Williams | 958bc4e | 2018-10-18 21:08:25 -0700 | [diff] [blame] | 151 | mock \ |
Zack Williams | 32e17c1 | 2020-02-11 09:38:44 -0700 | [diff] [blame] | 152 | netaddr \ |
| 153 | ndg-httpsclient \ |
Zack Williams | 958bc4e | 2018-10-18 21:08:25 -0700 | [diff] [blame] | 154 | nose2 \ |
Zack Williams | 32e17c1 | 2020-02-11 09:38:44 -0700 | [diff] [blame] | 155 | pyopenssl \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 156 | pexpect \ |
Zack Williams | e9af4c4 | 2018-07-24 14:29:02 -0700 | [diff] [blame] | 157 | pylint==1.* \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 158 | pyyaml \ |
Zack Williams | 32e17c1 | 2020-02-11 09:38:44 -0700 | [diff] [blame] | 159 | requests \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 160 | robotframework \ |
Kailash Khalasi | cb327c6 | 2018-04-03 10:41:38 -0700 | [diff] [blame] | 161 | robotframework-httplibrary \ |
Kailash Khalasi | a191768 | 2018-08-20 10:34:39 -0700 | [diff] [blame] | 162 | robotframework-kafkalibrary \ |
Kailash | 3035a27 | 2019-07-25 09:31:11 -0700 | [diff] [blame] | 163 | robotframework-lint \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 164 | robotframework-requests \ |
Zack Williams | fd8a004 | 2018-04-12 14:34:17 -0700 | [diff] [blame] | 165 | robotframework-sshlibrary \ |
Zack Williams | 32e17c1 | 2020-02-11 09:38:44 -0700 | [diff] [blame] | 166 | six \ |
Zack Williams | a31016a | 2018-10-22 13:00:04 -0700 | [diff] [blame] | 167 | tox \ |
Zack Williams | e0e8db8 | 2020-01-06 08:50:24 -0700 | [diff] [blame] | 168 | twine==1.15.0 \ |
Zack Williams | 32e17c1 | 2020-02-11 09:38:44 -0700 | [diff] [blame] | 169 | urllib3 \ |
Zack Williams | 960c662 | 2020-04-30 10:11:51 -0700 | [diff] [blame] | 170 | virtualenv \ |
| 171 | yamllint |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 172 | # end of pip install list |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 173 | |
Zack Williams | 40c06f0 | 2018-04-15 20:31:34 -0700 | [diff] [blame] | 174 | # install ruby gems |
| 175 | gem install \ |
Ciprian Barbu | f2ddc1a | 2019-11-15 17:54:35 +0200 | [diff] [blame] | 176 | mdl -v 0.5.0 |
Zack Williams | 40c06f0 | 2018-04-15 20:31:34 -0700 | [diff] [blame] | 177 | # end of gem install list |
| 178 | |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 179 | # install npm modules |
| 180 | npm install -g \ |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 181 | gitbook-cli \ |
| 182 | markdownlint \ |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 183 | typings |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 184 | # end of npm install list |
Luca Prete | 31860c5 | 2018-03-06 17:54:38 -0800 | [diff] [blame] | 185 | |
Zack Williams | 6ecb83c | 2018-08-29 13:22:21 -0700 | [diff] [blame] | 186 | # install golang packages in /usr/local/go |
| 187 | # Set PATH=$PATH:/usr/local/go/bin` to use these |
| 188 | export GOPATH=/usr/local/go |
| 189 | mkdir -p $GOPATH |
Zack Williams | c9abcdc | 2019-05-09 21:23:38 -0700 | [diff] [blame] | 190 | export PATH=$PATH:/usr/lib/go-1.12/bin:$GOPATH/bin |
Zack Williams | 42200aa | 2019-04-12 13:27:44 -0700 | [diff] [blame] | 191 | |
Zack Williams | 6ecb83c | 2018-08-29 13:22:21 -0700 | [diff] [blame] | 192 | # converters for unit/coverage test |
| 193 | go get -v github.com/t-yuki/gocover-cobertura |
| 194 | go get -v github.com/jstemmer/go-junit-report |
| 195 | |
Zack Williams | 27cd3e5 | 2018-09-18 16:44:50 -0700 | [diff] [blame] | 196 | # gothub - uploader for github artifacts |
| 197 | go get -v github.com/itchio/gothub |
| 198 | |
Zack Williams | a2bea0a | 2019-05-09 21:50:37 -0700 | [diff] [blame] | 199 | # dep for go package dependencies w/versioning, version 0.5.2, adapted from: |
Zack Williams | 142ba6b | 2018-11-20 15:23:39 -0700 | [diff] [blame] | 200 | # https://golang.github.io/dep/docs/installation.html#install-from-source |
| 201 | go get -d -u github.com/golang/dep |
| 202 | pushd $(go env GOPATH)/src/github.com/golang/dep |
Zack Williams | a2bea0a | 2019-05-09 21:50:37 -0700 | [diff] [blame] | 203 | git checkout "0.5.2" |
| 204 | go install -ldflags="-X main.version=0.5.2" ./cmd/dep |
Zack Williams | 142ba6b | 2018-11-20 15:23:39 -0700 | [diff] [blame] | 205 | popd |
| 206 | |
Zack Williams | a6bc772 | 2019-07-08 11:08:41 -0700 | [diff] [blame] | 207 | # golangci-lint for testing |
| 208 | # https://github.com/golangci/golangci-lint#local-installation |
| 209 | GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.17.1 |
| 210 | |
Zack Williams | 42200aa | 2019-04-12 13:27:44 -0700 | [diff] [blame] | 211 | # protoc-gen-go - Golang protbuf compiler extension for protoc (installed |
| 212 | # below) |
| 213 | go get -d -u github.com/golang/protobuf/protoc-gen-go |
| 214 | pushd $(go env GOPATH)/src/github.com/golang/protobuf |
| 215 | git checkout "v1.3.1" |
| 216 | go install ./protoc-gen-go |
| 217 | popd |
| 218 | |
Zack Williams | daf691d | 2020-02-10 10:55:59 -0700 | [diff] [blame] | 219 | # install repo launcher v2.0 |
| 220 | REPO_B64_SHA256SUM="f34b0743ae46105df575f116fc6535a5d9db10c575e03e11e2932e2a8745061e" |
| 221 | curl -o /tmp/repo.b64 'https://gerrit.googlesource.com/git-repo/+/refs/tags/v2.0/repo?format=TEXT' |
Zack Williams | d30d752 | 2019-12-16 09:10:48 -0700 | [diff] [blame] | 222 | echo "$REPO_B64_SHA256SUM /tmp/repo.b64" | sha256sum -c - |
| 223 | base64 --decode /tmp/repo.b64 > /tmp/repo |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 224 | mv /tmp/repo /usr/local/bin/repo |
| 225 | chmod a+x /usr/local/bin/repo |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 226 | |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 227 | # install sonarqube scanner |
Zack Williams | 891922a | 2018-07-07 10:33:24 -0700 | [diff] [blame] | 228 | # dl link: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner |
| 229 | SONAR_SCANNER_CLI_VERSION="3.2.0.1227" |
| 230 | SONAR_SCANNER_CLI_SHA256SUM="07a50ec270a36cb83f26fe93233819c53c145248c638f4591880f1bd36e331d6" |
Zack Williams | 02e301e | 2018-10-08 12:09:58 -0700 | [diff] [blame] | 231 | curl -L -o /tmp/sonarscanner.zip "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_CLI_VERSION}-linux.zip" |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 232 | echo "$SONAR_SCANNER_CLI_SHA256SUM /tmp/sonarscanner.zip" | sha256sum -c - |
| 233 | pushd /opt |
| 234 | unzip /tmp/sonarscanner.zip |
| 235 | mv sonar-scanner-${SONAR_SCANNER_CLI_VERSION}-linux sonar-scanner |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 236 | rm -f /tmp/sonarscanner.zip |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 237 | popd |
| 238 | |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 239 | # install helm |
Zack Williams | 7a46388 | 2019-07-23 16:24:50 -0700 | [diff] [blame] | 240 | HELM_VERSION="2.14.2" |
| 241 | HELM_SHA256SUM="9f50e69cf5cfa7268b28686728ad0227507a169e52bf59c99ada872ddd9679f0" |
Zack Williams | 8aa5282 | 2018-04-05 09:22:15 -0700 | [diff] [blame] | 242 | HELM_PLATFORM="linux-amd64" |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 243 | curl -L -o /tmp/helm.tgz "https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-${HELM_PLATFORM}.tar.gz" |
Zack Williams | 8aa5282 | 2018-04-05 09:22:15 -0700 | [diff] [blame] | 244 | echo "$HELM_SHA256SUM /tmp/helm.tgz" | sha256sum -c - |
| 245 | pushd /tmp |
| 246 | tar -xzvf helm.tgz |
| 247 | mv ${HELM_PLATFORM}/helm /usr/local/bin/helm |
| 248 | chmod a+x /usr/local/bin/helm |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 249 | rm -rf helm.tgz ${HELM_PLATFORM} |
| 250 | popd |
| 251 | |
| 252 | # install minikube |
Zack Williams | 7722ef2 | 2018-10-16 14:08:29 -0700 | [diff] [blame] | 253 | MINIKUBE_VERSION="0.30.0" |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 254 | MINIKUBE_DEB_VERSION="$(echo ${MINIKUBE_VERSION} | sed -n 's/\(.*\)\.\(.*\)/\1-\2/p')" |
Zack Williams | 7722ef2 | 2018-10-16 14:08:29 -0700 | [diff] [blame] | 255 | MINIKUBE_SHA256SUM="c6c5aa5956f8ad5f61d426e9b8601ba95965a9c30bb80a9fe7525c64e6dd12fd" |
Zack Williams | 4cfdf20 | 2018-05-07 09:58:12 -0700 | [diff] [blame] | 256 | curl -L -o /tmp/minikube.deb "https://storage.googleapis.com/minikube/releases/v${MINIKUBE_VERSION}/minikube_${MINIKUBE_DEB_VERSION}.deb" |
| 257 | echo "$MINIKUBE_SHA256SUM /tmp/minikube.deb" | sha256sum -c - |
| 258 | pushd /tmp |
| 259 | dpkg -i minikube.deb |
| 260 | rm -f minikube.deb |
Zack Williams | 8aa5282 | 2018-04-05 09:22:15 -0700 | [diff] [blame] | 261 | popd |
| 262 | |
Kailash Khalasi | 929d21b | 2018-06-28 12:28:17 -0700 | [diff] [blame] | 263 | # install protobufs |
Zack Williams | df5a4ab | 2019-03-22 14:10:34 -0700 | [diff] [blame] | 264 | PROTOC_VERSION="3.7.0" |
| 265 | PROTOC_SHA256SUM="a1b8ed22d6dc53c5b8680a6f1760a305b33ef471bece482e92728f00ba2a2969" |
Kailash Khalasi | 929d21b | 2018-06-28 12:28:17 -0700 | [diff] [blame] | 266 | curl -L -o /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip |
| 267 | echo "$PROTOC_SHA256SUM /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip" | sha256sum -c - |
Kailash Khalasi | c4ff32d | 2018-06-28 18:24:52 -0700 | [diff] [blame] | 268 | unzip /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /tmp/protoc3 |
Kailash Khalasi | 929d21b | 2018-06-28 12:28:17 -0700 | [diff] [blame] | 269 | mv /tmp/protoc3/bin/* /usr/local/bin/ |
| 270 | mv /tmp/protoc3/include/* /usr/local/include/ |
Zack Williams | 0f80d90 | 2019-04-01 11:26:57 -0700 | [diff] [blame] | 271 | # fix permissions on files |
| 272 | chmod -R a+rx /usr/local/bin/* |
Zack Williams | 6b06aa5 | 2019-04-01 14:30:17 -0700 | [diff] [blame] | 273 | chmod -R a+rX /usr/local/include/ |
Zack Williams | cab43ba | 2018-09-19 09:58:25 -0700 | [diff] [blame] | 274 | |
Kailash Khalasi | 929d21b | 2018-06-28 12:28:17 -0700 | [diff] [blame] | 275 | # give sudo permissions on minikube and protoc to jenkins user |
| 276 | cat <<EOF >/etc/sudoers.d/88-jenkins-minikube-protoc |
| 277 | Cmnd_Alias CMDS = /usr/local/bin/protoc, /usr/bin/minikube |
Zack Williams | 8173977 | 2018-05-14 16:35:47 -0700 | [diff] [blame] | 278 | Defaults:jenkins !requiretty |
Kailash Khalasi | 929d21b | 2018-06-28 12:28:17 -0700 | [diff] [blame] | 279 | jenkins ALL=(ALL) NOPASSWD:SETENV: CMDS |
Zack Williams | 8173977 | 2018-05-14 16:35:47 -0700 | [diff] [blame] | 280 | EOF |
| 281 | |
Zack Williams | 9881aea | 2019-07-16 14:14:08 -0700 | [diff] [blame] | 282 | # install hadolint (Dockerfile checker) |
| 283 | HADOLINT_VERSION="1.17.1" |
| 284 | HADOLINT_SHA256SUM="2f8f3bf120e9766e6e79f7a86fed8ede55ebbf2042175b68a7c899a74eabbf34" |
| 285 | curl -L -o /tmp/hadolint https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VERSION}/hadolint-Linux-x86_64 |
| 286 | echo "$HADOLINT_SHA256SUM /tmp/hadolint" | sha256sum -c - |
| 287 | mv /tmp/hadolint /usr/local/bin/hadolint |
| 288 | chmod -R a+rx /usr/local/bin/hadolint |
| 289 | |
Zack Williams | 7b3da53 | 2019-12-18 10:41:29 -0700 | [diff] [blame] | 290 | # install pandoc (document converter) |
| 291 | PANDOC_VERSION="2.8.0.1" |
| 292 | PANDOC_SHA256SUM="81cca90353dced1e285888b73f2bee55ed388d34b6b0624d76a2eba2344eaba9" |
| 293 | curl -L -o /tmp/pandoc.deb "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-amd64.deb" |
| 294 | echo "$PANDOC_SHA256SUM /tmp/pandoc.deb" | sha256sum -c - |
| 295 | dpkg -i /tmp/pandoc.deb |
| 296 | rm -f /tmp/pandoc.deb |
| 297 | |
Zack Williams | 960c662 | 2020-04-30 10:11:51 -0700 | [diff] [blame] | 298 | # install yq (YAML query) |
| 299 | YQ_VERSION="3.3.0" |
| 300 | YQ_SHA256SUM="e70e482e7ddb9cf83b52f5e83b694a19e3aaf36acf6b82512cbe66e41d569201" |
| 301 | curl -L -o /tmp/yq https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 |
| 302 | echo "$YQ_SHA256SUM /tmp/yq" | sha256sum -c - |
| 303 | mv /tmp/yq /usr/local/bin/yq |
| 304 | chmod -R a+rx /usr/local/bin/yq |
| 305 | |
Andy Bavier | b781c4c | 2018-09-20 08:16:52 -0700 | [diff] [blame] | 306 | # remove apparmor |
| 307 | service apparmor stop |
| 308 | update-rc.d -f apparmor remove |
| 309 | apt-get remove apparmor-utils libapparmor-perl apparmor |
| 310 | update-grub |
| 311 | |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 312 | # clean up |
| 313 | apt-get clean |
| 314 | apt-get purge -y |
| 315 | apt-get autoremove -y |
| 316 | rm -rf /var/lib/apt/lists/* |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 317 | } |
Zack Williams | 85249ce | 2018-04-01 19:54:44 -0700 | [diff] [blame] | 318 | |
Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 319 | all_systems() { |
| 320 | echo 'No common distribution configuration to perform' |
| 321 | } |
| 322 | |
| 323 | echo "---> Detecting OS" |
| 324 | ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]') |
| 325 | |
| 326 | case "${ORIGIN}" in |
| 327 | fedora|centos|redhat) |
| 328 | echo "---> RH type system detected" |
| 329 | rh_systems |
| 330 | ;; |
| 331 | ubuntu) |
| 332 | echo "---> Ubuntu system detected" |
| 333 | ubuntu_systems |
| 334 | ;; |
| 335 | *) |
| 336 | echo "---> Unknown operating system" |
| 337 | ;; |
| 338 | esac |
| 339 | |
| 340 | # execute steps for all systems |
| 341 | all_systems |