blob: 429ea8e79d7dacef686b4a2a691c53c7bfaf8e83 [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
32RWpqNG5KTDhOc0x3c2NwTFBRVWhUUSs3QmJ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lGb0hSCkgzUytVNzlOVDZpMEtQekxJbURmczhUN1JscHl1TWM0VWZzOGdneWc5djNBZTZj
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
145FXSFlIVDhqei9SNHRpZ01HQyt0dlova2NtWUJzTENDSTV1U0VQNkpKUlF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VqcXAvYWZmbUlN
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 \
Zack Williamsfcec5742020-10-01 18:56:40 -0700207 cloud-init \
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800208 curl \
Andy Bavierb781c4c2018-09-20 08:16:52 -0700209 ebtables \
Zack Williamsfd1d6262019-12-18 16:42:30 -0700210 enchant \
Andy Bavierb781c4c2018-09-20 08:16:52 -0700211 ethtool \
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800212 git \
Zack Williamsc9abcdc2019-05-09 21:23:38 -0700213 golang-1.12-go \
Zack Williams7b3da532019-12-18 10:41:29 -0700214 graphviz \
Andy Bavierb781c4c2018-09-20 08:16:52 -0700215 jq \
Kailash3be4df02019-02-05 12:43:00 -0800216 kafkacat \
Zack Williams3fa10502020-09-29 22:03:02 -0700217 "kubeadm=1.18*" \
218 "kubelet=1.18*" \
219 "kubectl=1.18*" \
220 "kubernetes-cni=0.8.7*" \
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800221 less \
Zack Williams9d661a42018-10-01 15:43:21 -0700222 libmysqlclient-dev \
Zack Williams68f43102018-07-07 12:57:13 -0700223 libpcap-dev \
Zack Williamscfe0b942018-04-12 11:47:57 -0700224 libxml2-utils \
Kailash Khalasi1ddc7c62018-04-20 08:47:56 -0700225 maven \
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800226 nodejs \
Zack Williams85249ce2018-04-01 19:54:44 -0700227 python \
Luca Prete31860c52018-03-06 17:54:38 -0800228 python-dev \
Luca Prete31860c52018-03-06 17:54:38 -0800229 python-pip \
Zack Williams4b54baf2019-03-08 18:04:37 -0700230 python3-dev \
Zack Williams3fa10502020-09-29 22:03:02 -0700231 python3-pip \
Zack Williams40c06f02018-04-15 20:31:34 -0700232 ruby \
Andy Bavierbd79f0d2019-09-20 13:45:47 -0700233 screen \
Zack Williamseb842ae2018-05-15 17:07:32 -0700234 socat \
Zack Williams85249ce2018-04-01 19:54:44 -0700235 ssh \
Luca Prete31860c52018-03-06 17:54:38 -0800236 sshpass \
Zack Williams85249ce2018-04-01 19:54:44 -0700237 zip
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800238 # end of apt-get install list
Luca Prete31860c52018-03-06 17:54:38 -0800239
Zack Williams32e17c12020-02-11 09:38:44 -0700240 # remove apt installed incompatible python tools
Zack Williams07161452020-02-11 11:04:56 -0700241 # NOTE: Python3 versions are not removed, as cloud-init depends on them
Zack Williams32e17c12020-02-11 09:38:44 -0700242 apt-get -y remove \
243 python-enum34 \
244 python-cryptography \
245 python-openssl \
246 python-ndg-httpsclient \
247 python-requests \
Zack Williams32e17c12020-02-11 09:38:44 -0700248 python-six \
Zack Williamsfcec5742020-10-01 18:56:40 -0700249 python-urllib3
Zack Williams32e17c12020-02-11 09:38:44 -0700250
Zack Williams3fa10502020-09-29 22:03:02 -0700251 # install python3 modules
Zack Williams2d28bf82020-02-10 17:13:25 -0700252 # upgrade pip or other installations may fail in unusual ways
Zack Williams3fa10502020-09-29 22:03:02 -0700253 pip3 install --upgrade pip
254 pip3 install \
Zack Williams07161452020-02-11 11:04:56 -0700255 ansible \
Zack Williams85249ce2018-04-01 19:54:44 -0700256 ansible-lint \
Zack Williams3fa10502020-09-29 22:03:02 -0700257 docker \
258 docker-compose \
259 git-review \
260 httpie \
261 netaddr \
262 pylint \
263 tox \
264 twine \
265 virtualenv \
266 yamllint
267 # end of pip3 install list
268
269 # install python2 modules
270 # upgrade pip or other installations may fail in unusual ways
271 python -m pip install --upgrade pip
272 python -m pip install \
273 Jinja2 \
Zack Williams958bc4e2018-10-18 21:08:25 -0700274 coverage \
Zack Williams32e17c12020-02-11 09:38:44 -0700275 certifi \
276 cryptography \
Zack Williams3fa10502020-09-29 22:03:02 -0700277 git+https://github.com/linkchecker/linkchecker.git@v9.4.0 \
Luca Prete90bfa5e2018-03-06 20:41:56 -0800278 graphviz \
Kailash Khalasie15b27a2018-06-26 13:28:20 -0700279 grpcio-tools \
Zack Williams85249ce2018-04-01 19:54:44 -0700280 isort \
Zack Williams941e0362019-09-23 16:29:50 -0700281 more-itertools==5.0.0 \
Andy Baviereca7b1d2020-09-16 14:50:19 -0700282 mock==2.0.* \
Zack Williams32e17c12020-02-11 09:38:44 -0700283 ndg-httpsclient \
Andy Baviereca7b1d2020-09-16 14:50:19 -0700284 nose2==0.9.* \
Zack Williams32e17c12020-02-11 09:38:44 -0700285 pyopenssl \
Zack Williams85249ce2018-04-01 19:54:44 -0700286 pexpect \
Andy Baviereca7b1d2020-09-16 14:50:19 -0700287 pyyaml==3.10.* \
288 requests==2.14.* \
Luca Prete31860c52018-03-06 17:54:38 -0800289 robotframework \
Kailash Khalasicb327c62018-04-03 10:41:38 -0700290 robotframework-httplibrary \
Kailash Khalasia1917682018-08-20 10:34:39 -0700291 robotframework-kafkalibrary \
Kailash3035a272019-07-25 09:31:11 -0700292 robotframework-lint \
Zack Williams85249ce2018-04-01 19:54:44 -0700293 robotframework-requests \
Zack Williamsfd8a0042018-04-12 14:34:17 -0700294 robotframework-sshlibrary \
Zack Williams32e17c12020-02-11 09:38:44 -0700295 six \
Zack Williams3fa10502020-09-29 22:03:02 -0700296 urllib3
Zack Williams85249ce2018-04-01 19:54:44 -0700297 # end of pip install list
Luca Prete31860c52018-03-06 17:54:38 -0800298
Zack Williams40c06f02018-04-15 20:31:34 -0700299 # install ruby gems
300 gem install \
Ciprian Barbuf2ddc1a2019-11-15 17:54:35 +0200301 mdl -v 0.5.0
Zack Williams40c06f02018-04-15 20:31:34 -0700302 # end of gem install list
303
Luca Prete31860c52018-03-06 17:54:38 -0800304 # install npm modules
305 npm install -g \
Zack Williams85249ce2018-04-01 19:54:44 -0700306 gitbook-cli \
307 markdownlint \
Luca Prete31860c52018-03-06 17:54:38 -0800308 typings
309
Zack Williams6ecb83c2018-08-29 13:22:21 -0700310 # install golang packages in /usr/local/go
311 # Set PATH=$PATH:/usr/local/go/bin` to use these
312 export GOPATH=/usr/local/go
313 mkdir -p $GOPATH
Zack Williamsc9abcdc2019-05-09 21:23:38 -0700314 export PATH=$PATH:/usr/lib/go-1.12/bin:$GOPATH/bin
Zack Williams42200aa2019-04-12 13:27:44 -0700315
Andy Bavier126e95b2020-09-15 13:10:47 -0700316 # converters for unit/coverage tests
Zack Williams6ecb83c2018-08-29 13:22:21 -0700317 go get -v github.com/t-yuki/gocover-cobertura
318 go get -v github.com/jstemmer/go-junit-report
319
Zack Williams0ba8a9b2020-04-30 22:25:52 -0700320 # github-release - uploader for github artifacts
321 go get -v github.com/github-release/github-release
Zack Williams27cd3e52018-09-18 16:44:50 -0700322
Zack Williamsa2bea0a2019-05-09 21:50:37 -0700323 # dep for go package dependencies w/versioning, version 0.5.2, adapted from:
Zack Williams142ba6b2018-11-20 15:23:39 -0700324 # https://golang.github.io/dep/docs/installation.html#install-from-source
325 go get -d -u github.com/golang/dep
326 pushd $(go env GOPATH)/src/github.com/golang/dep
Zack Williamsa2bea0a2019-05-09 21:50:37 -0700327 git checkout "0.5.2"
328 go install -ldflags="-X main.version=0.5.2" ./cmd/dep
Zack Williams142ba6b2018-11-20 15:23:39 -0700329 popd
330
Zack Williamsa6bc7722019-07-08 11:08:41 -0700331 # golangci-lint for testing
332 # https://github.com/golangci/golangci-lint#local-installation
333 GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.17.1
334
Zack Williams42200aa2019-04-12 13:27:44 -0700335 # protoc-gen-go - Golang protbuf compiler extension for protoc (installed
336 # below)
337 go get -d -u github.com/golang/protobuf/protoc-gen-go
338 pushd $(go env GOPATH)/src/github.com/golang/protobuf
339 git checkout "v1.3.1"
340 go install ./protoc-gen-go
341 popd
342
Zack Williams3fa10502020-09-29 22:03:02 -0700343 # install repo launcher v2.9
344 REPO_B64_SHA256SUM="da4a14be94382f7ecdb22fef4f554eb0ffcf09a0d8c352667beae4a1794ad666"
345 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 -0700346 echo "$REPO_B64_SHA256SUM /tmp/repo.b64" | sha256sum -c -
347 base64 --decode /tmp/repo.b64 > /tmp/repo
Zack Williams85249ce2018-04-01 19:54:44 -0700348 mv /tmp/repo /usr/local/bin/repo
349 chmod a+x /usr/local/bin/repo
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800350
Zack Williams4cfdf202018-05-07 09:58:12 -0700351 # install helm
Zack Williams3fa10502020-09-29 22:03:02 -0700352 HELM_VERSION="2.16.10"
353 HELM_SHA256SUM="65a4857611a4e65b255ec192cbdb34d47212f041260f81a1039c05a8bb9ea041"
Zack Williams8aa52822018-04-05 09:22:15 -0700354 HELM_PLATFORM="linux-amd64"
Zack Williams4cfdf202018-05-07 09:58:12 -0700355 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 -0700356 echo "$HELM_SHA256SUM /tmp/helm.tgz" | sha256sum -c -
357 pushd /tmp
358 tar -xzvf helm.tgz
359 mv ${HELM_PLATFORM}/helm /usr/local/bin/helm
360 chmod a+x /usr/local/bin/helm
Zack Williams4cfdf202018-05-07 09:58:12 -0700361 rm -rf helm.tgz ${HELM_PLATFORM}
362 popd
363
364 # install minikube
Zack Williams3fa10502020-09-29 22:03:02 -0700365 MINIKUBE_VERSION="1.13.1"
366 MINIKUBE_SHA256SUM="ac6cd65568f1fdab13207aaed3903037b07bd660a7d0eb4331a2a4198890de39"
Zack Williamsbdf41e02020-10-01 09:54:51 -0700367 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 -0700368 echo "$MINIKUBE_SHA256SUM /tmp/minikube.deb" | sha256sum -c -
369 pushd /tmp
370 dpkg -i minikube.deb
371 rm -f minikube.deb
Zack Williams8aa52822018-04-05 09:22:15 -0700372 popd
373
Kailash Khalasi929d21b2018-06-28 12:28:17 -0700374 # install protobufs
Zack Williamsdf5a4ab2019-03-22 14:10:34 -0700375 PROTOC_VERSION="3.7.0"
376 PROTOC_SHA256SUM="a1b8ed22d6dc53c5b8680a6f1760a305b33ef471bece482e92728f00ba2a2969"
Kailash Khalasi929d21b2018-06-28 12:28:17 -0700377 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
378 echo "$PROTOC_SHA256SUM /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip" | sha256sum -c -
Kailash Khalasic4ff32d2018-06-28 18:24:52 -0700379 unzip /tmp/protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /tmp/protoc3
Kailash Khalasi929d21b2018-06-28 12:28:17 -0700380 mv /tmp/protoc3/bin/* /usr/local/bin/
381 mv /tmp/protoc3/include/* /usr/local/include/
Zack Williams0f80d902019-04-01 11:26:57 -0700382 # fix permissions on files
383 chmod -R a+rx /usr/local/bin/*
Zack Williams6b06aa52019-04-01 14:30:17 -0700384 chmod -R a+rX /usr/local/include/
Zack Williamscab43ba2018-09-19 09:58:25 -0700385
Kailash Khalasi929d21b2018-06-28 12:28:17 -0700386 # give sudo permissions on minikube and protoc to jenkins user
Zack Williams3fa10502020-09-29 22:03:02 -0700387 cat << EOF > /etc/sudoers.d/88-jenkins-minikube-protoc
Kailash Khalasi929d21b2018-06-28 12:28:17 -0700388Cmnd_Alias CMDS = /usr/local/bin/protoc, /usr/bin/minikube
Zack Williams81739772018-05-14 16:35:47 -0700389Defaults:jenkins !requiretty
Kailash Khalasi929d21b2018-06-28 12:28:17 -0700390jenkins ALL=(ALL) NOPASSWD:SETENV: CMDS
Zack Williams81739772018-05-14 16:35:47 -0700391EOF
392
Zack Williams9881aea2019-07-16 14:14:08 -0700393 # install hadolint (Dockerfile checker)
Zack Williams3fa10502020-09-29 22:03:02 -0700394 HADOLINT_VERSION="1.18.0"
395 HADOLINT_SHA256SUM="f9bc9de12438b463ca84e77fde70b07b155d4da07ca21bc3f4354a62c6199db4"
Zack Williams9881aea2019-07-16 14:14:08 -0700396 curl -L -o /tmp/hadolint https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VERSION}/hadolint-Linux-x86_64
397 echo "$HADOLINT_SHA256SUM /tmp/hadolint" | sha256sum -c -
398 mv /tmp/hadolint /usr/local/bin/hadolint
399 chmod -R a+rx /usr/local/bin/hadolint
400
Zack Williams7b3da532019-12-18 10:41:29 -0700401 # install pandoc (document converter)
Zack Williams3fa10502020-09-29 22:03:02 -0700402 PANDOC_VERSION="2.10.1"
403 PANDOC_SHA256SUM="4515d6fe2bf8b82765d8dfa1e1b63ccb0ff3332d60389f948672eaa37932e936"
Zack Williams7b3da532019-12-18 10:41:29 -0700404 curl -L -o /tmp/pandoc.deb "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-amd64.deb"
405 echo "$PANDOC_SHA256SUM /tmp/pandoc.deb" | sha256sum -c -
406 dpkg -i /tmp/pandoc.deb
407 rm -f /tmp/pandoc.deb
408
Zack Williams960c6622020-04-30 10:11:51 -0700409 # install yq (YAML query)
Zack Williams3fa10502020-09-29 22:03:02 -0700410 YQ_VERSION="3.4.0"
411 YQ_SHA256SUM="f6bd1536a743ab170b35c94ed4c7c4479763356bd543af5d391122f4af852460"
Zack Williams960c6622020-04-30 10:11:51 -0700412 curl -L -o /tmp/yq https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64
413 echo "$YQ_SHA256SUM /tmp/yq" | sha256sum -c -
414 mv /tmp/yq /usr/local/bin/yq
415 chmod -R a+rx /usr/local/bin/yq
416
Hung-Wei Chiua64209e2020-12-15 07:51:33 +0800417 # add docker cache
418 cat << EOF > /etc/docker/daemon.json
419{
420 "registry-mirrors":["https://mirror.registry.opennetworking.org"]
421}
422EOF
423 service docker restart
424
Andy Bavierb781c4c2018-09-20 08:16:52 -0700425 # remove apparmor
426 service apparmor stop
427 update-rc.d -f apparmor remove
428 apt-get remove apparmor-utils libapparmor-perl apparmor
429 update-grub
430
Zack Williams85249ce2018-04-01 19:54:44 -0700431 # clean up
432 apt-get clean
433 apt-get purge -y
434 apt-get autoremove -y
435 rm -rf /var/lib/apt/lists/*
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800436}
Zack Williams85249ce2018-04-01 19:54:44 -0700437
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -0800438all_systems() {
439 echo 'No common distribution configuration to perform'
440}
441
442echo "---> Detecting OS"
443ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
444
445case "${ORIGIN}" in
446 fedora|centos|redhat)
447 echo "---> RH type system detected"
448 rh_systems
449 ;;
450 ubuntu)
451 echo "---> Ubuntu system detected"
452 ubuntu_systems
453 ;;
454 *)
455 echo "---> Unknown operating system"
456 ;;
457esac
458
459# execute steps for all systems
460all_systems