Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/bulktrade/SMSC
Browse files Browse the repository at this point in the history
  • Loading branch information
dimakuba committed Feb 12, 2017
2 parents f291ed4 + 3014c4e commit ff8b88f
Show file tree
Hide file tree
Showing 13 changed files with 204 additions and 143 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,4 @@ pom.xml
/modules/admin/npm-debug.log*
/modules/admin/dll/
/modules/admin/compiled/
modules/admin/REPORTS
14 changes: 13 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ apt:
- maven

cache:
bundler: true
yarn: true
docker: true
directories:
- modules/admin/node_modules
- .autoconf
- $HOME/.m2
- $HOME/docker

language: java
install: true
Expand All @@ -23,6 +25,7 @@ jdk:
- oraclejdk8

before_install:
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand All @@ -31,11 +34,19 @@ before_install:
install:
- nvm install 7
- nvm use 7
- npm install -g yarn versioneye-update
- npm install -g yarn

script:
- ./bin/build.sh

after_success:
- ./bin/report.sh
- bash <(curl -s https://codecov.io/bash)
- ./bin/deploy.sh

before_cache:
- mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}' | xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz'

notifications:
email:
recipients:
Expand All @@ -46,5 +57,6 @@ notifications:
on_failure: always

addons:
srcclr: true
sonarqube: true
sauce_connect: true
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
[![Quality Gate](https://sonarqube.com/api/badges/gate?key=io.smsc:smsc)](https://sonarqube.com/dashboard/index/io.smsc:smsc)
[![Technical debt ratio](https://sonarqube.com/api/badges/measure?key=io.smsc:smsc&metric=sqale_debt_ratio)](https://sonarqube.com/dashboard/index/io.smsc:smsc)
[![javadoc.io](https://javadoc-emblem.rhcloud.com/doc/io.smsc/smsc/badge.svg)](http://www.javadoc.io/doc/io.smsc/smsc)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.smsc/smsc/badge.svg?style=flat-square)](https://maven-badges.herokuapp.com/maven-central/io.smsc/smsc/)
[![codecov](https://codecov.io/gh/bulktrade/SMSC/branch/master/graph/badge.svg)](https://codecov.io/gh/bulktrade/SMSC)
[![Selenium Test Status](https://saucelabs.com/buildstatus/smsc)](https://saucelabs.com/beta/builds/1e2ccc4a03864f668fb413c1934255e7)

[![Selenium Test Status](https://saucelabs.com/browser-matrix/smsc.svg)](https://saucelabs.com/u/smsc)
Expand Down
3 changes: 3 additions & 0 deletions bin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
set -e
mvn clean install
20 changes: 8 additions & 12 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
#!/bin/bash
set -x
set -e

mvn clean install

if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] ; then
mvn heroku:deploy -Dmaven.test.skip=true -Dmaven.integration-test.skip=true -Dmaven.javadoc.skip=true
fi
# Heroku deploy
mvn heroku:deploy -PskipBuildAndTests

if [ "$TRAVIS_BRANCH" == "master" ] ; then
docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push smscio/smsc;
fi
# Docker build & push
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
mvn -f modules/core docker:build -DpushImage -Dmaven.exec.skip=true

mvn -DrepoToken=$COVERALLS_REPO_TOKEN cobertura:cobertura coveralls:report org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar versioneye:update -Dmaven.test.skip=true -Dmaven.integration-test.skip=true -Dmaven.javadoc.skip=true
cd modules/admin && sonar-scanner -X
# Release to public repository
# mvn --settings sonatype-settings.xml -PskipBuildAndTests -B deploy
fi
2 changes: 2 additions & 0 deletions bin/report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
mvn -DrepoToken=$COVERALLS_REPO_TOKEN cobertura:cobertura coveralls:report org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar -Dmaven.exec.skip=true
8 changes: 4 additions & 4 deletions modules/admin/config/protractor.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exports.config = {
defaultTimeoutInterval: 400000
},

onPrepare: function() {
onPrepare: function () {
browser.ignoreSynchronization = true;
},

Expand All @@ -35,9 +35,9 @@ exports.config = {
*/
useAllAngular2AppRoots: true,

onComplete: function() {
var printSessionId = function(jobName){
browser.getSession().then(function(session) {
onComplete: function () {
var printSessionId = function (jobName) {
browser.getSession().then(function (session) {
console.log('SauceOnDemandSessionID=' + session.getId() + ' job-name=' + jobName);
});
};
Expand Down
28 changes: 27 additions & 1 deletion modules/admin/config/protractor.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,39 @@ const DefinePlugin = require('webpack/lib/DefinePlugin');
*/
const ENV = process.env.ENV = process.env.NODE_ENV = 'development';

var baseUrl;
if (process.env.TOMCAT_HTTP_PORT) {
baseUrl = commonConfig.config.baseUrl;
} else {
baseUrl = process.env.PROTRACTOR_BASE_URL ? process.env.PROTRACTOR_BASE_URL : 'http://localhost:3000';
}

exports.config = objectMerge(commonConfig.config, {
baseUrl: process.env.PROTRACTOR_BASE_URL ? process.env.PROTRACTOR_BASE_URL : 'http://localhost:3000',
baseUrl: baseUrl,
directConnect: true,
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': ['show-fps-counter=true']
}
},

plugins: [{
package: 'protractor-screenshoter-plugin',
screenshotPath: './REPORTS/e2e/' + new Date().toISOString(),
screenshotOnExpect: 'failure+success',
screenshotOnSpec: 'none',
withLogs: 'true',
writeReportFreq: 'asap',
imageToAscii: 'failure',
clearFoldersBeforeTest: true
}],

onPrepare: function () {
browser.ignoreSynchronization = true;

return global.browser.getProcessedConfig().then(function(config) {
//it is ok to be empty
});
}
});
1 change: 1 addition & 0 deletions modules/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
"postcss-loader": "^0.13.0",
"primeng": "2.0.0",
"protractor": "^4.0.10",
"protractor-screenshoter-plugin": "^0.3.2",
"raw-loader": "0.5.1",
"resolve-url-loader": "^1.6.1",
"rimraf": "^2.5.2",
Expand Down
8 changes: 7 additions & 1 deletion modules/admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<skip>${maven.exec.skip}</skip>
</configuration>
<executions>
<execution>
<id>exec-npm-install</id>
<phase>process-resources</phase>
<phase>compile</phase>
<configuration>
<executable>npm</executable>
<workingDirectory>${project.basedir}</workingDirectory>
Expand Down Expand Up @@ -100,6 +103,9 @@
<fileset>
<directory>${basedir}/dist</directory>
</fileset>
<fileset>
<directory>${basedir}/REPORTS</directory>
</fileset>
<fileset>
<directory>${basedir}/compiled</directory>
</fileset>
Expand Down
Loading

0 comments on commit ff8b88f

Please sign in to comment.