Skip to content

Commit

Permalink
Merge pull request #165 from geekhub-php/develop
Browse files Browse the repository at this point in the history
Release 2.0
  • Loading branch information
spolischook authored Jan 18, 2021
2 parents 57b66b0 + 61f199f commit 544c89a
Show file tree
Hide file tree
Showing 193 changed files with 17,242 additions and 11,427 deletions.
10 changes: 7 additions & 3 deletions .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

"number-leading-zero": "never",
"number-no-trailing-zeros": true,
"unit-whitelist": ["px", "%", "deg"],
"unit-whitelist": ["px", "%", "deg", "s", "rem"],

"color-hex-case": "lower",
"color-named": "never",
Expand Down Expand Up @@ -44,7 +44,9 @@
"unit-case": "lower",

"value-keyword-case": "lower",
"value-no-vendor-prefix": true,
"value-no-vendor-prefix": [ true, {
"ignoreValues": "box"
}],

"max-empty-lines": 2,
"indentation": [ 2, {
Expand Down Expand Up @@ -90,10 +92,12 @@
true,
{
"ignoreAtRules": [
"extend",
"include",
"mixin",
"content",
"at-root"
"at-root",
"extend"
]
}
],
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ script:
- 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/'
- npm run build:ssr

notifications:
email:
Expand Down
163 changes: 151 additions & 12 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@
"root": "",
"sourceRoot": "src",
"projectType": "application",
"i18n": {
"sourceLocale": "en",
"locales": {
"uk": "src/assets/locale/locale.uk-ua.xlf"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"aot": true,
"outputPath": "dist/theatre-front/browser",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
Expand All @@ -26,28 +33,62 @@
"scripts": []
},
"configurations": {
"production": {
"production-en": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"vendorChunk": true,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
],
"localize": ["en"]
},
"staging": {
"production-uk": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": true,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"localize": ["uk"]
},
"staging-en": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
Expand All @@ -59,6 +100,29 @@
"with": "src/environments/environment.staging.ts"
}
]
},
"staging-uk": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.staging.ts"
}
],
"localize": ["uk"]
}
}
},
Expand All @@ -68,15 +132,27 @@
"browserTarget": "theatre-front:build"
},
"configurations": {
"production": {
"browserTarget": "theatre-front:build:production"
"production-en": {
"browserTarget": "theatre-front:build:production-en"
},
"production-uk": {
"browserTarget": "theatre-front:build:production-uk"
},
"staging": {
"browserTarget": "theatre-front:build:staging-en"
},
"uk": {
"browserTarget": "theatre-front:build:staging-uk"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "theatre-front:build"
"browserTarget": "theatre-front:build",
"outputPath": "src/assets/locale",
"outFile": "locale.xlf",
"format": "xlf"
}
},
"test": {
Expand All @@ -101,12 +177,75 @@
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
"src/tsconfig.spec.json",
"src/tsconfig.server.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"server": {
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist/theatre-front/server",
"main": "server.ts",
"tsConfig": "src/tsconfig.server.json"
},
"configurations": {
"production-en": {
"outputHashing": "media",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"sourceMap": false,
"localize": ["en"]
},
"production-uk": {
"outputHashing": "media",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"sourceMap": false,
"localize": ["uk"]
}
}
},
"serve-ssr": {
"builder": "@nguniversal/builders:ssr-dev-server",
"options": {
"browserTarget": "theatre-front:build",
"serverTarget": "theatre-front:server"
},
"configurations": {
"production-en": {
"browserTarget": "theatre-front:build:production-en",
"serverTarget": "theatre-front:server:production-en"
},
"production-uk": {
"browserTarget": "theatre-front:build:production-uk",
"serverTarget": "theatre-front:server:production-uk"
}
}
},
"prerender": {
"builder": "@nguniversal/builders:prerender",
"options": {
"browserTarget": "theatre-front:build:production",
"serverTarget": "theatre-front:server:production",
"routes": [
"/"
]
},
"configurations": {
"production": {}
}
}
}
},
Expand Down Expand Up @@ -140,7 +279,7 @@
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "scss"
"style": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"
Expand Down
48 changes: 48 additions & 0 deletions deploy.sh
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"
16 changes: 8 additions & 8 deletions e2e/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,43 @@ describe('theatre-front App', () => {
mainMenu = new MainMenu();
});

it('shold navigate to Home', () => {
it('should navigate to Home', () => {
page.navigateTo();
mainMenu.navigateTo('Main page');
expect(element(by.css('h3')).getText()).toContain('News');
});

it('shold navigate to Poster', () => {
it('should navigate to Poster', () => {
page.navigateTo();
mainMenu.navigateTo('Poster');
expect(element(by.css('h2')).getText()).toContain('Poster for');
});

it('shold navigate to Repertoire', () => {
it('should navigate to Repertoire', () => {
page.navigateTo();
mainMenu.navigateTo('Repertoire');
expect(element(by.css('h2')).getText()).toContain('Repertoire');
});

it('shold navigate to NewsItem', () => {
it('should navigate to NewsItem', () => {
page.navigateTo();
mainMenu.navigateTo('News');
expect(element(by.css('h2')).getText()).toContain('News');
});

it('shold navigate to About Us', () => {
it('should navigate to About Us', () => {
page.navigateTo();
mainMenu.navigateTo('About');
expect(element(by.css('h2')).getText()).toContain('About');
});

it('shold navigate to Persons', () => {
it('should navigate to Persons', () => {
page.navigateTo();
mainMenu.navigateTo('Persons');
expect(element(by.css('h3')).getText()).toContain('Theatre team');
expect(element(by.css('h2')).getText()).toContain('Persons');
});

it('shold navigate to Contacts', () => {
it('should navigate to Contacts', () => {
page.navigateTo();
mainMenu.navigateTo('Contacts');
expect(element(by.css('h2')).getText()).toContain('Contacts');
Expand Down
Loading

0 comments on commit 544c89a

Please sign in to comment.