-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
107 changed files
with
16,683 additions
and
1,429 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
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,33 +1,52 @@ | ||
sudo: true | ||
language: node_js | ||
|
||
dist: trusty | ||
|
||
node_js: | ||
- "8.9.1" | ||
|
||
sudo: true | ||
|
||
git: | ||
depth: 1 | ||
|
||
before_install: | ||
- sudo apt-get -qq update | ||
- sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev gcc-4.8 g++-4.8 build-essential -y | ||
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.2.1 | ||
- export PATH="$HOME/.yarn/bin:$PATH" CXX=g++-4.8 | ||
|
||
branches: | ||
only: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
include: | ||
- stage: build docker image | ||
before_script: | ||
- yarn testrpc > /dev/null & | ||
- yarn contracts | ||
script: | ||
- npm config set NPM_CONFIG_LOGLEVEL error | ||
- npm install --silent | ||
- npm run testrpc > /dev/null & | ||
- sleep 5 && npm run bridge > /dev/null & | ||
- sleep 60 && npm run contracts --silent | ||
- npm test -- --coverage | ||
- npm run build --silent | ||
- FULL_GCR_KEY="-----BEGIN PRIVATE KEY-----\n"$GCR_KEY"\n-----END PRIVATE KEY-----\n" | ||
- sed -i -e "s%\PWD%$FULL_GCR_KEY%g" gcregistry.json | ||
- sed -i -e "s%branch%$TRAVIS_BRANCH%g" Dockerfile | ||
- cat Dockerfile | ||
- docker login -u _json_key -p "$(cat gcregistry.json)" https://gcr.io | ||
- rm -rf gcregistry.json | ||
- | | ||
if [ "$TRAVIS_TAG" == "" ]; then | ||
IMAGE_TAG_NAME="latest" | ||
elif [ "$TRAVIS_TAG" != "" ]; then | ||
IMAGE_TAG_NAME="$TRAVIS_TAG" | ||
fi; | ||
- docker build --quiet -t gcr.io/deep-wares-144610/$TRAVIS_BRANCH/chronomint:$IMAGE_TAG_NAME . | ||
- docker push gcr.io/deep-wares-144610/$TRAVIS_BRANCH/chronomint:$IMAGE_TAG_NAME | ||
- kill -9 $(ps ax | grep testrpc) | ||
- kill -9 $(ps ax | grep bridge.js) | ||
- yarn test --coverage | ||
- yarn build | ||
after_script: | ||
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js | ||
- FULL_GCR_KEY="-----BEGIN PRIVATE KEY-----\n"$GCR_KEY"\n-----END PRIVATE KEY-----\n" | ||
- sed -i -e "s%\PWD%$FULL_GCR_KEY%g" gcregistry.json | ||
- sed -i -e "s%branch%$TRAVIS_BRANCH%g" Dockerfile | ||
- cat Dockerfile | ||
- docker login -u _json_key -p "$(cat gcregistry.json)" https://gcr.io | ||
- rm -rf gcregistry.json | ||
- | | ||
if [ "$TRAVIS_TAG" == "" ]; then | ||
IMAGE_TAG_NAME="latest" | ||
elif [ "$TRAVIS_TAG" != "" ]; then | ||
IMAGE_TAG_NAME="$TRAVIS_TAG" | ||
fi; | ||
- docker build --quiet -t gcr.io/deep-wares-144610/$TRAVIS_BRANCH/chronomint:$IMAGE_TAG_NAME . | ||
- docker push gcr.io/deep-wares-144610/$TRAVIS_BRANCH/chronomint:$IMAGE_TAG_NAME | ||
- kill -9 $(ps aux | grep '[t]estrpc' | awk '{print $2}') | ||
|
||
cache: | ||
yarn: true |
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
const electron = require('electron') | ||
// Module to control application life. | ||
const app = electron.app | ||
// Module to create native browser window. | ||
const BrowserWindow = electron.BrowserWindow | ||
|
||
var child = require('child_process').execFile; | ||
var executablePath = "./geth"; | ||
var parameters = ["-light","--rpc"]; | ||
|
||
|
||
const path = require('path') | ||
const url = require('url') | ||
|
||
// Keep a global reference of the window object, if you don't, the window will | ||
// be closed automatically when the JavaScript object is garbage collected. | ||
let mainWindow | ||
|
||
function createWindow () { | ||
// Create the browser window. | ||
mainWindow = new BrowserWindow({width: 800, height: 600}) | ||
|
||
// and load the index.html of the app. | ||
let loadUrl = url.format({ | ||
pathname: path.join(__dirname, 'build/index.html'), | ||
protocol: 'file:', | ||
slashes: true | ||
}) | ||
if (process.env.LOAD_URL) { | ||
loadUrl = process.env.LOAD_URL; | ||
} | ||
mainWindow.loadURL(loadUrl); | ||
console.log('hui'); | ||
child(executablePath, parameters, function(err, data) { | ||
console.log(err) | ||
console.log(data.toString()); | ||
}); | ||
|
||
|
||
// Open the DevTools. | ||
// mainWindow.webContents.openDevTools() | ||
|
||
// Emitted when the window is closed. | ||
mainWindow.on('closed', function () { | ||
// Dereference the window object, usually you would store windows | ||
// in an array if your app supports multi windows, this is the time | ||
// when you should delete the corresponding element. | ||
mainWindow = null | ||
}) | ||
} | ||
|
||
// This method will be called when Electron has finished | ||
// initialization and is ready to create browser windows. | ||
// Some APIs can only be used after this event occurs. | ||
app.on('ready', createWindow) | ||
|
||
// Quit when all windows are closed. | ||
app.on('window-all-closed', function () { | ||
// On OS X it is common for applications and their menu bar | ||
// to stay active until the user quits explicitly with Cmd + Q | ||
if (process.platform !== 'darwin') { | ||
app.quit() | ||
} | ||
}) | ||
|
||
app.on('activate', function () { | ||
// On OS X it's common to re-create a window in the app when the | ||
// dock icon is clicked and there are no other windows open. | ||
if (mainWindow === null) { | ||
createWindow() | ||
} | ||
}) | ||
|
||
// In this file you can include the rest of your app's specific main process | ||
// code. You can also put them in separate files and require them here. | ||
|
Oops, something went wrong.