Skip to content

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrycz committed Sep 22, 2016
0 parents commit 19f0b8d
Show file tree
Hide file tree
Showing 219 changed files with 11,392 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
node {
// uncomment these 2 lines and edit the name 'node-4.4.7' according to what you choose in configuration
// def nodeHome = tool name: 'node-4.4.7', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
// env.PATH = "${nodeHome}/bin:${env.PATH}"

stage 'check tools'
sh "node -v"
sh "npm -v"
sh "bower -v"
sh "gulp -v"

stage 'checkout'
checkout scm

stage 'npm install'
sh "npm install"

stage 'clean'
sh "./mvnw clean"

stage 'backend tests'
sh "./mvnw test"

stage 'frontend tests'
sh "gulp test"

stage 'packaging'
sh "./mvnw package -Pprod -DskipTests"
}
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# sprint

This application was generated using JHipster, you can find documentation and help at [https://jhipster.github.io](https://jhipster.github.io).

## Development

Before you can build this project, you must install and configure the following dependencies on your machine:

1. [Node.js][]: We use Node to run a development web server and build the project.
Depending on your system, you can install Node either from source or as a pre-packaged bundle.

After installing Node, you should be able to run the following command to install development tools (like
[Bower][] and [BrowserSync][]). You will only need to run this command when dependencies change in package.json.

npm install

We use [Gulp][] as our build system. Install the Gulp command-line tool globally with:

npm install -g gulp

Run the following commands in two separate terminals to create a blissful development experience where your browser
auto-refreshes when files change on your hard drive.

./mvnw
gulp

Bower is used to manage CSS and JavaScript dependencies used in this application. You can upgrade dependencies by
specifying a newer version in `bower.json`. You can also run `bower update` and `bower install` to manage dependencies.
Add the `-h` flag on any command to see how you can use it. For example, `bower update -h`.


## Building for production

To optimize the sprint client for production, run:

./mvnw -Pprod clean package

This will concatenate and minify CSS and JavaScript files. It will also modify `index.html` so it references
these new files.

To ensure everything worked, run:

java -jar target/*.war

Then navigate to [http://localhost:8080](http://localhost:8080) in your browser.

## Testing

Unit tests are run by [Karma][] and written with [Jasmine][]. They're located in `src/test/javascript/` and can be run with:

gulp test



## Continuous Integration

To setup this project in Jenkins, use the following configuration:

* Project name: `sprint`
* Source Code Management
* Git Repository: `[email protected]:xxxx/sprint.git`
* Branches to build: `*/master`
* Additional Behaviours: `Wipe out repository & force clone`
* Build Triggers
* Poll SCM / Schedule: `H/5 * * * *`
* Build
* Invoke Maven / Tasks: `-Pprod clean package`
* Post-build Actions
* Publish JUnit test result report / Test Report XMLs: `build/test-results/*.xml`

[JHipster]: https://jhipster.github.io/
[Node.js]: https://nodejs.org/
[Bower]: http://bower.io/
[Gulp]: http://gulpjs.com/
[BrowserSync]: http://www.browsersync.io/
[Karma]: http://karma-runner.github.io/
[Jasmine]: http://jasmine.github.io/2.0/introduction.html
[Protractor]: https://angular.github.io/protractor/
64 changes: 64 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"version": "0.0.0",
"name": "sprint",
"appPath": "src/main/webapp/",
"testPath": "src/test/javascript/spec",
"dependencies": {
"angular": "1.5.8",
"angular-aria": "1.5.8",
"angular-bootstrap": "1.3.3",
"angular-cache-buster": "0.4.3",
"angular-cookies": "1.5.8",
"angular-dynamic-locale": "0.1.32",
"angular-i18n": "1.5.8",
"ngstorage": "0.3.10",
"angular-loading-bar": "0.9.0",
"angular-resource": "1.5.8",
"angular-sanitize": "1.5.8",
"angular-translate": "2.11.1",
"angular-translate-interpolation-messageformat": "2.11.1",
"angular-translate-loader-partial": "2.11.1",
"angular-translate-storage-cookie": "2.11.1",
"angular-ui-router": "0.3.1",
"bootstrap": "3.3.6",
"bootstrap-ui-datetime-picker": "2.4.3",
"jquery": "3.1.0",
"json3": "3.3.2",
"messageformat": "0.3.1",
"modernizr": "3.3.1",
"ng-file-upload": "12.0.4",
"ngInfiniteScroll": "1.3.0",
"swagger-ui": "2.1.5",
"angular-underscore-module": "^1.0.3"
},
"devDependencies": {
"angular-mocks": "1.5.8"
},
"overrides": {
"angular": {
"dependencies": {
"jquery": "3.1.0"
}
},
"angular-cache-buster": {
"dependencies": {
"angular": "1.5.8"
}
},
"angular-dynamic-locale": {
"dependencies": {
"angular": "1.5.8"
}
},
"bootstrap": {
"main": [
"dist/css/bootstrap.css"
]
}
},
"resolutions": {
"angular": "1.5.8",
"angular-bootstrap": "2.0.0",
"jquery": "3.1.0"
}
}
1 change: 1 addition & 0 deletions databasechangelog.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"ID","AUTHOR","FILENAME","DATEEXECUTED","ORDEREXECUTED","EXECTYPE","MD5SUM","DESCRIPTION","COMMENTS","TAG","LIQUIBASE","CONTEXTS","LABELS"
51 changes: 51 additions & 0 deletions gulp/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
'use strict';

var fs = require('fs'),
gulp = require('gulp'),
lazypipe = require('lazypipe'),
footer = require('gulp-footer'),
sourcemaps = require('gulp-sourcemaps'),
rev = require('gulp-rev'),
htmlmin = require('gulp-htmlmin'),
ngAnnotate = require('gulp-ng-annotate'),
prefix = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
uglify = require('gulp-uglify'),
useref = require("gulp-useref"),
revReplace = require("gulp-rev-replace"),
plumber = require('gulp-plumber'),
gulpIf = require('gulp-if'),
handleErrors = require('./handle-errors');

var config = require('./config');

var initTask = lazypipe()
.pipe(sourcemaps.init);
var jsTask = lazypipe()
.pipe(ngAnnotate)
.pipe(uglify);
var cssTask = lazypipe()
.pipe(prefix)
.pipe(cssnano);

module.exports = function() {
var templates = fs.readFileSync(config.tmp + '/templates.js');
var manifest = gulp.src(config.revManifest);

return gulp.src([config.app + '**/*.html',
'!' + config.app + 'app/**/*.html',
'!' + config.app + 'swagger-ui/**/*',
'!' + config.bower + '**/*.html'])
.pipe(plumber({errorHandler: handleErrors}))
//init sourcemaps and prepend semicolon
.pipe(useref({}, initTask))
//append html templates
.pipe(gulpIf('**/app.js', footer(templates)))
.pipe(gulpIf('*.js', jsTask()))
.pipe(gulpIf('*.css', cssTask()))
.pipe(gulpIf('*.html', htmlmin({collapseWhitespace: true})))
.pipe(gulpIf('**/*.!(html)', rev()))
.pipe(revReplace({manifest: manifest}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(config.dist));
};
23 changes: 23 additions & 0 deletions gulp/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

