mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
Added initial files for build and test automation.
This commit is contained in:
parent
403daff934
commit
58bd6faa47
8 changed files with 198 additions and 21 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
node_modules
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -2,3 +2,5 @@ logs/*
|
||||||
!.gitkeep
|
!.gitkeep
|
||||||
dockerui
|
dockerui
|
||||||
*.esproj/*
|
*.esproj/*
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
FROM crosbymichael/golang
|
FROM crosbymichael/golang
|
||||||
|
|
||||||
ADD . /app/
|
COPY dockerui.go /app/
|
||||||
|
COPY dist/ /app/
|
||||||
WORKDIR /app/
|
WORKDIR /app/
|
||||||
RUN go build dockerui.go
|
RUN go build dockerui.go
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
|
|
1
Makefile
1
Makefile
|
@ -6,6 +6,7 @@ OPEN = $(shell which xdg-open || which open)
|
||||||
PORT ?= 9000
|
PORT ?= 9000
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
grunt build
|
||||||
docker build --rm -t dockerui .
|
docker build --rm -t dockerui .
|
||||||
|
|
||||||
run:
|
run:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('dockerui', ['ngRoute', 'dockerui.services', 'dockerui.filters', 'masthead', 'footer', 'dashboard', 'container', 'containers', 'images', 'image', 'startContainer', 'sidebar', 'settings', 'builder'])
|
angular.module('<%= pkg.name %>', ['<%= pkg.name %>.templates', 'ngRoute', '<%= pkg.name %>.services', '<%= pkg.name %>.filters', 'masthead', 'footer', 'dashboard', 'container', 'containers', 'images', 'image', 'startContainer', 'sidebar', 'settings', 'builder'])
|
||||||
.config(['$routeProvider', function ($routeProvider) {
|
.config(['$routeProvider', function ($routeProvider) {
|
||||||
$routeProvider.when('/', {templateUrl: 'app/components/dashboard/dashboard.html', controller: 'DashboardController'});
|
$routeProvider.when('/', {templateUrl: 'app/components/dashboard/dashboard.html', controller: 'DashboardController'});
|
||||||
$routeProvider.when('/containers/', {templateUrl: 'app/components/containers/containers.html', controller: 'ContainersController'});
|
$routeProvider.when('/containers/', {templateUrl: 'app/components/containers/containers.html', controller: 'ContainersController'});
|
||||||
|
@ -14,5 +14,5 @@ angular.module('dockerui', ['ngRoute', 'dockerui.services', 'dockerui.filters',
|
||||||
// You need to set this to the api endpoint without the port i.e. http://192.168.1.9
|
// You need to set this to the api endpoint without the port i.e. http://192.168.1.9
|
||||||
.constant('DOCKER_ENDPOINT', '/dockerapi')
|
.constant('DOCKER_ENDPOINT', '/dockerapi')
|
||||||
.constant('DOCKER_PORT', '') // Docker port, leave as an empty string if no port is requred. If you have a port, prefix it with a ':' i.e. :4243
|
.constant('DOCKER_PORT', '') // Docker port, leave as an empty string if no port is requred. If you have a port, prefix it with a ':' i.e. :4243
|
||||||
.constant('UI_VERSION', 'v0.5')
|
.constant('UI_VERSION', 'v<%= pkg.version %>')
|
||||||
.constant('DOCKER_API_VERSION', 'v1.15');
|
.constant('DOCKER_API_VERSION', 'v1.15');
|
||||||
|
|
151
gruntFile.js
Normal file
151
gruntFile.js
Normal file
|
@ -0,0 +1,151 @@
|
||||||
|
module.exports = function (grunt) {
|
||||||
|
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||||
|
grunt.loadNpmTasks('grunt-recess');
|
||||||
|
grunt.loadNpmTasks('grunt-karma');
|
||||||
|
grunt.loadNpmTasks('grunt-html2js');
|
||||||
|
|
||||||
|
// Default task.
|
||||||
|
grunt.registerTask('default', ['jshint','build','karma:unit']);
|
||||||
|
grunt.registerTask('build', ['clean','html2js','concat','recess:build', 'copy']);
|
||||||
|
grunt.registerTask('release', ['clean','html2js','uglify','jshint','karma:unit','concat:index', 'recess:min', 'copy']);
|
||||||
|
grunt.registerTask('test-watch', ['karma:watch']);
|
||||||
|
|
||||||
|
// Print a timestamp (useful for when watching)
|
||||||
|
grunt.registerTask('timestamp', function() {
|
||||||
|
grunt.log.subhead(Date());
|
||||||
|
});
|
||||||
|
|
||||||
|
var karmaConfig = function(configFile, customOptions) {
|
||||||
|
var options = { configFile: configFile, keepalive: true };
|
||||||
|
var travisOptions = process.env.TRAVIS && { browsers: ['Firefox'], reporters: 'dots' };
|
||||||
|
return grunt.util._.extend(options, customOptions, travisOptions);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Project configuration.
|
||||||
|
grunt.initConfig({
|
||||||
|
distdir: 'dist',
|
||||||
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
|
banner:
|
||||||
|
'/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
|
||||||
|
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
|
||||||
|
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;\n' +
|
||||||
|
' * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n */\n',
|
||||||
|
src: {
|
||||||
|
js: ['app/**/*.js'],
|
||||||
|
jsTpl: ['<%= distdir %>/templates/**/*.js'],
|
||||||
|
specs: ['test/**/*.spec.js'],
|
||||||
|
scenarios: ['test/**/*.scenario.js'],
|
||||||
|
html: ['index.html'],
|
||||||
|
tpl: {
|
||||||
|
app: ['app/components/**/*.html']
|
||||||
|
},
|
||||||
|
css: ['assets/css/app.css']
|
||||||
|
},
|
||||||
|
clean: ['<%= distdir %>/*'],
|
||||||
|
copy: {
|
||||||
|
assets: {
|
||||||
|
files: [{ dest: '<%= distdir %>/assets', src : '**', expand: true, cwd: 'assets/' }]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
karma: {
|
||||||
|
unit: { options: karmaConfig('test/config/unit.js') },
|
||||||
|
watch: { options: karmaConfig('test/config/unit.js', { singleRun:false, autoWatch: true}) }
|
||||||
|
},
|
||||||
|
html2js: {
|
||||||
|
app: {
|
||||||
|
options: {
|
||||||
|
base: '.'
|
||||||
|
},
|
||||||
|
src: ['<%= src.tpl.app %>'],
|
||||||
|
dest: '<%= distdir %>/templates/app.js',
|
||||||
|
module: '<%= pkg.name %>.templates'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
concat:{
|
||||||
|
dist:{
|
||||||
|
options: {
|
||||||
|
banner: "<%= banner %>",
|
||||||
|
process: true
|
||||||
|
},
|
||||||
|
src:['<%= src.js %>', '<%= src.jsTpl %>'],
|
||||||
|
dest:'<%= distdir %>/<%= pkg.name %>.js'
|
||||||
|
},
|
||||||
|
index: {
|
||||||
|
src: ['index.html'],
|
||||||
|
dest: '<%= distdir %>/index.html',
|
||||||
|
options: {
|
||||||
|
process: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
angular: {
|
||||||
|
src:['assets/js/angularjs/1.2.6/angular.min.js',
|
||||||
|
'assets/js/angularjs/1.2.6/angular-route.min.js',
|
||||||
|
'assets/js/angularjs/1.2.6/angular-resource.min.js'],
|
||||||
|
dest: '<%= distdir %>/angular.js'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
uglify: {
|
||||||
|
dist:{
|
||||||
|
options: {
|
||||||
|
banner: "<%= banner %>"
|
||||||
|
},
|
||||||
|
src:['<%= src.js %>' ,'<%= src.jsTpl %>'],
|
||||||
|
dest:'<%= distdir %>/<%= pkg.name %>.js'
|
||||||
|
},
|
||||||
|
angular: {
|
||||||
|
src:['<%= concat.angular.src %>'],
|
||||||
|
dest: '<%= distdir %>/angular.js'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
recess: {
|
||||||
|
build: {
|
||||||
|
files: {
|
||||||
|
'<%= distdir %>/<%= pkg.name %>.css':
|
||||||
|
['<%= src.css %>'] },
|
||||||
|
options: {
|
||||||
|
compile: true,
|
||||||
|
noOverqualifying: false // TODO: Added because of .nav class, rename
|
||||||
|
}
|
||||||
|
},
|
||||||
|
min: {
|
||||||
|
files: {
|
||||||
|
'<%= distdir %>/<%= pkg.name %>.css': ['<%= src.css %>']
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
compress: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
all: {
|
||||||
|
files:['<%= src.js %>', '<%= src.specs %>', '<%= src.css %>', '<%= src.tpl.app %>', '<%= src.tpl.common %>', '<%= src.html %>'],
|
||||||
|
tasks:['default','timestamp']
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
files:['<%= src.js %>', '<%= src.specs %>', '<%= src.css %>', '<%= src.tpl.app %>', '<%= src.tpl.common %>', '<%= src.html %>'],
|
||||||
|
tasks:['build','timestamp']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
jshint:{
|
||||||
|
files:['gruntFile.js', '<%= src.js %>', '<%= src.jsTpl %>', '<%= src.specs %>', '<%= src.scenarios %>'],
|
||||||
|
options:{
|
||||||
|
curly:true,
|
||||||
|
eqeqeq:true,
|
||||||
|
immed:true,
|
||||||
|
latedef:true,
|
||||||
|
newcap:true,
|
||||||
|
noarg:true,
|
||||||
|
sub:true,
|
||||||
|
boss:true,
|
||||||
|
eqnull:true,
|
||||||
|
globals:{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
22
index.html
22
index.html
|
@ -5,12 +5,13 @@
|
||||||
<title>DockerUI</title>
|
<title>DockerUI</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
<meta name="author" content="Michael Crosby crosbymichael.com">
|
<meta name="author" content="<%= pkg.author %>">
|
||||||
|
|
||||||
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
|
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="assets/css/jquery.gritter.css" rel="stylesheet">
|
<link href="assets/css/jquery.gritter.css" rel="stylesheet">
|
||||||
|
|
||||||
<link href="assets/css/app.css" rel="stylesheet">
|
<link href="<%= pkg.name %>.css" rel="stylesheet">
|
||||||
|
|
||||||
|
|
||||||
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
|
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
|
@ -31,22 +32,7 @@
|
||||||
<script src="assets/js/Chart.min.js"></script>
|
<script src="assets/js/Chart.min.js"></script>
|
||||||
<script src="assets/js/legend.js"></script>
|
<script src="assets/js/legend.js"></script>
|
||||||
|
|
||||||
<script src="app/app.js"></script>
|
<script src="<%= pkg.name %>.js"></script>
|
||||||
<script src="app/shared/services.js"></script>
|
|
||||||
<script src="app/shared/filters.js"></script>
|
|
||||||
<script src="app/shared/viewmodel.js"></script>
|
|
||||||
<!-- TODO: Add minification build step -->
|
|
||||||
<script src="app/components/masthead/mastheadController.js"></script>
|
|
||||||
<script src="app/components/footer/footerController.js"></script>
|
|
||||||
<script src="app/components/dashboard/dashboardController.js"></script>
|
|
||||||
<script src="app/components/container/containerController.js"></script>
|
|
||||||
<script src="app/components/containers/containersController.js"></script>
|
|
||||||
<script src="app/components/startContainer/startContainerController.js"></script>
|
|
||||||
<script src="app/components/image/imageController.js"></script>
|
|
||||||
<script src="app/components/images/imagesController.js"></script>
|
|
||||||
<script src="app/components/sidebar/sidebarController.js"></script>
|
|
||||||
<script src="app/components/settings/settingsController.js"></script>
|
|
||||||
<script src="app/components/builder/builderController.js"></script>
|
|
||||||
|
|
||||||
<!-- Fav and touch icons -->
|
<!-- Fav and touch icons -->
|
||||||
<link rel="shortcut icon" href="assets/ico/favicon.ico">
|
<link rel="shortcut icon" href="assets/ico/favicon.ico">
|
||||||
|
|
35
package.json
Normal file
35
package.json
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"author": "Michael Crosby",
|
||||||
|
"name": "dockerui",
|
||||||
|
"homepage": "https://github.com/crosbymichael/dockerui",
|
||||||
|
"version": "0.6.0-SNAPSHOT",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git@github.com:crosbymichael/dockerui.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/crosbymichael/dockerui/issues"
|
||||||
|
},
|
||||||
|
"licenses": [
|
||||||
|
{
|
||||||
|
"type": "MIT",
|
||||||
|
"url": "https://raw.githubusercontent.com/crosbymichael/dockerui/master/LICENSE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8.4"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"grunt": "~0.4.0",
|
||||||
|
"grunt-recess": "~0.3",
|
||||||
|
"grunt-contrib-clean": "~0.4.0",
|
||||||
|
"grunt-contrib-copy": "~0.4.0",
|
||||||
|
"grunt-contrib-jshint": "~0.2.0",
|
||||||
|
"grunt-contrib-concat": "~0.1.3",
|
||||||
|
"grunt-contrib-uglify": "~0.1.1",
|
||||||
|
"grunt-karma": "~0.4.4",
|
||||||
|
"grunt-html2js": "~0.1.0",
|
||||||
|
"grunt-contrib-watch": "~0.3.1"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue