Skip to content

Commit 9fc29bc

Browse files
committed
build: Do not download credentials in pull request
1 parent f12d235 commit 9fc29bc

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

Travis/installSDK.sh

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,50 @@
11
#! /bin/sh
22
project="unity-sdk-travis"
33

4-
echo "Attempting to install credentials"
5-
git clone https://$CREDENTIALS_GITHUB_TOKEN@github.ibm.com/germanatt/sdk-credentials.git Travis/sdk-credentials/
4+
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
5+
echo "Attempting to install credentials"
6+
git clone https://$CREDENTIALS_GITHUB_TOKEN@github.ibm.com/germanatt/sdk-credentials.git Travis/sdk-credentials/
67

7-
if [ $? = 0 ] ; then
8-
echo "Credentials install SUCCEEDED! Exited with $?"
9-
export IBM_CREDENTIALS_FILE=$(pwd)/Travis/sdk-credentials/ibm-credentials.env
8+
if [ $? = 0 ] ; then
9+
echo "Credentials install SUCCEEDED! Exited with $?"
10+
else
11+
echo "Credentials install FAILED! Exited with $?"
12+
exit 1
13+
fi
1014
else
11-
echo "Credentials install FAILED! Exited with $?"
12-
exit 1
15+
echo "This is a pull request - do not attempt to install credentials"
1316
fi
1417

15-
1618
echo "Attempting to install IBM Watson SDK for Unity into the test project..."
1719
mkdir -p Travis/UnityTestProject/Assets/Watson/
1820
git clone -b $TRAVIS_BRANCH https://github.com/watson-developer-cloud/unity-sdk.git Travis/UnityTestProject/Assets/Watson/
1921

2022
if [ $? = 0 ] ; then
2123
echo "WDC Unity SDK install SUCCEEDED! Exited with $?"
2224

25+
echo "Attempting to remove TravisIntegrationTests from Travis directory..."
26+
rm Travis/TravisIntegrationTests.cs
27+
if [ $? = 0 ] ; then
28+
echo "Removing travis build script SUCCEEDED! Exited with $?"
29+
else
30+
echo "Removing travis build script FAILED! Exited with $?"
31+
exit 1
32+
fi
33+
2334
echo "Attempting to create Travis/UnityTestProject/Assets/Scripts/Editor/"
2435
mkdir -p Travis/UnityTestProject/Assets/Scripts/Editor/
2536
if [ $? = 0 ] ; then
2637
echo "Creating Travis/UnityTestProject/Assets/Scripts/Editor/ SUCCEEDED! Exited with $?"
38+
39+
echo "Attempting to move integration tests script..."
40+
mv Travis/UnityTestProject/Assets/Watson/Travis/TravisIntegrationTests.cs Travis/UnityTestProject/Assets/Scripts/Editor/TravisIntegrationTests.cs
41+
if [ $? = 0 ] ; then
42+
echo "Moving travis integration tests script SUCCEEDED! Exited with $?"
43+
exit 0
44+
else
45+
echo "Moving travis integration tests script FAILED! Exited with $?"
46+
exit 1
47+
fi
2748
else
2849
echo "Creating Travis/UnityTestProject/Assets/Scripts/Editor/ FAILED! EXITED WITH $?"
2950
fi

0 commit comments

Comments
 (0)