-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
20 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
#!/bin/bash | ||
set -e # exit with nonzero exit code if anything fails | ||
|
||
echo "TRAVIS_BRANCH=${TRAVIS_BRANCH}" | ||
echo "TRAVIS_BUILD_DIR=${TRAVIS_BUILD_DIR}" | ||
echo "TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST}" | ||
|
||
# If current branch not "master" or it's PR | ||
if [ "${TRAVIS_BRANCH}" = "master" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then | ||
echo "Clear and re-create the dist directory..."; | ||
rm -rf dist || exit 1; | ||
echo "Clear and re-create the dist directory..."; | ||
rm -rf dist || exit 1; | ||
|
||
echo "Run kotlin application to generate various data..."; | ||
./gradlew installDist | ||
AWESOME_KOTLIN_OPTS="-Xmx2g" ./build/install/awesome-kotlin/bin/awesome-kotlin true | ||
echo "Run kotlin application to generate various data..."; | ||
AWESOME_KOTLIN_OPTS="-Xmx2g" ./build/install/awesome-kotlin/bin/awesome-kotlin true | ||
|
||
echo "Build React Application..."; | ||
npm run pack | ||
echo "Build React Application..."; | ||
npm run pack | ||
|
||
echo "Sync with remote folder..." | ||
rsync -r --delete-after --quiet "${TRAVIS_BUILD_DIR}/dist/" deploy@kotlin.link:~/files/kotlin.link | ||
else | ||
echo "Deploy only on master branch. Current branch: \"${TRAVIS_BRANCH}\"."; | ||
exit 0; | ||
fi | ||
echo "Add ssh key to remote server..." | ||
openssl aes-256-cbc -K $encrypted_83630750896a_key -iv $encrypted_83630750896a_iv -in deploy@morty.enc -out ~/.ssh/deploy@morty -d | ||
chmod 600 ~/.ssh/deploy@morty | ||
eval "$(ssh-agent -s)" | ||
ssh-add ~/.ssh/deploy@morty | ||
|
||
echo "Sync with remote folder..." | ||
rsync -r --delete-after --quiet "${TRAVIS_BUILD_DIR}/dist/" deploy@kotlin.link:~/files/kotlin.link |