blob: bc4329eb8c22ef847b7c576180bc0623849401d9 [file] [log] [blame]
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -08001#!/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
7set -xeu -o pipefail
8
9rh_systems() {
10 echo 'No changes to apply'
11}
12
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -080013ubuntu_systems() {
Matteo Scandolobb710992019-03-06 14:50:47 -080014 DISTRO=$(lsb_release -cs)
15
Zack Williams85249ce2018-04-01 19:54:44 -070016 # get prereqs for PPA and apt-over-HTTPS support
Zack Williams3fa10502020-09-29 22:03:02 -070017 apt-get clean
Zack Williams85249ce2018-04-01 19:54:44 -070018 apt-get update
19 apt-get install -y apt-transport-https software-properties-common
20
Zack Williamsdaf691d2020-02-10 10:55:59 -070021 # set up git backports repo
22 add-apt-repository -y ppa:git-core/ppa
23
Luca Prete31860c52018-03-06 17:54:38 -080024 # set up docker repo
Zack Williams3fa10502020-09-29 22:03:02 -070025 cat << EOF | base64 -d > /tmp/docker-apt-key.gpg
26LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptUUlOQkZpdDJpb0JFQU
27RoV3BaOC93dlo2aFVUaVhPd1FIWE1BbGFGSGNQSDloQXRyNEYxeTIrT1lkYnRNdXRoCmxx
28cXdwMDI4QXF5WStQUmZWTXRTWU1ianVRdXU1Ynl5S1IwMUJicVlodVMzanRxUW1salovYk
29p2WHFubWlWWGgKMzhVdUxhK3owNzdQeHl4UWh1NUJicW50VFBRTWZpeXFFaVUrQkticTJX
30bUFOVUtRZisxQW1aWS9JcnVPWGJucQpMNEMxK2dKOHZmbVhRdDk5bnBDYXhFamFOUlZZZk
319TOFFjaXhOekhVWW5iNmVtamxBTnlFVmxaemVxbzdYS2w3ClVyd1Y1aW5hd1RTeldOdnRq
32RWpqNG5KTDhOc0x3c2NwTFBRVWhUUSs3QmJRWEF3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SCkgzUytVNzlOVDZpMEtQekxJbURmczhUN1JscHl1TWM0VWZzOGdneWc5djNBZTZj
92TjNlUXl4Y0szdzBjYkJ3c2gKL25RTmZzQTZ1dSs5SDdOaGJlaEJNaFlucE5aeXJIekNten
93lYa2F1d1JBcW9DYkdDTnlrVFJ3c3VyOWdTNDFUUQpNOHNzRDFqRmhlT0pmM2hPRG5rS1Ur
94SEtqdk1ST2wxREs3emRtTGROekExY3Z0WkgvbkNDOUtQajF6OFFDNDdTCnh4K2RUWlN4NE
959OQWh3YlMvTE4zUG9LdG44TFBqWTlOUDl1RFdJK1RXWXF1UzJVK0tIRHJCRGxzZ296RGJz
96L08KakN4Y3BEek5tWHBXUUhFdEhVNzY0OU9YSFA3VWVOU1QxbUNVQ0g1cWRhbmswVjFpZW
97pGNi9DZlRGVTRNZmNyRwpZVDkwcUZGOTNNM3YwMUJieFArRUlZMi85dGlJUGJyZAo9MFlZ
98aAotLS0tLUVORCBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCg==
99EOF
100
101 apt-key add /tmp/docker-apt-key.gpg
102 add-apt-repository -y \
103 "deb [arch=amd64] https://download.docker.com/linux/ubuntu $DISTRO stable"
Luca Prete31860c52018-03-06 17:54:38 -0800104
Zack Williams6ecb83c2018-08-29 13:22:21 -0700105 # set up golang repo
Zack Williamsc9abcdc2019-05-09 21:23:38 -0700106 # docs: https://github.com/golang/go/wiki/Ubuntu
Zack Williams3fa10502020-09-29 22:03:02 -0700107 add-apt-repository -y ppa:longsleep/golang-backports
Zack Williams6ecb83c2018-08-29 13:22:21 -0700108
Zack Williams7722ef22018-10-16 14:08:29 -0700109 # set up kubernetes repo
110 cat << EOF | base64 -d > /tmp/k8s-apt-key.gpg
Zack Williams3fa10502020-09-29 22:03:02 -0700111xsBNBFrBaNsBCADrF18KCbsZlo4NjAvVecTBCnp6WcBQJ5oSh7+E98jX9YznUCrNrgmeCc
112CMUvTDRDxfTaDJybaHugfba43nqhkbNpJ47YXsIa+YL6eEE9emSmQtjrSWIiY+2YJYwsDg
113sgckF3duqkb02OdBQlh6IbHPoXB6H//b1PgZYsomB+841XW1LSJPYlYbIrWfwDfQvtkFQI
11490r6NknVTQlpqQh5GLNWNYqRNrGQPmsB+NrUYrkl1nUt1LRGu+rCe4bSaSmNbwKMQKkROE
1154kTiB72DPk7zH4Lm0uo0YFFWG4qsMIuqEihJ/9KNX8GYBr+tWgyLooLlsdK3l+4dVqd8cj
116kJM1ExABEBAAHNQEdvb2dsZSBDbG91ZCBQYWNrYWdlcyBBdXRvbWF0aWMgU2lnbmluZyBL
117ZXkgPGdjLXRlYW1AZ29vZ2xlLmNvbT7CwHgEEwECACwFAlrBaNsJEGoDCyG6B/T7AhsPBQ
118kFo5qABgsJCAcDAgYVCAIJCgsEFgIDAQAAJr4IAM5lgJ2CTkTRu2iw+tFwb90viLR6W0N1
119CiSPUwi1gjEKMr5r0aimBi6FXiHTuX7RIldSNynkypkZrNAmTMM8SU+sri7R68CFTpSgAv
120W8qlnlv2iwrEApd/UxxzjYaq8ANcpWAOpDsHeDGYLCEmXOhu8LmmpY4QqBuOCM40kuTDRd
12152PCJE6b0V1t5zUqdKeKZCPQPhsS/9rdYP9yEEGdsx0V/Vt3C8hjv4Uwgl8Fa3s/4ag6lg
122If+4SlkBAdfl/MTuXu/aOhAWQih444igB+rvFaDYIhYosVhCxP4EUAfGZk+qfo2mCY3w1p
123te31My+vVNceEZSUpMetSfwit3QA8EE=
Zack Williams7722ef22018-10-16 14:08:29 -0700124EOF
125
Zack Williams3fa10502020-09-29 22:03:02 -0700126 apt-key add /tmp/k8s-apt-key.gpg
127 add-apt-repository -y "deb http://apt.kubernetes.io/ kubernetes-xenial main"
Zack Williams7722ef22018-10-16 14:08:29 -0700128
Matteo Scandolobb710992019-03-06 14:50:47 -0800129 # set up NodeJS repo
Zack Williams6a1d4542019-03-09 09:04:26 -0700130 # Instructions: https://github.com/nodesource/distributions/blob/master/README.md#manual-installation
Matteo Scandolobb710992019-03-06 14:50:47 -0800131 cat << EOF | base64 -d > /tmp/nodejs-apt-key.gpg
Zack Williams3fa10502020-09-29 22:03:02 -0700132LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tClZlcnNpb246IEdudVBHIH
133YxCkNvbW1lbnQ6IEdQR1Rvb2xzIC0gaHR0cHM6Ly9ncGd0b29scy5vcmcKCm1RSU5CRk9i
134SkxZQkVBRGtGVzhITWpzb1lSSlE0bkNZQy82RWgweUxXSFdmQ2grLzlaU0lqNHcvcE9lMl
135Y2VisKVzZESFkza0szYSsyYnhyYXg5RXFLZTd1eGtTS2Y5NWdmbnMrSTkrUitSSmZScGIx
136cXZsalVScjU0eTM1SVpncwpmTUcyMk5wK1RtTTJSTGdkRkNaYTE4aDArUmJIOWkwYitack
137I5WFBabUxiL2g5b3U3U293R3FRM3d3T3RUM1Z5CnFtaWYwQTJHQ2NqRlRxV1c2VFhhWThl
138Wko5QkNFcVczay8wQ2p3N0svbVN5L3V0eFlpVUl2Wk5LZ2FHL1A4VTcKODlReXZ4ZVJ4QW
139Y5M1lGQVZ6TVhob0t4dTEySXVINFZuU3dBZmI4Z1F5eEtSeWlHT1V3azBZb0JQcHFSbk1t
140RApEbDdTZG1ZM29RSEVKekJlbFRNalRNOEFqYkI5bVdvUEJYNUc4dDR1NDcvRlo2UGdkZm
1411SZzloc0tYaGtMSmM3CkMxYnRibE9ITmdEeDE5ZnpBU1dYK3hPalppS3BQNk1rRUV6cTFi
142aWxVRnVsNlJEdHhrVFdzVGE1VEdpeGdDQi8KRzJmSzhJOUpML3lRaERjNk9HWTltalBPeE
1431iNVBnVWxUOG94M3Y4d3QyNWVyV2o5ejMwUW9FQndmU2c0dHpMYwpKcTZOL2llcFFlbU5m
144bzZJcytURytKekk2dmhYamxzQm0vWG16MFppRlBQT2JBSC92R0NZNUk2ODg2dlhRN2Z0Cn
145FXSFlIVDhqei9SNHRpZ01HQyt0dlova2NtWUJzTENDSTV1U0VQNkpKUlFRaEhy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vYWZmbUlN
190b01YU296S21nYTgxSlN3a0FETzFKTWdVeTZkQXBYejlrUDRFRTNnPT0KPUNMR0YKLS0tLS
1911FTkQgUEdQIFBVQkxJQyBLRVkgQkxPQ0stLS0tLQo=
Matteo Scandolobb710992019-03-06 14:50:47 -0800192EOF
193
Zack Williams3fa10502020-09-29 22:03:02 -0700194 apt-key add /tmp/nodejs-apt-key.gpg
Matteo Scandolobb710992019-03-06 14:50:47 -0800195 NODE_VERSION=node_7.x
Zack Williams3fa10502020-09-29 22:03:02 -0700196 add-apt-repository -y "deb [arch=amd64] https://deb.nodesource.com/$NODE_VERSION $DISTRO main"
Matteo Scandolobb710992019-03-06 14:50:47 -0800197
Zack Williams7722ef22018-10-16 14:08:29 -0700198 # update after adding apt repos to sources
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800199 apt-get update
Luca Prete31860c52018-03-06 17:54:38 -0800200
201 # install basic sofware requirements
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800202 apt-get install -y \
Zack Williams3fa10502020-09-29 22:03:02 -0700203 "docker-ce=5:19.03*" \
Andy Bavierb781c4c2018-09-20 08:16:52 -0700204 apt-transport-https \
Luca Prete31860c52018-03-06 17:54:38 -0800205 build-essential \
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800206 bzip2 \
207 curl \
Andy Bavierb781c4c2018-09-20 08:16:52 -0700208 ebtables \
Zack Williamsfd1d6262019-12-18 16:42:30 -0700209 enchant \
Andy Bavierb781c4c2018-09-20 08:16:52 -0700210 ethtool \
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800211 git \
Zack Williamsc9abcdc2019-05-09 21:23:38 -0700212 golang-1.12-go \
Zack Williams7b3da532019-12-18 10:41:29 -0700213 graphviz \
Andy Bavierb781c4c2018-09-20 08:16:52 -0700214 jq \
Kailash3be4df02019-02-05 12:43:00 -0800215 kafkacat \
Zack Williams3fa10502020-09-29 22:03:02 -0700216 "kubeadm=1.18*" \
217 "kubelet=1.18*" \
218 "kubectl=1.18*" \
219 "kubernetes-cni=0.8.7*" \
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800220 less \
Zack Williams9d661a42018-10-01 15:43:21 -0700221 libmysqlclient-dev \
Zack Williams68f43102018-07-07 12:57:13 -0700222 libpcap-dev \
Zack Williamscfe0b942018-04-12 11:47:57 -0700223 libxml2-utils \
Kailash Khalasi1ddc7c62018-04-20 08:47:56 -0700224 maven \
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800225 nodejs \
Zack Williams85249ce2018-04-01 19:54:44 -0700226 python \
Luca Prete31860c52018-03-06 17:54:38 -0800227 python-dev \
Luca Prete31860c52018-03-06 17:54:38 -0800228 python-pip \
Zack Williams4b54baf2019-03-08 18:04:37 -0700229 python3-dev \
Zack Williams3fa10502020-09-29 22:03:02 -0700230 python3-pip \
Zack Williams40c06f02018-04-15 20:31:34 -0700231 ruby \
Andy Bavierbd79f0d2019-09-20 13:45:47 -0700232 screen \
Zack Williamseb842ae2018-05-15 17:07:32 -0700233 socat \
Zack Williams85249ce2018-04-01 19:54:44 -0700234 ssh \
Luca Prete31860c52018-03-06 17:54:38 -0800235 sshpass \
Zack Williams85249ce2018-04-01 19:54:44 -0700236 zip
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800237 # end of apt-get install list
Luca Prete31860c52018-03-06 17:54:38 -0800238
Zack Williams32e17c12020-02-11 09:38:44 -0700239 # remove apt installed incompatible python tools
Zack Williams07161452020-02-11 11:04:56 -0700240 # NOTE: Python3 versions are not removed, as cloud-init depends on them
Zack Williams32e17c12020-02-11 09:38:44 -0700241 apt-get -y remove \
242 python-enum34 \
243 python-cryptography \
244 python-openssl \
245 python-ndg-httpsclient \
246 python-requests \
Zack Williams32e17c12020-02-11 09:38:44 -0700247 python-six \
Zack Williams3fa10502020-09-29 22:03:02 -0700248 python-urllib3 \
249 python3-chardet \
250 python3-requests \
251 python3-six \
252 python3-urllib3
Zack Williams32e17c12020-02-11 09:38:44 -0700253
Zack Williams3fa10502020-09-29 22:03:02 -0700254 # install python3 modules
Zack Williams2d28bf82020-02-10 17:13:25 -0700255 # upgrade pip or other installations may fail in unusual ways
Zack Williams3fa10502020-09-29 22:03:02 -0700256 pip3 install --upgrade pip
257 pip3 install \
Zack Williams07161452020-02-11 11:04:56 -0700258 ansible \
Zack Williams85249ce2018-04-01 19:54:44 -0700259 ansible-lint \
Zack Williams3fa10502020-09-29 22:03:02 -0700260 docker \
261 docker-compose \
262 git-review \
263 httpie \
264 netaddr \
265 pylint \
266 tox \
267 twine \
268 virtualenv \
269 yamllint
270 # end of pip3 install list
271
272 # install python2 modules
273 # upgrade pip or other installations may fail in unusual ways
274 python -m pip install --upgrade pip
275 python -m pip install \
276 Jinja2 \
Zack Williams958bc4e2018-10-18 21:08:25 -0700277 coverage \
Zack Williams32e17c12020-02-11 09:38:44 -0700278 certifi \
279 cryptography \
Zack Williams3fa10502020-09-29 22:03:02 -0700280 git+https://github.com/linkchecker/linkchecker.git@v9.4.0 \
Luca Prete90bfa5e2018-03-06 20:41:56 -0800281 graphviz \
Kailash Khalasie15b27a2018-06-26 13:28:20 -0700282 grpcio-tools \
Zack Williams85249ce2018-04-01 19:54:44 -0700283 isort \
Zack Williams941e0362019-09-23 16:29:50 -0700284 more-itertools==5.0.0 \
Andy Baviereca7b1d2020-09-16 14:50:19 -0700285 mock==2.0.* \
Zack Williams32e17c12020-02-11 09:38:44 -0700286 ndg-httpsclient \
Andy Baviereca7b1d2020-09-16 14:50:19 -0700287 nose2==0.9.* \
Zack Williams32e17c12020-02-11 09:38:44 -0700288 pyopenssl \
Zack Williams85249ce2018-04-01 19:54:44 -0700289 pexpect \
Andy Baviereca7b1d2020-09-16 14:50:19 -0700290 pyyaml==3.10.* \
291 requests==2.14.* \
Luca Prete31860c52018-03-06 17:54:38 -0800292 robotframework \
Kailash Khalasicb327c62018-04-03 10:41:38 -0700293 robotframework-httplibrary \
Kailash Khalasia1917682018-08-20 10:34:39 -0700294 robotframework-kafkalibrary \
Kailash3035a272019-07-25 09:31:11 -0700295 robotframework-lint \
Zack Williams85249ce2018-04-01 19:54:44 -0700296 robotframework-requests \
Zack Williamsfd8a0042018-04-12 14:34:17 -0700297 robotframework-sshlibrary \
Zack Williams32e17c12020-02-11 09:38:44 -0700298 six \
Zack Williams3fa10502020-09-29 22:03:02 -0700299 urllib3
Zack Williams85249ce2018-04-01 19:54:44 -0700300 # end of pip install list
Luca Prete31860c52018-03-06 17:54:38 -0800301
Zack Williams40c06f02018-04-15 20:31:34 -0700302 # install ruby gems
303 gem install \
Ciprian Barbuf2ddc1a2019-11-15 17:54:35 +0200304 mdl -v 0.5.0
Zack Williams40c06f02018-04-15 20:31:34 -0700305 # end of gem install list
306
Luca Prete31860c52018-03-06 17:54:38 -0800307 # install npm modules
308 npm install -g \
Zack Williams85249ce2018-04-01 19:54:44 -0700309 gitbook-cli \
310 markdownlint \
Luca Prete31860c52018-03-06 17:54:38 -0800311 typings
312
Zack Williams6ecb83c2018-08-29 13:22:21 -0700313 # install golang packages in /usr/local/go
314 # Set PATH=$PATH:/usr/local/go/bin` to use these
315 export GOPATH=/usr/local/go
316 mkdir -p $GOPATH
Zack Williamsc9abcdc2019-05-09 21:23:38 -0700317 export PATH=$PATH:/usr/lib/go-1.12/bin:$GOPATH/bin
Zack Williams42200aa2019-04-12 13:27:44 -0700318
Andy Bavier126e95b2020-09-15 13:10:47 -0700319 # converters for unit/coverage tests
Zack Williams6ecb83c2018-08-29 13:22:21 -0700320 go get -v github.com/t-yuki/gocover-cobertura
321 go get -v github.com/jstemmer/go-junit-report
322
Zack Williams0ba8a9b2020-04-30 22:25:52 -0700323 # github-release - uploader for github artifacts
324 go get -v github.com/github-release/github-release
Zack Williams27cd3e52018-09-18 16:44:50 -0700325
Zack Williamsa2bea0a2019-05-09 21:50:37 -0700326 # dep for go package dependencies w/versioning, version 0.5.2, adapted from:
Zack Williams142ba6b2018-11-20 15:23:39 -0700327 # https://golang.github.io/dep/docs/installation.html#install-from-source
328 go get -d -u github.com/golang/dep
329 pushd $(go env GOPATH)/src/github.com/golang/dep
Zack Williamsa2bea0a2019-05-09 21:50:37 -0700330 git checkout "0.5.2"
331 go install -ldflags="-X main.version=0.5.2" ./cmd/dep
Zack Williams142ba6b2018-11-20 15:23:39 -0700332 popd
333
Zack Williamsa6bc7722019-07-08 11:08:41 -0700334 # golangci-lint for testing
335 # https://github.com/golangci/golangci-lint#local-installation
336 GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.17.1
337
Zack Williams42200aa2019-04-12 13:27:44 -0700338 # protoc-gen-go - Golang protbuf compiler extension for protoc (installed
339 # below)
340 go get -d -u github.com/golang/protobuf/protoc-gen-go
341 pushd $(go env GOPATH)/src/github.com/golang/protobuf
342 git checkout "v1.3.1"
343 go install ./protoc-gen-go
344 popd
345
Zack Williams3fa10502020-09-29 22:03:02 -0700346 # install repo launcher v2.9
347 REPO_B64_SHA256SUM="da4a14be94382f7ecdb22fef4f554eb0ffcf09a0d8c352667beae4a1794ad666"
348 curl -o /tmp/repo.b64 'https://gerrit.googlesource.com/git-repo/+/refs/tags/v2.9/repo?format=TEXT'
Zack Williamsd30d7522019-12-16 09:10:48 -0700349 echo "$REPO_B64_SHA256SUM /tmp/repo.b64" | sha256sum -c -
350 base64 --decode /tmp/repo.b64 > /tmp/repo
Zack Williams85249ce2018-04-01 19:54:44 -0700351 mv /tmp/repo /usr/local/bin/repo
352 chmod a+x /usr/local/bin/repo
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800353
Zack Williams4cfdf202018-05-07 09:58:12 -0700354 # install helm
Zack Williams3fa10502020-09-29 22:03:02 -0700355 HELM_VERSION="2.16.10"
356 HELM_SHA256SUM="65a4857611a4e65b255ec192cbdb34d47212f041260f81a1039c05a8bb9ea041"
Zack Williams8aa52822018-04-05 09:22:15 -0700357 HELM_PLATFORM="linux-amd64"
Zack Williams4cfdf202018-05-07 09:58:12 -0700358 curl -L -o /tmp/helm.tgz "https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-${HELM_PLATFORM}.tar.gz"
Zack Williams8aa52822018-04-05 09:22:15 -0700359 echo "$HELM_SHA256SUM /tmp/helm.tgz" | sha256sum -c -
360 pushd /tmp
361 tar -xzvf helm.tgz
362 mv ${HELM_PLATFORM}/helm /usr/local/bin/helm
363 chmod a+x /usr/local/bin/helm
Zack Williams4cfdf202018-05-07 09:58:12 -0700364 rm -rf helm.tgz ${HELM_PLATFORM}
365 popd
366
367 # install minikube
Zack Williams3fa10502020-09-29 22:03:02 -0700368 MINIKUBE_VERSION="1.13.1"
369 MINIKUBE_SHA256SUM="ac6cd65568f1fdab13207aaed3903037b07bd660a7d0eb4331a2a4198890de39"
Zack Williamsbdf41e02020-10-01 09:54:51 -0700370 curl -L -o /tmp/minikube.deb "https://github.com/kubernetes/minikube/releases/download/v${MINIKUBE_VERSION}/minikube_${MINIKUBE_VERSION}-0_amd64.deb"
Zack Williams4cfdf202018-05-07 09:58:12 -0700371 echo "$MINIKUBE_SHA256SUM /tmp/minikube.deb" | sha256sum -c -
372 pushd /tmp
373 dpkg -i minikube.deb
374 rm -f minikube.deb
Zack Williams8aa52822018-04-05 09:22:15 -0700375 popd
376
Kailash Khalasi929d21b2018-06-28 12:28:17 -0700377 # install protobufs
Zack Williamsdf5a4ab2019-03-22 14:10:34 -0700378 PROTOC_VERSION="3.7.0"
379 PROTOC_SHA256SUM="a1b8ed22d6dc53c5b8680a6f1760a305b33ef471bece482e92728f00ba2a2969"
Kailash Khalasi929d21b2018-06-28 12:28:17 -0700380 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
381 echo "$PROTOC_SHA256SUM /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip" | sha256sum -c -
Kailash Khalasic4ff32d2018-06-28 18:24:52 -0700382 unzip /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /tmp/protoc3
Kailash Khalasi929d21b2018-06-28 12:28:17 -0700383 mv /tmp/protoc3/bin/* /usr/local/bin/
384 mv /tmp/protoc3/include/* /usr/local/include/
Zack Williams0f80d902019-04-01 11:26:57 -0700385 # fix permissions on files
386 chmod -R a+rx /usr/local/bin/*
Zack Williams6b06aa52019-04-01 14:30:17 -0700387 chmod -R a+rX /usr/local/include/
Zack Williamscab43ba2018-09-19 09:58:25 -0700388
Kailash Khalasi929d21b2018-06-28 12:28:17 -0700389 # give sudo permissions on minikube and protoc to jenkins user
Zack Williams3fa10502020-09-29 22:03:02 -0700390 cat << EOF > /etc/sudoers.d/88-jenkins-minikube-protoc
Kailash Khalasi929d21b2018-06-28 12:28:17 -0700391Cmnd_Alias CMDS = /usr/local/bin/protoc, /usr/bin/minikube
Zack Williams81739772018-05-14 16:35:47 -0700392Defaults:jenkins !requiretty
Kailash Khalasi929d21b2018-06-28 12:28:17 -0700393jenkins ALL=(ALL) NOPASSWD:SETENV: CMDS
Zack Williams81739772018-05-14 16:35:47 -0700394EOF
395
Zack Williams9881aea2019-07-16 14:14:08 -0700396 # install hadolint (Dockerfile checker)
Zack Williams3fa10502020-09-29 22:03:02 -0700397 HADOLINT_VERSION="1.18.0"
398 HADOLINT_SHA256SUM="f9bc9de12438b463ca84e77fde70b07b155d4da07ca21bc3f4354a62c6199db4"
Zack Williams9881aea2019-07-16 14:14:08 -0700399 curl -L -o /tmp/hadolint https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VERSION}/hadolint-Linux-x86_64
400 echo "$HADOLINT_SHA256SUM /tmp/hadolint" | sha256sum -c -
401 mv /tmp/hadolint /usr/local/bin/hadolint
402 chmod -R a+rx /usr/local/bin/hadolint
403
Zack Williams7b3da532019-12-18 10:41:29 -0700404 # install pandoc (document converter)
Zack Williams3fa10502020-09-29 22:03:02 -0700405 PANDOC_VERSION="2.10.1"
406 PANDOC_SHA256SUM="4515d6fe2bf8b82765d8dfa1e1b63ccb0ff3332d60389f948672eaa37932e936"
Zack Williams7b3da532019-12-18 10:41:29 -0700407 curl -L -o /tmp/pandoc.deb "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-amd64.deb"
408 echo "$PANDOC_SHA256SUM /tmp/pandoc.deb" | sha256sum -c -
409 dpkg -i /tmp/pandoc.deb
410 rm -f /tmp/pandoc.deb
411
Zack Williams960c6622020-04-30 10:11:51 -0700412 # install yq (YAML query)
Zack Williams3fa10502020-09-29 22:03:02 -0700413 YQ_VERSION="3.4.0"
414 YQ_SHA256SUM="f6bd1536a743ab170b35c94ed4c7c4479763356bd543af5d391122f4af852460"
Zack Williams960c6622020-04-30 10:11:51 -0700415 curl -L -o /tmp/yq https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64
416 echo "$YQ_SHA256SUM /tmp/yq" | sha256sum -c -
417 mv /tmp/yq /usr/local/bin/yq
418 chmod -R a+rx /usr/local/bin/yq
419
Andy Bavierb781c4c2018-09-20 08:16:52 -0700420 # remove apparmor
421 service apparmor stop
422 update-rc.d -f apparmor remove
423 apt-get remove apparmor-utils libapparmor-perl apparmor
424 update-grub
425
Zack Williams85249ce2018-04-01 19:54:44 -0700426 # clean up
427 apt-get clean
428 apt-get purge -y
429 apt-get autoremove -y
430 rm -rf /var/lib/apt/lists/*
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800431}
Zack Williams85249ce2018-04-01 19:54:44 -0700432
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800433all_systems() {
434 echo 'No common distribution configuration to perform'
435}
436
437echo "---> Detecting OS"
438ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
439
440case "${ORIGIN}" in
441 fedora|centos|redhat)
442 echo "---> RH type system detected"
443 rh_systems
444 ;;
445 ubuntu)
446 echo "---> Ubuntu system detected"
447 ubuntu_systems
448 ;;
449 *)
450 echo "---> Unknown operating system"
451 ;;
452esac
453
454# execute steps for all systems
455all_systems