Skip to content

Commit 9b3610c

Browse files
committed
Merge branch 'develop'
2 parents c5ad69b + e72a2e1 commit 9b3610c

File tree

10 files changed

+404
-95
lines changed

10 files changed

+404
-95
lines changed

bin/embark

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var run = function(cmd) {
1414
}
1515
}
1616

17-
var deploy = function(embarkConfig) {
17+
var deploy = function(env, embarkConfig) {
1818
contractFiles = grunt.file.expand(embarkConfig.contracts);
1919
destFile = embarkConfig.output
2020
Embark.init()
@@ -25,7 +25,7 @@ var deploy = function(embarkConfig) {
2525
}
2626

2727
program
28-
.version('0.6.1')
28+
.version('0.7.0')
2929

3030
program.command('new [name]').description('New application').action(function(name) {
3131
if (name === undefined) {
@@ -49,7 +49,7 @@ program.command('deploy [env]').description('deploy contracts').action(function(
4949
run("grunt deploy_contracts:" + env);
5050
}
5151
else {
52-
deploy();
52+
deploy(env, embarkConfig);
5353
}
5454
});
5555

@@ -63,7 +63,7 @@ program.command('build [env]').description('build dapp').action(function(env_) {
6363
run('grunt build:' + env);
6464
}
6565
else if (embarkConfig.type === "meteor") {
66-
deploy();
66+
deploy(env, embarkConfig);
6767
run("meteor-build-client ./build -p ''");
6868
}
6969
});
@@ -79,7 +79,7 @@ program.command('ipfs [env]').description('build dapp and make it available in i
7979
run('grunt ipfs:' + env)
8080
}
8181
else if (embarkConfig.type === "meteor") {
82-
deploy();
82+
deploy(env, embarkConfig);
8383
run("meteor-build-client ./build -p ''");
8484
Embark.release.ipfs("build/")
8585
}
@@ -97,7 +97,7 @@ program.command('run [env]').description('run dapp').action(function(env_) {
9797
}
9898
else {
9999
console.log("command not available in meteor or manual mode yet");
100-
console.log("try instead embark run");
100+
console.log("try instead embark deploy; if using meteor then follow that with 'meteor'");
101101
}
102102
});
103103

@@ -126,7 +126,7 @@ program.command('blockchain [env]').description('run blockchain').action(functio
126126
Embark.contractsConfig.loadConfigFile(embarkConfig.contractsConfig)
127127

128128
//TODO: better with --exec, but need to fix console bug first
129-
wrench.copyDirSyncRecursive(__dirname + "/../js", "/tmp", {forceDelete: true});
129+
wrench.copyDirSyncRecursive(__dirname + "/../js", "/tmp/js", {forceDelete: true});
130130

131131
Embark.startBlockchain(env, true);
132132
}

boilerplate/Gruntfile.coffee

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = (grunt) ->
22

33
grunt.loadNpmTasks "grunt-embark"
4+
grunt.loadTasks "tasks"
45

56
grunt.initConfig(
67
files:
@@ -103,3 +104,6 @@ module.exports = (grunt) ->
103104
# Loads all plugins that match "grunt-", in this case all of our current plugins
104105
require('matchdep').filterAll('grunt-*').forEach(grunt.loadNpmTasks)
105106

107+
grunt.registerTask "deploy", ["coffee", "deploy_contracts", "concat", "copy", "server", "watch"]
108+
grunt.registerTask "build", ["clean", "deploy_contracts", "coffee", "concat", "uglify", "copy"]
109+

boilerplate/config/blockchain.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,13 @@ staging:
2121
account:
2222
init: false
2323
address:
24+
production:
25+
rpc_host: localhost
26+
rpc_port: 8101
27+
rpc_whitelist: "*"
28+
datadir: default
29+
network_id: 1
30+
console: true
31+
account:
32+
init: false
33+
address:

boilerplate/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"license": "ISC",
1111
"homepage": "",
1212
"devDependencies": {
13-
"embark-framework": "^0.6.1",
14-
"grunt-embark": "0.1.0",
13+
"embark-framework": "^0.7.0",
14+
"grunt-embark": "^0.2.0",
1515
"grunt-contrib-clean": "^0.6.0",
1616
"grunt-contrib-coffee": "^0.13.0",
1717
"grunt-contrib-concat": "^0.5.1",
@@ -20,6 +20,9 @@
2020
"grunt-contrib-watch": "^0.6.1",
2121
"grunt": "^0.4.5",
2222
"grunt-cli": "^0.1.13",
23-
"matchdep": "^0.3.0"
23+
"matchdep": "^0.3.0",
24+
"express": "^4.12.3",
25+
"read-yaml": "^1.0.0",
26+
"compression": "^1.4.3"
2427
}
2528
}

boilerplate/tasks/server.coffee

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = (grunt) ->
2+
express = require('express')
3+
compression = require('compression')
4+
readYaml = require('read-yaml')
5+
6+
grunt.registerTask "server", "static file development server", =>
7+
serverConfig = readYaml.sync("config/server.yml")
8+
9+
webPort = serverConfig.port || 8000
10+
webHost = serverConfig.host || 'localhost'
11+
webRoot = "generated/dapp"
12+
13+
app = express()
14+
app.use(compression())
15+
app.use(express.static("" + (process.cwd()) + "/" + webRoot))
16+
app.listen(webPort, webHost)
17+
18+
grunt.log.writeln("Running web server on port http://#{webHost}:#{webPort}")
19+
20+
return app
21+
22+

demo/config/blockchain.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,13 @@ staging:
2121
account:
2222
init: false
2323
address:
24+
production:
25+
rpc_host: localhost
26+
rpc_port: 8101
27+
rpc_whitelist: "*"
28+
datadir: default
29+
network_id: 1
30+
console: true
31+
account:
32+
init: false
33+
address:

0 commit comments

Comments
 (0)