Compare commits

..

11 Commits

Author SHA1 Message Date
346bb99326 Ajout d'une dépendance explicite vers libgconf
Voir https://github.com/electron/electron/issues/1518
2017-09-05 09:54:17 +02:00
8bf5a9c4b9 Intégration Drone
- Construction des paquets via le serveur d'intégration continue
- Envoi d'un courriel à la fin de la construction
- Transfert des paquets via SFTP sur le serveur dépôt

Plugins Drone utilisés: https://forge.cadoles.com/wpetit/cadoles-drone-plugins
Playbook Ansible pour le serveur dépôt: https://forge.cadoles.com/wpetit/cadoles-playbooks
2017-07-31 11:33:58 +02:00
97247483f9 Mise à jour du processus de construction des paquets via Drone 2017-07-24 18:38:32 +02:00
56732e585d Ajout construction des paquets dans le CI 2017-07-24 17:22:34 +02:00
c03aefc66a Use alpine image for CI tests 2017-07-24 15:25:58 +02:00
68461367c8 Ajout manifeste Drone CI 2017-07-24 15:12:00 +02:00
ef57e28dab Démarrage des applications en mode daemon
Les applications sont désormais lancées en mode "détachées".
Une limite "dure" de 2 secondes est appliquées pour l'animation de lancement sur les tuiles.

Fixes #5
2017-07-24 14:58:05 +02:00
53431deba9 passage à la version 1 de Pitaya avec react 15 2017-04-27 17:12:58 +02:00
e606a06a5d Electron 1.6.7 2017-04-21 15:01:59 +02:00
9bf744d46f Merge branch 'upgrade-electron' of https://forge.cadoles.com/Cadoles/pitaya-launcher into upgrade-electron 2017-04-21 14:46:45 +02:00
32c474969d Montée de version React 2017-04-21 14:12:59 +02:00
12 changed files with 151 additions and 25 deletions

51
.drone.yml Normal file
View File

