Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Booking #2

Merged
merged 12 commits into from
Oct 8, 2016
2 changes: 2 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"presets": [
"es2015-node",
"es2016",
"es2017",
"react",
"stage-0"
],
Expand Down
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ insert_final_newline = true
tab_width = 2
trim_trailing_whitespace = true

[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
loglevel = "http"
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Workaround for bug in npm@3
# @see https://github.com/npm/npm/issues/9727
shrinkwrap:
@rm -rf .tmp
@mkdir .tmp
@cp package.json .tmp/package.json
@npm cache clean
@cd .tmp && npm install --production && npm shrinkwrap
@rm npm-shrinkwrap.json
@cp .tmp/npm-shrinkwrap.json npm-shrinkwrap.json
@rm -rf .tmp
@npm install
@npm prune
.PHONY: shrinkwrap
9 changes: 3 additions & 6 deletions build/clean.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import path from 'path';

import del from 'del';
import gulp from 'gulp';
import del from 'del';


gulp.task('clean', (done) => {
del.sync(path.resolve(__dirname, '..', 'dist', '*'));
done();
gulp.task('clean', () => {
return del(['dist/**/*', '.tmp']);
});
31 changes: 31 additions & 0 deletions build/deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import path from 'path';

import gulp from 'gulp';
import runSequence from 'run-sequence';
import zip from 'gulp-zip';
import Application from 'azur';


gulp.task('compile', (done) => {
runSequence('clean', 'webpack-prod', done);
});

gulp.task('package', ['compile'], () => {
return gulp.src(['dist/**/*', 'server.js', 'iisnode.yml', 'package.json', 'npm-shrinkwrap.json', 'README.md'], { base: '.' })
.pipe(zip('app.zip'))
.pipe(gulp.dest('.tmp'));
});

gulp.task('deploy', ['package'], () => {
const app = new Application({
appName: process.env.AZURE_APP_NAME,
username: process.env.AZURE_GIT_USERNAME,
password: process.env.AZURE_GIT_PASSWORD,
gitName: 'Automated Deployments',
gitEmail: '[email protected]',
});

return app.deploy({
archiveFilePath: path.resolve(__dirname, '..', '.tmp/app.zip'),
});
});
9 changes: 5 additions & 4 deletions build/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import runSequence from 'run-sequence';
import './clean';
import './serve';
import './webpack';
import './deploy';


gulp.task('dev', () => {
runSequence('clean', 'webpack-client-dev', 'webpack-server-dev', 'serve');
gulp.task('dev', (done) => {
runSequence('clean', 'webpack-client-dev', 'webpack-server-dev', 'serve', done);
});

gulp.task('prod', () => {
runSequence('clean', 'webpack-prod', 'serve');
gulp.task('prod', (done) => {
runSequence('clean', 'webpack-prod', 'serve', done);
});

gulp.task('default', () => {
Expand Down
2 changes: 2 additions & 0 deletions build/webpack/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ export default function webpackFactory({ production = false, client = false, wri
production && ['es2015', { modules: false }],
!production && 'modern/webpack2',
!production && 'modern/safari9',
'es2016',
'es2017',
'stage-0',
'react',
].filter(identity),
Expand Down
12 changes: 12 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
machine:
node:
version: 6.5.0
dependencies:
pre:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install -y libstdc++-4.9-dev
override:
- npm install --no-progress --quiet
test:
pre:
- npm run lint
override:
- npm test
deployment:
production:
branch: master
commands:
- npm run deploy
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
port: 8000,
port: process.env.PORT || 8000,
helps: {
baseUrl: 'http://uts-helps.azurewebsites.net/api',
headers: {
Expand Down
18 changes: 18 additions & 0 deletions iisnode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# For documentation see https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/iisnode.yml

loggingEnabled: false
debuggingEnabled: false
# devErrorsEnabled: false
node_env: production
nodeProcessCountPerApplication: 1
maxConcurrentRequestsPerProcess: 1024
maxNamedPipeConnectionRetry: 24
namedPipeConnectionRetryDelay: 250
maxNamedPipeConnectionPoolSize: 512
maxNamedPipePooledConnectionAge: 30000
asyncCompletionThreadCount: 0
initialRequestBufferSize: 4096
maxRequestBufferSize: 65536
watchedFiles: *.js;iisnode.yml;node_modules\*;dist\*
uncFileChangesPollingInterval: 5000
gracefulShutdownTimeout: 60000
Loading