2019-08-11 10:20:53 +00:00
# For personnal CI
# mv /home/runner/workspace/src/github.com/<username>/ /home/runner/workspace/src/github.com/containous/
# cd /home/runner/workspace/src/github.com/containous/traefik/
2019-07-15 05:06:03 +00:00
for s in apache2 cassandra elasticsearch memcached mysql mongod postgresql sphinxsearch rethinkdb rabbitmq-server redis-server; do sudo service $s stop; done
sudo swapoff -a
sudo dd if = /dev/zero of = /swapfile bs = 1M count = 3072
sudo mkswap /swapfile
sudo swapon /swapfile
sudo rm -rf /home/runner/.rbenv
2019-08-26 13:06:05 +00:00
sudo rm -rf /usr/local/golang/{ 1.4.3,1.5.4,1.6.4,1.7.6,1.8.6,1.9.7,1.10.3,1.11}
2019-07-15 05:06:03 +00:00
#export DOCKER_VERSION=18.06.3
2018-05-18 22:30:03 +00:00
source .semaphoreci/vars
2019-07-15 05:06:03 +00:00
if [ -z " ${ PULL_REQUEST_NUMBER } " ] ; then SHOULD_TEST = "-*-" ; else TEMP_STORAGE = $( curl --silent https://patch-diff.githubusercontent.com/raw/containous/traefik/pull/${ PULL_REQUEST_NUMBER } .diff | patch --dry-run -p1 -R || true ) ; fi
echo ${ SHOULD_TEST }
2018-05-23 14:12:05 +00:00
if [ -n " $TEMP_STORAGE " ] ; then SHOULD_TEST = $( echo " $TEMP_STORAGE " | grep -Ev '(.md|.yaml|.yml)' || :) ; fi
2019-07-15 05:06:03 +00:00
echo ${ TEMP_STORAGE }
echo ${ SHOULD_TEST }
#if [ -n "$SHOULD_TEST" ]; then sudo -E apt-get -yq update; fi
#if [ -n "$SHOULD_TEST" ]; then sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install docker-ce=${DOCKER_VERSION}*; fi
2019-08-26 13:06:05 +00:00
if [ -n " $SHOULD_TEST " ] ; then docker version; fi
2019-09-04 09:16:03 +00:00
export GO_VERSION = 1.13
2019-08-26 13:06:05 +00:00
if [ -f "./go.mod" ] ; then GO_VERSION = " $( grep '^go .*' go.mod | awk '{print $2}' ) " ; export GO_VERSION; fi
2019-09-04 09:16:03 +00:00
#if [ "${GO_VERSION}" == '1.13' ]; then export GO_VERSION=1.13rc2; fi
2019-08-26 13:06:05 +00:00
echo " Selected Go version: ${ GO_VERSION } "
2019-07-15 05:06:03 +00:00
if [ -f "./.semaphoreci/golang.sh" ] ; then ./.semaphoreci/golang.sh; fi
2019-08-26 13:06:05 +00:00
if [ -f "./.semaphoreci/golang.sh" ] ; then export GOROOT = " /usr/local/golang/ ${ GO_VERSION } /go " ; fi
if [ -f "./.semaphoreci/golang.sh" ] ; then export GOTOOLDIR = " /usr/local/golang/ ${ GO_VERSION } /go/pkg/tool/linux_amd64 " ; fi
go version
2019-08-11 10:20:53 +00:00
if [ -f "./go.mod" ] ; then export GO111MODULE = on; fi
if [ -f "./go.mod" ] ; then export GOPROXY = https://proxy.golang.org; fi
if [ -f "./go.mod" ] ; then go mod download; fi
2019-08-26 13:06:05 +00:00
2019-08-11 10:20:53 +00:00
df