-
Notifications
You must be signed in to change notification settings - Fork 30
/
run.sh
executable file
·79 lines (57 loc) · 1.79 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env bash
set -e
echo "starting the Jenkins X BDD tests..."
if [ -z "$GIT_USERNAME" ]
then
export GIT_USERNAME="jenkins-x-labs-bot"
fi
if [ -z "$GIT_SERVER_HOST" ]
then
export GIT_SERVER_HOST="github.com"
fi
if [ -z "$GH_OWNER" ]
then
export GH_OWNER="cb-kubecd"
fi
if [ -z "$QUICKSTART" ]
then
export QUICKSTART="golang"
fi
export GIT_USER_EMAIL="[email protected]"
export GIT_PROVIDER_URL="https://${GIT_SERVER_HOST}"
if [ -z "$GIT_TOKEN" ]
then
echo "ERROR: no GIT_TOKEN env var defined"
exit 1
else
echo "has valid git token"
fi
export GITHUB_TOKEN="${GIT_TOKEN//[[:space:]]}"
# lets turn off color output
export TERM=dumb
export JX_DISABLE_DELETE_APP="true"
export JX_DISABLE_DELETE_REPO="true"
# increase the timeout for complete PipelineActivity
export BDD_TIMEOUT_PIPELINE_ACTIVITY_COMPLETE="60"
# we don't yet update the PipelineActivity.spec.pullTitle on previews....
export BDD_DISABLE_PIPELINEACTIVITY_CHECK="true"
# define variables for the BDD tests
export GIT_ORGANISATION="$GH_OWNER"
export GH_USERNAME="$GIT_USERNAME"
# lets ensure that git is setup
export CURRENT_GIT_USER_NAME=$(git config --global --get user.name)
export CURRENT_GIT_USER_EMAIL=$(git config --global --get user.email)
if [ -z "$CURRENT_GIT_USER_NAME" ]
then
git config --global --add user.name ${GIT_USERNAME:-jenkins-x-bot}
fi
if [ -z "$CURRENT_GIT_USER_EMAIL" ]
then
git config --global --add user.email ${GIT_EMAIL:[email protected]}
fi
export CURRENT_GIT_USER_NAME=$(git config --global --get user.name)
export CURRENT_GIT_USER_EMAIL=$(git config --global --get user.email)
echo "git user name: $CURRENT_GIT_USER_NAME"
echo "git user email: $CURRENT_GIT_USER_EMAIL"
echo "Running the BDD tests for $QUICKSTART"
bddjx -ginkgo.focus=$QUICKSTART -test.v