diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..345f50d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +language: node_js +node_js: +- '12' +dist: trusty +branches: + only: + - master +cache: + directories: + - node_modules +addons: + chrome: stable + sonarcloud: + organization: speech4j +before_script: +- npm install +script: +- npm run test-headless +- sonar-scanner -Dsonar.verbose=true -X +- npm run build +deploy: + provider: heroku + skip_cleanup: true + keep-history: true + app: speech4jweb + api_key: + secure: fZLBDGUUwJS6setqj4DDwHCwfr7ybdkSTu7rhEGXLawOFYpUvLkOP/McYBITMh9bOFe59HLsF5mfKb3v7B+xP8qjsTWzdVOB7jWztoEznZgXupcGhAX2DFO0y1SBYOvsg+Tq7623rIYQoqcX6bsATD0drlv1qhS4tjblxLzTZm8L0c4SA1w5JeSzSHL8yS83O9iXeJQKBsqaOA7qNEqmDpU4YGGenAK0FBGWNFnW5uvFFJKg9B/c8F73mXw/u2pMeYU2w8Gop5SIn9I211WA23El5I4LR7rYEvd/8tuW50InpDlL2BVS32hjrZa+xQPIIKFgtR3YssLc23kc/98K0Z9QM52LPlzoZTpGBtDgSK3hYU9ZtVRSRqL2V8m5tYnZehOSkwOfvveirQk1r/DRxk7c7F5KkIQ6GpYqbUbSJT+oCn/UsIirqI1GxFF18H88AsXr2BCgejpPDHKDu291AItLGls6SJQKQsRZCCp2JgIHUqZL60XWNo0kYteNtQyeynq8UhoCBueZFxh+sbT/56EMPXBO/7/U8nvoZ/xRO+VYgmGArpz3opjAusIa6YlXns0PgaCilJHnX64VE2ykioiYBtAfOTWG0bsTViiqcH40M3h1kjRpzQDyPCcN+btNx6qHTUyhmANQHLVpinLaIrJtCBCHZ7KNJsborIlNgUo= + +after_deploy: +- echo "Application Deployed!" diff --git a/e2e/protractor.conf.js b/e2e/protractor.conf.js index 7c798cf..2e579a3 100644 --- a/e2e/protractor.conf.js +++ b/e2e/protractor.conf.js @@ -13,6 +13,9 @@ exports.config = { './src/**/*.e2e-spec.ts' ], capabilities: { + chromeOptions: { + args: [ "--headless" ] + }, browserName: 'chrome' }, directConnect: true, diff --git a/karma.conf.js b/karma.conf.js index 96bf3ff..39fa3ab 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -25,7 +25,13 @@ module.exports = function (config) { colors: true, logLevel: config.LOG_INFO, autoWatch: true, - browsers: ['Chrome'], + browsers: ['ChromeHeadlessNoSandbox'], + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: 'ChromeHeadless', + flags: ['--no-sandbox'] + } + }, singleRun: false, restartOnFileChange: true }); diff --git a/package.json b/package.json index c6c370a..40cea5f 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,14 @@ "version": "0.0.0", "scripts": { "ng": "ng", - "start": "ng serve", + "start": "node server.js", "build": "ng build", "test": "ng test", "lint": "ng lint", - "e2e": "ng e2e" + "e2e": "ng e2e", + "build-prod": "ng build --prod", + "test-headless": "ng test --watch=false --code-coverage", + "preinstall": "npm install -g angular-cli" }, "private": true, "dependencies": { diff --git a/server.js b/server.js new file mode 100644 index 0000000..c92c47f --- /dev/null +++ b/server.js @@ -0,0 +1,14 @@ +const express = require('express'); +const path = require('path'); +const app = express(); + +// Serve static files.... +app.use(express.static(__dirname + '/dist/web')); + +// Send all requests to index.html +app.get('/*', function(req, res) { + res.sendFile(path.join(__dirname + '/dist/web/index.html')); +}); + +// default Heroku PORT 3000 +app.listen(process.env.PORT || 3000); \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..c5f1a07 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,11 @@ +sonar.projectKey=speech4j_speech-to-text-comparator-ui +sonar.organization=speech4j +sonar.projectName=speech-to-text-comparator-ui +sonar.projectVersion=1.0 +sonar.sources=src +sonar.sourceEncoding=UTF-8 +sonar.exclusions=**/node_modules/**,**/*.spec.ts +sonar.tests=src/app +sonar.test.inclusions=**/*.spec.ts +sonar.ts.tslint.configPath=tslint.json +sonar.typescript.lcov.reportPaths=coverage/web/lcov.info \ No newline at end of file