-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·30 lines (25 loc) · 1.07 KB
/
deploy.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
#!/bin/bash
EXPECTED_TRAVIS_REPO_SLUG="code-schreiber/Replorer"
EXPECTED_TRAVIS_BRANCH="master"
# Script should bail on first error
set -e
echo "Running deploy.sh"
echo "deploy.sh: TRAVIS_BRANCH: $TRAVIS_BRANCH"
echo "deploy.sh: TRAVIS_REPO_SLUG: $TRAVIS_REPO_SLUG"
echo "deploy.sh: TRAVIS_TAG: $TRAVIS_TAG"
echo "deploy.sh: TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST"
echo "deploy.sh: Running gradle build"
./gradlew build
echo "deploy.sh: app/build/outputs/apk/release now contains:"
ls -l app/build/outputs/apk/release
if [ "$TRAVIS_REPO_SLUG" != "$EXPECTED_TRAVIS_REPO_SLUG" ]; then
echo "deploy.sh: Skipping deployment: wrong repository. Expected '$EXPECTED_TRAVIS_REPO_SLUG' but was '$TRAVIS_REPO_SLUG'."
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "deploy.sh: Skipping deployment: was pull request."
elif [ "$TRAVIS_BRANCH" != "$EXPECTED_TRAVIS_BRANCH" ]; then
echo "deploy.sh: Skipping deployment: wrong branch. Expected '$EXPECTED_TRAVIS_BRANCH' but was '$TRAVIS_BRANCH'."
else
echo "Thank you, come again."
exit $?
fi
echo "Exiting deploy.sh, skipping deployment"