Files
odo/scripts/setup_script_unit.sh
Anand Kumar Singh 9848769234 Automate psi ci for mac and windows (#4460)
* adding setup script and e2e-intigration,unit test script

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* adding mac and windows jobs

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fixing typo

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* Consolidating scripts

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fixing unit test for windows and typo

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* Fixing tests for windows and mac

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* Fixing  mac unit test go not found

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* Fixing  unit tests on windows mac

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* Fixing  unit tests on windows

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* Fixing  unit tests on windows

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* adding exchange for PSI tests

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* adding exchange for PSI tests

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fixing typo

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fixing unit test

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fix unit test using cache

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* rebase

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* increase oc download time

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* windows unit test fix & fix for oc on mac

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* windows unit test

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* remove e2e test from this PR

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* increase timeout for test & change ci-firewall version

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
2021-05-05 03:14:15 -04:00

42 lines
1.6 KiB
Bash

#!/usr/bin/env bash
shout() {
set +x
echo -e "\n!!!!!!!!!!!!!!!!!!!!\n${1}\n!!!!!!!!!!!!!!!!!!!!\n"
set -x
}
set -ex
shout "Setting up some stuff"
# Create a bin directory whereever script runs. This will be where all binaries that need to be in PATH will reside.
mkdir bin artifacts
# Change the default location of go's bin directory (without affecting GOPATH). This is where compiled binaries will end up by default
# for eg go get ginkgo later on will produce ginkgo binary in GOBIN
export GOBIN="`pwd`/bin"
# Set kubeconfig to current dir. This ensures no clashes with other test runs
export KUBECONFIG="`pwd`/config"
export ARTIFACT_DIR=${ARTIFACT_DIR:-"`pwd`/artifacts"}
export CUSTOM_HOMEDIR=$ARTIFACT_DIR
# Changing gocache to prevent unit test to use cache and pass
export GOCACHE=`pwd`/.gocache && mkdir $GOCACHE
# This si one of the variables injected by ci-firewall. Its purpose is to allow scripts to handle uniqueness as needed
SCRIPT_IDENTITY=${SCRIPT_IDENTITY:-"def-id"}
if [[ $BASE_OS == "windows" ]]; then
shout "Setting GOBIN for windows"
GOBIN="$(cygpath -pw $GOBIN)"
GOCACHE="$(cygpath -pw $GOCACHE)"
CUSTOM_HOMEDIR="$(cygpath -pw $CUSTOM_HOMEDIR)"
elif [[ $BASE_OS == "mac" ]]; then
PATH="$PATH:/usr/local/bin:/usr/local/go/bin" #Path to `go` command as `/usr/local/go/bin:/usr/local/bin` is not included in $PATH while running test
fi
shout "Setting PATH"
# Add GOBIN which is the bin dir we created earlier to PATH so any binaries there are automatically available in PATH
export PATH=$PATH:$GOBIN
#-----------------------------------------------------------------------------