diff options
author | 2018-02-13 10:00:57 -0800 | |
---|---|---|
committer | 2018-02-13 10:00:57 -0800 | |
commit | 4bbbfe9f76c8c1caf7451cad16991aefe821edca (patch) | |
tree | f02645b8f6e8da59a7d1fa8f8fe33738c5eb1d33 /tools | |
parent | 893ca2de0bdbe1294f5448f8692fffe3d3967078 (diff) |
Fix linux_performance_worker_init.sh to pass shellcheck
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/gce/linux_performance_worker_init.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/gce/linux_performance_worker_init.sh b/tools/gce/linux_performance_worker_init.sh index 8d900f1d16..6f6866096d 100755 --- a/tools/gce/linux_performance_worker_init.sh +++ b/tools/gce/linux_performance_worker_init.sh @@ -81,10 +81,11 @@ sudo pip install virtualenv # is not available on Ubuntu 16.10, so install from source curl -O https://www.python.org/ftp/python/3.4.6/Python-3.4.6.tgz tar xzvf Python-3.4.6.tgz -cd Python-3.4.6 +( +cd Python-3.4.6 || exit ./configure --enable-shared --prefix=/usr/local LDFLAGS="-Wl,--rpath=/usr/local/lib" sudo make altinstall -cd .. +) rm Python-3.4.6.tgz curl -O https://bootstrap.pypa.io/get-pip.py @@ -95,6 +96,8 @@ sudo pip install google-api-python-client # Node dependencies (nvm has to be installed under user jenkins) touch .profile curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash +# silence shellcheck warning as it cannot follow the `source` path statically: +# shellcheck disable=SC1090 source ~/.nvm/nvm.sh nvm install 0.12 && npm config set cache /tmp/npm-cache nvm install 4 && npm config set cache /tmp/npm-cache @@ -151,7 +154,7 @@ sudo ln -s /usr/local/go/bin/go /usr/bin/go rm go$GO_VERSION.$OS-$ARCH.tar.gz # Install perf, to profile benchmarks. (need to get the right linux-tools-<> for kernel version) -sudo apt-get install -y linux-tools-common linux-tools-generic linux-tools-`uname -r` +sudo apt-get install -y linux-tools-common linux-tools-generic "linux-tools-$(uname -r)" # see http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar echo 0 | sudo tee /proc/sys/kernel/perf_event_paranoid # see http://stackoverflow.com/questions/21284906/perf-couldnt-record-kernel-reference-relocation-symbol @@ -171,7 +174,9 @@ sudo apt-get install -y python-scipy python-numpy # Add pubkey of jenkins@grpc-jenkins-master to authorized keys of jenkins@ # This needs to happen as the last step to prevent Jenkins master from connecting # to a machine that hasn't been properly setup yet. -cat jenkins_master.pub | sudo tee --append ~jenkins/.ssh/authorized_keys +# silence false-positive shellcheck warning ("< redirect does not affect sudo") +# shellcheck disable=SC2024 +sudo tee --append ~jenkins/.ssh/authorized_keys < jenkins_master.pub # Restart for VM to pick up kernel update echo 'Successfully initialized the linux worker, going for reboot in 10 seconds' |