-
Notifications
You must be signed in to change notification settings - Fork 54
/
environmentSetup.sh
52 lines (47 loc) · 3.04 KB
/
environmentSetup.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
function copyEnvVarsToGradleProperties {
GRADLE_PROPERTIES=$HOME"/.gradle/gradle.properties"
export GRADLE_PROPERTIES
echo "Gradle Properties should exist at $GRADLE_PROPERTIES"
if [ ! -f "$GRADLE_PROPERTIES" ]; then
echo "Gradle Properties does not exist"
echo "Creating Gradle Properties file..."
touch $GRADLE_PROPERTIES
echo "Writing MIXPANEL_TOKEN to gradle.properties..."
echo "MIXPANEL_TOKEN_SANDBOX=$MIXPANEL_TOKEN_SANDBOX" >> $GRADLE_PROPERTIES
echo "MIXPANEL_TOKEN_PRODUCTION=$MIXPANEL_TOKEN_PRODUCTION" >> $GRADLE_PROPERTIES
echo "MERCHANT_BASE_URL_SANDBOX=$MERCHANT_BASE_URL_SANDBOX" >> $GRADLE_PROPERTIES
echo "MERCHANT_CLIENT_KEY_SANDBOX=$MERCHANT_CLIENT_KEY_SANDBOX" >> $GRADLE_PROPERTIES
echo "MERCHANT_BASE_URL_PRODUCTION=$MERCHANT_BASE_URL_PRODUCTION" >> $GRADLE_PROPERTIES
echo "MERCHANT_CLIENT_KEY_PRODUCTION=$MERCHANT_CLIENT_KEY_PRODUCTION" >> $GRADLE_PROPERTIES
echo "MERCHANT_BASE_URL_STAGING=$MERCHANT_BASE_URL_STAGING" >> $GRADLE_PROPERTIES
echo "MERCHANT_CLIENT_KEY_STAGING=$MERCHANT_CLIENT_KEY_STAGING" >> $GRADLE_PROPERTIES
echo "KEYSTORE=$KEYSTORE" >> $GRADLE_PROPERTIES
echo "KEYSTORE_PASSWORD=$KEYSTORE_PASSWORD" >> $GRADLE_PROPERTIES
echo "KEY_ALIAS=$KEY_ALIAS" >> $GRADLE_PROPERTIES
echo "KEY_PASSWORD=$KEY_PASSWORD" >> $GRADLE_PROPERTIES
echo "ISSUE_TRACKER_API_KEY=$ISSUE_TRACKER_API_KEY" >> $GRADLE_PROPERTIES
echo "PREFERENCE_PASSWORD=$PREFERENCE_PASSWORD" >> $GRADLE_PROPERTIES
else
> $GRADLE_PROPERTIES
echo "File exist. Clear previous data."
echo "Writing MIXPANEL_TOKEN to gradle.properties..."
echo "MIXPANEL_TOKEN_SANDBOX=$MIXPANEL_TOKEN_SANDBOX" >> $GRADLE_PROPERTIES
echo "MIXPANEL_TOKEN_PRODUCTION=$MIXPANEL_TOKEN_PRODUCTION" >> $GRADLE_PROPERTIES
echo "MERCHANT_BASE_URL_SANDBOX=$MERCHANT_BASE_URL_SANDBOX" >> $GRADLE_PROPERTIES
echo "MERCHANT_CLIENT_KEY_SANDBOX=$MERCHANT_CLIENT_KEY_SANDBOX" >> $GRADLE_PROPERTIES
echo "MERCHANT_BASE_URL_PRODUCTION=$MERCHANT_BASE_URL_PRODUCTION" >> $GRADLE_PROPERTIES
echo "MERCHANT_CLIENT_KEY_PRODUCTION=$MERCHANT_CLIENT_KEY_PRODUCTION" >> $GRADLE_PROPERTIES
echo "MERCHANT_BASE_URL_STAGING=$MERCHANT_BASE_URL_STAGING" >> $GRADLE_PROPERTIES
echo "MERCHANT_CLIENT_KEY_STAGING=$MERCHANT_CLIENT_KEY_STAGING" >> $GRADLE_PROPERTIES
echo "KEYSTORE=$KEYSTORE" >> $GRADLE_PROPERTIES
echo "KEYSTORE_PASSWORD=$KEYSTORE_PASSWORD" >> $GRADLE_PROPERTIES
echo "KEY_ALIAS=$KEY_ALIAS" >> $GRADLE_PROPERTIES
echo "KEY_PASSWORD=$KEY_PASSWORD" >> $GRADLE_PROPERTIES
echo "ISSUE_TRACKER_API_KEY=$ISSUE_TRACKER_API_KEY" >> $GRADLE_PROPERTIES
echo "PREFERENCE_PASSWORD=$PREFERENCE_PASSWORD" >> $GRADLE_PROPERTIES
fi
}
function setGit {
git config --global user.name $GITHUB_NAME
git config --global user.email $GITHUB_EMAIL
}