forked from PGBI/kong-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use gulp to build kong-dashboard. Reduce docker image size. Npm packa…
…ge to include built app
- Loading branch information
PGBI
committed
May 23, 2017
1 parent
23eeb2f
commit d610325
Showing
13 changed files
with
130 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
.idea/ | ||
.vagrant | ||
*.iml | ||
.dockerignore | ||
Dockerfile | ||
node_modules/ | ||
public/ | ||
screenshots/ | ||
.vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
.idea/ | ||
.vagrant | ||
*.iml | ||
bower_components/ | ||
node_modules/ | ||
public/ | ||
src/scss/_custom_theme.scss | ||
.vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.idea/ | ||
.vagrant | ||
*.iml | ||
node_modules/ | ||
screenshots/ | ||
src/scss/_custom_theme.scss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
npm run start -- $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
'use strict'; | ||
|
||
var child_process = require('child_process'); | ||
var concat = require('gulp-concat'); | ||
var fs = require('fs'); | ||
var gulp = require('gulp'); | ||
var sass = require('gulp-sass'); | ||
var uglify = require('gulp-uglify'); | ||
|
||
// Define file path variables | ||
var paths = { | ||
root: 'src/', | ||
js_src: 'src/js', | ||
sass_src: 'src/scss', | ||
html_src: 'src/html', | ||
css_src: 'src/scss', | ||
dist: 'public' | ||
}; | ||
|
||
gulp.task('build_js', function () { | ||
return gulp | ||
.src([ | ||
"./node_modules/jquery/dist/jquery.min.js", | ||
"./node_modules/angular/angular.min.js", | ||
"./node_modules/angular-route/angular-route.min.js", | ||
"./node_modules/angular-cookies/angular-cookies.min.js", | ||
"./node_modules/angular-animate/angular-animate.min.js", | ||
"./node_modules/angular-sanitize/angular-sanitize.min.js", | ||
"./node_modules/materialize-css/dist/js/materialize.min.js", | ||
"./node_modules/ng-infinite-scroll/build/ng-infinite-scroll.min.js", | ||
paths.js_src + '/**/*.js' | ||
]) | ||
.pipe(uglify()) | ||
.pipe(concat('app.min.js')) | ||
.pipe(gulp.dest(paths.dist + '/js')); | ||
}); | ||
|
||
gulp.task('build_html', function() { | ||
gulp.src([paths.html_src + '/index.html']) | ||
.pipe(gulp.dest(paths.dist)); | ||
gulp.src([paths.html_src + '/**/*']) | ||
.pipe(gulp.dest(paths.dist + '/html')); | ||
gulp.src(['node_modules/materialize-css/dist/fonts/roboto/**/*']) | ||
.pipe(gulp.dest(paths.dist + '/fonts/roboto')); | ||
}); | ||
|
||
gulp.task('build_css', function() { | ||
var src_file = 'app.scss'; | ||
if (fs.existsSync(paths.sass_src + '/custom_app.scss')) { | ||
src_file = 'custom_app.scss'; | ||
} | ||
gulp.src([paths.sass_src + '/' + src_file]) | ||
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) | ||
.pipe(concat('app.min.css')) | ||
.pipe(gulp.dest(paths.dist + '/css')); | ||
}); | ||
|
||
gulp.task('build', ['build_js', 'build_css', 'build_html']); | ||
|
||
gulp.task('watch', function() { | ||
gulp.watch(paths.js_src + '/**/*.js', ['build_js']); | ||
gulp.watch(paths.html_src + '/**/*.html', ['build_html']); | ||
gulp.watch(paths.sass_src + '/**/*.scss', ['build_css']); | ||
}); | ||
|
||
gulp.task('serve', ['build', 'watch'], function() { | ||
var args = process.argv; | ||
args.push('start'); | ||
args = args.slice(3); | ||
child_process.fork(__dirname + '/bin/kong-dashboard', args); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
#!/bin/bash | ||
cd /vagrant | ||
sudo apt-get update | ||
sudo apt-get install -y nodejs npm git | ||
sudo ln -s /usr/bin/nodejs /usr/bin/node | ||
sudo rm -r node_modules | ||
sudo -u vagrant -H sh -c "npm install" | ||
|
||
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - | ||
apt-get update | ||
apt-get install -y nodejs git | ||
|
||
rm -r node_modules | ||
npm install && npm run build && npm prune --production | ||
echo "Successfully Installed Kong Dashboard." |
File renamed without changes.