module.exports = {
app: 'src/main/webapp/',
dist: 'target/www/',
swaggerDist: 'target/www/swagger-ui/',
test: 'src/test/javascript/',
bower: 'src/main/webapp/bower_components/',
tmp: 'target/tmp',
revManifest: 'target/tmp/rev-manifest.json',
port: 9000,
apiPort: 8080,
liveReloadPort: 35729,
uri: 'http://localhost:',
constantTemplate:
'(function () {\n' +
' \'use strict\';\n' +
' // DO NOT EDIT THIS FILE, EDIT THE GULP TASK NGCONSTANT SETTINGS INSTEAD WHICH GENERATES THIS FILE\n' +
' angular\n' +
' .module(\'<%- moduleName %>\')\n' +
'<% constants.forEach(function(constant) { %> .constant(\'<%- constant.name %>\', <%= constant.value %>)\n<% }) %>;\n' +
'})();\n'
};
102 changes: 102 additions & 0 deletions gulp/copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
'use strict';

var gulp = require('gulp'),
rev = require('gulp-rev'),
plumber = require('gulp-plumber'),
es = require('event-stream'),
flatten = require('gulp-flatten'),
replace = require('gulp-replace'),
bowerFiles = require('main-bower-files'),
changed = require('gulp-changed');

