implement deploy field
This commit is contained in:
parent
44583f525f
commit
e1ae6dae0c
|
@ -261,7 +261,6 @@ The environment is a specific blockchain configuration that can be managed at co
|
|||
|
||||
See [Configuration](https://github.com/iurimatias/embark-framework/wiki/Configuration).
|
||||
|
||||
|
||||
Deploying only contracts
|
||||
======
|
||||
Although embark run will automatically deploy contracts, you can choose to only deploy the contracts to a specific environment
|
||||
|
|
|
@ -132,6 +132,11 @@ ContractsConfig.prototype.compileContracts = function(env) {
|
|||
contract.types.push('static');
|
||||
}
|
||||
|
||||
contract.deploy = contractConfig.deploy;
|
||||
if (contractConfig.deploy === undefined) {
|
||||
contract.deploy = true;
|
||||
}
|
||||
|
||||
if (this.all_contracts.indexOf(className) < 0) {
|
||||
this.all_contracts.push(className);
|
||||
}
|
||||
|
|
|
@ -58,6 +58,11 @@ Deploy.prototype.deploy_contracts = function(env) {
|
|||
className = all_contracts[k];
|
||||
contract = this.contractDB[className];
|
||||
|
||||
if (contract.deploy === false) {
|
||||
console.log("skipping " + className);
|
||||
continue;
|
||||
}
|
||||
|
||||
var realArgs = [];
|
||||
for (var l = 0; l < contract.args.length; l++) {
|
||||
arg = contract.args[l];
|
||||
|
|
|
@ -110,12 +110,13 @@ describe('embark.deploy', function() {
|
|||
deploy.deploy_contracts("development");
|
||||
|
||||
it("should deploy contracts", function() {
|
||||
var all_contracts = ['SimpleStorage', 'BarStorage', 'FooStorage'];
|
||||
var all_contracts = ['BarStorage', 'FooStorage'];
|
||||
for(var i=0; i < all_contracts.length; i++) {
|
||||
var className = all_contracts[i];
|
||||
|
||||
assert.equal(deploy.deployedContracts.hasOwnProperty(className), true);
|
||||
}
|
||||
assert.notEqual(deploy.deployedContracts.hasOwnProperty('SimpleStorage'), true);
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
development:
|
||||
SimpleStorage:
|
||||
deploy: false
|
||||
args:
|
||||
- 100
|
||||
BarStorage:
|
||||
|
|
Loading…
Reference in New Issue