#!/bin/bash # Copyright (c) 2017 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # test-setup.sh - Install required stuffs # Used in both CI jobs and locally # # Install the following tools: # * godep # Get OS case $(uname -s) in Darwin) OS=darwin ;; Linux) if LSB_RELEASE=$(which lsb_release); then OS=$($LSB_RELEASE -s -c) else # No lsb-release, trya hack or two if which dpkg 1>/dev/null; then OS=debian elif which yum 1>/dev/null || which dnf 1>/dev/null; then OS=redhat else echo "Linux distro not yet supported" exit 1 fi fi ;; *) echo "Unsupported OS" exit 1 ;; esac if which go 1>/dev/null; then if ! which go 1>/dev/null; then go get -u -v github.com/tools/godep fi else echo "go not found, install golang from source?" fi