@ -0,0 +1,51 @@
---
pipeline:
test:
image: node:6-alpine
commands:
- apk add --no-cache firefox-esr
- npm install
- npm test
package-64:
pull: true
group: package
image: bornholm/drone-tamarin:latest
dest_dir: packages
volumes:
- /var/run/docker.sock:/var/run/docker.sock
package-32:
pull: true
group: package
image: bornholm/drone-tamarin:latest
arch: i386
dest_dir: packages
volumes:
- /var/run/docker.sock:/var/run/docker.sock
deploy:
pull: true
image: bornholm/drone-sftp:latest
# Génération des commandes d'upload SFTP via script Bash
sftp_commands_script: |
ls packages/*.deb | xargs -I '{}' echo "put '{}' packages-available/"
secrets:
- source: packages_sftp_host
target: plugin_host
- source: packages_sftp_user
target: plugin_username
- source: packages_sftp_password
target: plugin_password
notify:
image: drillster/drone-email
from: drone@cadoles.com
skip_verify: true
secrets:
- source: cadoles_email_port
target: plugin_port
- source: cadoles_email_host
target: plugin_host
- source: cadoles_email_user
target: plugin_username
- source: cadoles_email_password
target: plugin_password
when:
status: [ success, failure ]

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ build
nwjs
my-profile.json
js-compiled
/packages

10
.tamarin/prebuild Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -o pipefail
set -e
# Install NodeJS into the container
apt-get update
apt-get install --yes --no-install-recommends curl ca-certificates
curl --silent --location https://deb.nodesource.com/setup_6.x | bash -
apt-get install --yes nodejs

View File

@ -1,3 +1,3 @@
project_version=0.0.2
project_version=1.0.0
project_name=pitaya
no_version_suffix=no

View File

@ -8,11 +8,11 @@ endif
all: build
clean:
rm -rf node_modules
rm -rf dist
build:
apt-get update
apt-get install --yes --no-install-recommends curl ca-certificates
curl --silent --location https://deb.nodesource.com/setup_6.x | bash -
apt-get install --yes nodejs
npm install --ignore-scripts
ARCH=$(ELECTRON_ARCH) npm run build

View File

@ -1,6 +1,6 @@
<style>h1 > img { vertical-align: bottom; }</style>
# ![Logo Pitaya](img/icons/pitaya-logo.png) Pitaya
# ![Logo Pitaya](img/icons/pitaya-logo.png) Pitaya [![Build Status](https://drone.cadol.es/api/badges/Cadoles/pitaya-launcher/status.svg?branch=develop)](https://drone.cadol.es/Cadoles/pitaya-launcher)
Lanceur d'application pour GNU/Linux

1
debian/control vendored
View File

@ -10,4 +10,5 @@ Vcs-Browser: https://forge.cadoles.com/wpetit/pitaya
Package: pitaya
Architecture: any
Depends: libgconf-2-4
Description: Lanceur d'application pour GNU/Linux

View File

@ -4,7 +4,7 @@
"private": "true",
"main": "main.js",
"devDependencies": {
"electron": "^1.6.5",
"electron": "^1.6.7",
"electron-packager": "^8.6.0",
"node-jsx": "^0.13.3",
"nodeunit": "^0.9.1",
@ -15,7 +15,7 @@
"start": "./node_modules/.bin/electron .",
"compile": "./node_modules/.bin/jsx -x js --no-cache-dir src dist",
"clean": "rm -rf dist/* build/*",
"package": "./node_modules/.bin/electron-packager ./ pitaya --out=./build --app-version 0.0.0 --version=1.6.5 --prune --ignore='/res(/|$)' --ignore='/debian(/|$)' --ignore='/scripts(/|$)' --ignore='/build(/|$)' --ignore='/test(/|$)' --ignore='/electron-packager(/|$)' --ignore='/electron-tmp-.+(/|$)' --platform=linux --overwrite",
"package": "./node_modules/.bin/electron-packager ./ pitaya --out=./build --app-version 0.0.0 --electron-version=1.6.7 --prune --ignore='/res(/|$)' --ignore='/debian(/|$)' --ignore='/scripts(/|$)' --ignore='/build(/|$)' --ignore='/test(/|$)' --ignore='/electron-packager(/|$)' --ignore='/electron-tmp-.+(/|$)' --platform=linux --overwrite",
"build": "npm run clean && npm run compile && npm run package -- --arch=$ARCH"
},
"dependencies": {
@ -25,11 +25,12 @@
"glob": "^5.0.14",
"ini": "^1.3.4",
"lodash": "^3.10.1",
"react": "^0.14.0",
"react-addons-css-transition-group": "^0.14.0",
"react-addons-update": "^0.14.2",
"react-dnd": "^1.1.5",
"react-dom": "^0.14.0",
"react": "^15.5.0",
"react-addons-css-transition-group": "^15.5.2",
"react-addons-update": "^15.5.2",
"react-dnd": "^2.3.0",
"react-dnd-html5-backend": "^2.3.0",
"react-dom": "^15.5.4",
"react-redux": "^2.0.0",
"recursive-iterator": "^2.0.0",
"redux": "^2.0.0",

View File

@ -8,7 +8,7 @@ var ProfileMenu = require('./profile-menu.js');
var actions = require('../../store/actions');
var DragDropContext = require('react-dnd').DragDropContext;
var HTML5Backend = require('react-dnd/modules/backends/HTML5');
var HTML5Backend = require('react-dnd-html5-backend');
var EditView = React.createClass({

View File

@ -104,10 +104,16 @@ var LauncherView = React.createClass({
var el = evt.currentTarget;
el.classList.add('pulse');
let startAnim = Date.now();
let endAnim = startAnim + 2000;
this.props.dispatch(actions.launcher.runApp(item.exec))
.then(function() {
el.classList.remove('pulse');
let now = Date.now();
if(endAnim > now) {
setTimeout(() => el.classList.remove('pulse'), endAnim - now)
} else {
el.classList.remove('pulse')
}
})
.catch(function() {
el.classList.remove('pulse');

View File

@ -1,6 +1,7 @@
var Util = require('../../util');
var logger = Util.Logger;
var remote = require('electron').Remote;
var LoggerStream = Util.LoggerStream;
var remote = require('electron').remote;
var RUN_APP = exports.RUN_APP = 'RUN_APP';
var RUN_APP_SUCCESS = exports.RUN_APP_SUCCESS = 'RUN_APP_SUCCESS';
@ -14,7 +15,13 @@ exports.runApp = function(execPath) {
dispatch({ type: RUN_APP, execPath: execPath });
return Util.System.runApp(execPath, { clearFreeDesktopFlags: true })
var opts = {
clearFreeDesktopFlags: true,
stdout: process.stdout,
stderr: process.stderr
}
return Util.System.runApp(execPath, opts)
.then(function() {
dispatch({ type: RUN_APP_SUCCESS, execPath: execPath });
// Hypothetical fix

View File

@ -98,15 +98,64 @@ exports.runApp = function(execPath, opts) {
opts = opts || {};
if(opts.clearFreeDesktopFlags) {
execPath = exports.clearFreeDesktopFlags(execPath);
}
return new Promise(function(resolve, reject) {
cp.exec(execPath, function(err) {
if(err) return reject(err);
return resolve();
try {
if(opts.clearFreeDesktopFlags) {
execPath = exports.clearFreeDesktopFlags(execPath);
}
var isDev = process.env.NODE_ENV === 'development';
var child = cp.spawn(execPath, {
detached: true,
shell: true,
stdio: [
'ignore',
isDev ? process.stdout : 'ignore',
isDev ? process.stderr : 'ignore'
]
});
// Detach the child process
child.unref();
} catch(err) {
return reject(err);
}
// Execute the rest after all I/O operations in this tick
let immediateId = setImmediate(() => {
// We do not want to be notified of child events after launch
child.removeAllListeners();
try {
// Check if the child process is still alive, should throw otherwise
child.kill(0);
} catch(err) {
return reject(err);
}
return resolve(child);
});
// If the child process exit with an exit code != 0, reject the promise
child.once('close', code => {
if(code === 0) return;
clearImmediate(immediateId);
child.removeAllListeners();
return reject(`Program exited with a exit code "${code}"`);
});
// If an error occurs during the process launch, reject the promise
child.once('error', err => {
clearImmediate(immediateId);
child.removeAllListeners();
return reject(err);
});
});
};