var handleErrors = require('./handle-errors');
var config = require('./config');

module.exports = {
i18n: i18n,
languages: languages,
fonts: fonts,
common: common,
swagger: swagger,
images: images
}

var yorc = require('../.yo-rc.json')['generator-jhipster'];

function i18n() {
return gulp.src(config.app + 'i18n/**')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.dist + 'i18n/'))
.pipe(gulp.dest(config.dist + 'i18n/'));
}

function languages() {
var locales = yorc.languages.map(function (locale) {
return config.bower + 'angular-i18n/angular-locale_' + locale + '.js';
});
return gulp.src(locales)
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.app + 'i18n/'))
.pipe(gulp.dest(config.app + 'i18n/'));
}

function fonts() {
return es.merge(gulp.src(config.bower + 'bootstrap/fonts/*.*')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.dist + 'content/fonts/'))
.pipe(rev())
.pipe(gulp.dest(config.dist + 'content/fonts/'))
.pipe(rev.manifest(config.revManifest, {
base: config.dist,
merge: true
}))
.pipe(gulp.dest(config.dist)),
gulp.src(config.app + 'content/**/*.{woff,woff2,svg,ttf,eot,otf}')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.dist + 'content/fonts/'))
.pipe(flatten())
.pipe(rev())
.pipe(gulp.dest(config.dist + 'content/fonts/'))
.pipe(rev.manifest(config.revManifest, {
base: config.dist,
merge: true
}))
.pipe(gulp.dest(config.dist))
);
}

function common() {
return gulp.src([config.app + 'robots.txt', config.app + 'favicon.ico', config.app + '.htaccess'], { dot: true })
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.dist))
.pipe(gulp.dest(config.dist));
}

function swagger() {
return es.merge(
gulp.src([config.bower + 'swagger-ui/dist/**',
'!' + config.bower + 'swagger-ui/dist/index.html',
'!' + config.bower + 'swagger-ui/dist/swagger-ui.min.js',
'!' + config.bower + 'swagger-ui/dist/swagger-ui.js'])
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.swaggerDist))
.pipe(gulp.dest(config.swaggerDist)),
gulp.src(config.app + 'swagger-ui/index.html')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.swaggerDist))
.pipe(replace('../bower_components/swagger-ui/dist/', ''))
.pipe(replace('swagger-ui.js', 'lib/swagger-ui.min.js'))
.pipe(gulp.dest(config.swaggerDist)),
gulp.src(config.bower + 'swagger-ui/dist/swagger-ui.min.js')
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.swaggerDist + 'lib/'))
.pipe(gulp.dest(config.swaggerDist + 'lib/'))
);
}

function images() {
return gulp.src(bowerFiles({filter: ['**/*.{gif,jpg,png}']}), { base: config.bower })
.pipe(plumber({errorHandler: handleErrors}))
.pipe(changed(config.dist + 'bower_components'))
.pipe(gulp.dest(config.dist + 'bower_components'));
}
22 changes: 22 additions & 0 deletions gulp/handle-errors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

var notify = require("gulp-notify");
var argv = require('yargs').argv;

module.exports = function() {

var args = Array.prototype.slice.call(arguments);
var notification = argv.notification === undefined ? true : argv.notification;
// Send error to notification center with gulp-notify
if(notification) {
notify.onError({
title: "JHipster Gulp Build",
subtitle: "Failure!",
message: "Error: <%= error.message %>",
sound: "Beep"
}).apply(this, args);
}
// Keep gulp from hanging on this task
this.emit('end');

};
Loading

0 comments on commit 19f0b8d

Please sign in to comment.