Skip to content
This repository has been archived by the owner on Sep 27, 2020. It is now read-only.

Commit

Permalink
fixed build (linux), test-e2e + more file moving
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelkilian committed Feb 16, 2016
1 parent 3784612 commit 08dfc31
Show file tree
Hide file tree
Showing 273 changed files with 103 additions and 177 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Thumbs.db
/build/
/releases/
/tmp/
/config/local*
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,12 @@ Sits on path: `eintopf/app/package.json`. This is **real** manifest of the appli
```
npm install
```
It will also download Electron runtime, and install dependencies for second `package.json` file inside `app` folder.
Installs package dependencies.

```
npm run app-install
```
Compiles package dependencies against the nodejs version of electron.


### Starting the app
Expand Down
18 changes: 0 additions & 18 deletions app/app.coffee

This file was deleted.

1 change: 0 additions & 1 deletion app/config/.gitignore

This file was deleted.

50 changes: 0 additions & 50 deletions app/package.json

This file was deleted.

24 changes: 0 additions & 24 deletions app/tasks/postinstall.js

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 12 additions & 16 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,26 @@ var releaseForOs = {
windows: require('./tasks/release_windows')
};

gulp.task('build', function() {
return require('./tasks/build.js')();
});

gulp.task("copy", function() {
var buildDir = jetpack.cwd("./build").dir(".", {empty: true});

return jetpack.copy("./app", buildDir.path(), {
overwrite: true
return jetpack.copyAsync("./src", buildDir.path('src'), {overwrite: true})
.then(function() {
jetpack.copy("./config", buildDir.path('config'), {overwrite: true});
})
.then(function() {
jetpack.copy("./package.json", buildDir.path('package.json'), {overwrite: true});
})
.then(function() {
jetpack.copy("./tasks", buildDir.path('tasks'), {overwrite: true});
});
});

gulp.task("cleanup dependencies", ["copy"], function() {

/**
* remove all packages specified in the 'devDependencies' section
*
* runs postinstall again to fix missing optional dependencies
*/

gulp.task("cleanup dependencies", ["copy"], function(cb) {
var buildDir = jetpack.cwd("./build").dir(".");
var process = exec("npm prune --production && npm run postinstall", {cwd: buildDir.path()});

return process.stdout;
// install all packages against the electron nodejs
exec("npm run app-install --production", {cwd: buildDir.path()}, cb);
});

gulp.task('release', ['cleanup dependencies'], function () {
Expand Down
40 changes: 35 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,40 @@
{
"name": "eintopf",
"private": true,
"productName": "Eintopf",
"identifier": "com.mazehall.eintopf",
"description": "The smartest way to share and administrate docker projects.",
"version": "1.2.1",
"author": "Jens Klose <jens.klose@mazehall.com>",
"maintainers": [
"jens klose <jens.klose@mazehall.com>",
"marcel kilian <marcel.kilian@mazehall.com>",
"ronny eisenkolb <ronny.eisenkolb@mazehall.com>",
"katja patzelt <katja.patzelt@mazehall.com>"
],
"main": "src/main.js",
"config": {
"target": "development"
},
"dependencies": {
"asar": "^0.8.0",
"coffee-script": "1.9.3",
"config": "^1.15.0",
"docker-events": "0.0.2",
"dockerode": "^2.2.2",
"fs-jetpack": "^0.7.0",
"gift": "^0.6.1",
"kefir": "2.7.0",
"kefir-storage": "^1.1.2",
"node-vagrant": "^1.0.6",
"strip-ansi": "^3.0.0"
},
"devDependencies": {
"asar": "^0.7.2",
"electron-prebuilt": "^0.36.7",
"fs-jetpack": "^0.7.0",
"jasmine-node": "^1.14.5",
"rewire": "^2.3.4",
"gulp": "^3.9.0",
"gulp-clean": "^0.3.1",
"gulp-concat": "^2.5.2",
"gulp-less": "^3.0.3",
"gulp-minify-css": "^1.1.1",
Expand All @@ -19,12 +50,11 @@
"rcedit": "^0.3.0"
},
"scripts": {
"postinstall": "node ./tasks/app_npm_install",
"app-install": "node ./tasks/app_npm_install",
"build": "./node_modules/.bin/gulp build",
"postinstall": "node ./tasks/postinstall",
"release": "./node_modules/.bin/gulp release --env=production",
"start": "node ./tasks/start-dev",
"test": "cd app && npm test",
"test": "node_modules/.bin/jasmine-node --coffee tests/spec",
"test-e2e": "node tests/e2e.js"
}
}
15 changes: 15 additions & 0 deletions src/app.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
eventHandler = require './handler/events.coffee'
setupModel = require './models/setup/setup.coffee'
projectsModel = require './models/projects/list.coffee'
registryModel = require './models/stores/registry.coffee'

model = (webContents) ->

setupModel.run()
projectsModel.loadProjects()
registryModel.loadRegistryWithInterval()

# init events
eventHandler(webContents)

module.exports = model;
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ handleEvents = (webContents) ->
projectsModel.updateProject x.value, () ->

ipcToKefir 'project:action:script'
.filter (x) -> x if x.value?.id?
.filter (x) -> x if x.value?.id? && x.value.action?
.onValue (x) ->
projectsModel.callAction x.value, x.value.action

Expand Down
8 changes: 6 additions & 2 deletions app/main.js → src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ require('coffee-script/register');
var app = require('app');
var shell = require('shell');
var BrowserWindow = require('browser-window');
var windowStateKeeper = require('./vendor/electron_boilerplate/window_state');
var windowStateKeeper = require('./utils/window_state');
var Menu = require('menu');

// set path env
process.env.ELECTRON_APP_DIR = app.getAppPath();
process.env.NODE_CONFIG_DIR = process.env.ELECTRON_APP_DIR + '/config';

var application = require('./app.coffee');
var mainWindow, webContents, instance;
// Preserver of the window size and position between app launches.
Expand Down Expand Up @@ -113,7 +117,7 @@ app.on('ready', function () {
console.log('uncaught Exception:', e);
});

mainWindow.loadURL('file://' + __dirname + '/src/public/index.html');
mainWindow.loadURL('file://' + __dirname + '/public/index.html');

// start Eintopf
application(webContents);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ model.copyVagrantFile = (callback) ->
pathDefaultVagrantFile = appConfig.pathDefaultVagrantFile
return cb new Error 'copy failed due to misconfiguration' if ! configModulePath? || ! pathDefaultVagrantFile?

src = jetpack.cwd(appConfig.pathDefaultVagrantFile).path()
src = jetpack.cwd(process.env.ELECTRON_APP_DIR).path(appConfig.pathDefaultVagrantFile)

jetpack.dirAsync configModulePath
.then (dir) ->
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ angular.module('eintopf')
}
])
.controller('recipeCtrl',
['$scope', '$stateParams', '$state', 'storage', 'reqProjectDetail', 'resProjectDetail', 'reqProjectStart', 'resProjectStart', 'reqProjectStop', 'resProjectStop', 'reqProjectDelete', 'resProjectDelete', 'reqProjectUpdate', 'resProjectUpdate', 'currentProject', 'resProjectStartAction', 'reqProjectStartAction', 'reqContainerActions', 'reqContainersList', 'resContainersLog',
function ($scope, $stateParams, $state, storage, reqProjectDetail, resProjectDetail, reqProjectStart, resProjectStart, reqProjectStop, resProjectStop, reqProjectDelete, resProjectDelete, reqProjectUpdate, resProjectUpdate, currentProject, resProjectStartAction, reqProjectStartAction, reqContainerActions, reqContainersList, resContainersLog) {
['$scope', '$stateParams', '$state', 'storage', 'reqProjectDetail', 'resProjectDetail', 'reqProjectStart', 'resProjectStart', 'reqProjectStop', 'resProjectStop', 'reqProjectDelete', 'resProjectDelete', 'reqProjectUpdate', 'resProjectUpdate', 'currentProject', 'resProjectAction', 'reqProjectAction', 'reqContainerActions', 'reqContainersList', 'resContainersLog',
function ($scope, $stateParams, $state, storage, reqProjectDetail, resProjectDetail, reqProjectStart, resProjectStart, reqProjectStop, resProjectStop, reqProjectDelete, resProjectDelete, reqProjectUpdate, resProjectUpdate, currentProject, resProjectAction, reqProjectAction, reqContainerActions, reqContainersList, resContainersLog) {
$scope.project = {
id: $stateParams.id
};
Expand Down Expand Up @@ -196,8 +196,8 @@ angular.module('eintopf')

$scope.doAction = function(project, action){
project.action = action;
reqProjectStartAction.emit(project);
resProjectStartAction.fromProject($stateParams.id);
reqProjectAction.emit(project);
resProjectAction.fromProject($stateParams.id);
$scope.currentTab = "protocol"
};

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ angular.module('eintopf.services.ipc', [])
}
}])

.service('reqProjectStartAction', ['ipc', function (ipc){
.service('reqProjectAction', ['ipc', function (ipc){
return {
emit: function (data){
ipc.emit('project:action:script', data);
Expand Down Expand Up @@ -258,7 +258,7 @@ angular.module('eintopf.services.ipc', [])
}
}])

.factory('resProjectStartAction', ['ipc', 'storage', function (ipc, storage) {
.factory('resProjectAction', ['ipc', 'storage', function (ipc, storage) {
var streams = {};
return {
fromProject: function (project){
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tasks/app_npm_install.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var utils = require('./utils');

var electronVersion = utils.getElectronVersion();

var nodeModulesDir = jetpack.cwd(__dirname + '/../app/node_modules');
var nodeModulesDir = jetpack.cwd(__dirname + '/../node_modules');
var dependenciesCompiledAgainst = nodeModulesDir.read('electron_version');

// When you raised version of Electron used in your project, the safest
Expand Down Expand Up @@ -46,7 +46,7 @@ if (process.platform === 'win32') {
}

var install = childProcess.spawn(installCommand, params, {
cwd: __dirname + '/../app',
cwd: __dirname + '/..',
env: process.env,
stdio: 'inherit'
});
32 changes: 0 additions & 32 deletions tasks/build.js

This file was deleted.

2 changes: 1 addition & 1 deletion tasks/release_linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var init = function () {
projectDir = jetpack;
tmpDir = projectDir.dir('./tmp', { empty: true });
releasesDir = projectDir.dir('./releases');
manifest = projectDir.read('app/package.json', 'json');
manifest = projectDir.read('package.json', 'json');
packName = manifest.name + '_' + manifest.version;
packDir = tmpDir.dir(packName);
readyAppDir = packDir.cwd('opt', manifest.name);
Expand Down
2 changes: 1 addition & 1 deletion tasks/release_osx.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var init = function () {
projectDir = jetpack;
tmpDir = projectDir.dir('./tmp', {empty: true});
releasesDir = projectDir.dir('./releases');
manifest = projectDir.read('app/package.json', 'json');
manifest = projectDir.read('package.json', 'json');
finalAppDir = tmpDir.cwd(manifest.productName + '.app');

return Q();
Expand Down
2 changes: 1 addition & 1 deletion tasks/release_windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var init = function () {
projectDir = jetpack;
tmpDir = projectDir.dir('./tmp', { empty: true });
releasesDir = projectDir.dir('./releases');
manifest = projectDir.read('app/package.json', 'json');
manifest = projectDir.read('package.json', 'json');
readyAppDir = tmpDir.cwd(manifest.name);

return Q();
Expand Down
Loading

0 comments on commit 08dfc31

Please sign in to comment.