-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from geekhub-php/develop
Release 2.0
- Loading branch information
Showing
193 changed files
with
17,242 additions
and
11,427 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
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
set -e | ||
set -o errexit | ||
|
||
rm -rf dist | ||
|
||
DOMAIN_PROD="http://theatre-shevchenko.ck.ua" | ||
DOMAIN_STAGING="http://develop.theatre.pp.ua" | ||
BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
SSH_HOST="[email protected]" | ||
|
||
npm run lint | ||
npm run lint-css | ||
ng test --watch=false --browsers=ChromeHeadlessNoSandbox --code-coverage=true | ||
ng e2e | ||
|
||
if [ "$BRANCH" = "master" ]; then DOMAIN=$DOMAIN_PROD; else DOMAIN="$DOMAIN_STAGING/$BRANCH"; fi | ||
if [ "$BRANCH" = "master" ]; then ENV="production"; else ENV="staging"; fi | ||
if [ "$BRANCH" = "master" ]; then BASE_HREF="/"; else BASE_HREF="/$BRANCH/"; fi | ||
ng build --configuration=$ENV \ | ||
--deploy-url=$DOMAIN/uk/ \ | ||
--base-href="$BASE_HREF"uk/ \ | ||
--aot true --vendor-chunk true \ | ||
--output-path 'dist/uk/' \ | ||
--i18n-file src/assets/locale/locale.uk-ua.xlf \ | ||
--i18n-format xlf \ | ||
--i18n-locale uk-UA \ | ||
--verbose \ | ||
--i18n-missing-translation=error | ||
|
||
ng build --configuration=$ENV \ | ||
--deploy-url=$DOMAIN/en/ \ | ||
--base-href="$BASE_HREF"en/ \ | ||
--aot true \ | ||
--vendor-chunk true \ | ||
--output-path "dist/en/" | ||
|
||
cp ./deploy/branch.conf ./dist/ | ||
cp ./deploy/index.html ./dist/ | ||
cd dist/ && tar -zcvf ../dist.tar.gz * && cd - | ||
|
||
ssh -i ./deploy/.ssh/staging $SSH_HOST "pwd" | ||
scp -i ./deploy/.ssh/staging dist.tar.gz $SSH_HOST:~/theatre-front/$BRANCH.tar.gz | ||
ssh $SSH_HOST "rm -rf ~/theatre-front/$BRANCH && mkdir ~/theatre-front/$BRANCH" | ||
ssh $SSH_HOST "tar -xf ~/theatre-front/$BRANCH.tar.gz -C ~/theatre-front/$BRANCH" | ||
ssh $SSH_HOST "sed -e 's/{{branch}}/$BRANCH/g' ~/theatre-front/$BRANCH/branch.conf > ~/nginxconf/$BRANCH.conf" | ||
|
||
echo "Deployed to $DOMAIN" |
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
Oops, something went wrong.