Merge pull request #18 from k1rill-fedoseev/deployment-fix

Fixed problem with redeployment, mounting built contracts in deploy c…
This commit is contained in:
Kirill Fedoseev 2019-08-25 16:15:06 +03:00 committed by GitHub
commit b7f15c46ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 30 additions and 90 deletions

View File

@ -41,7 +41,7 @@ cd ../src/deploy/deploy-test
echo "Building deploy docker image"
docker build -t deploy_test . > /dev/null 2>&1
echo "Deploying"
docker run --network blockchain_home --rm --env-file .env -v "$(pwd)/build:/build/build" deploy_test --network development --reset > /dev/null 2>&1
docker run --network blockchain_home --rm --env-file .env deploy_test --network development --reset > /dev/null 2>&1
@ -52,7 +52,7 @@ cd ../deploy-home
echo "Building deploy docker image"
docker build -t deploy_home . > /dev/null 2>&1
echo "Deploying"
docker run --network blockchain_home --rm --env-file .env -v "$(pwd)/build:/build/build" deploy_home --network development --reset > /dev/null 2>&1
docker run --network blockchain_home --rm --env-file .env deploy_home --network development --reset > /dev/null 2>&1
@ -63,7 +63,7 @@ cd ../deploy-side
echo "Building deploy docker image"
docker build -t deploy_side . > /dev/null 2>&1
echo "Deploying"
docker run --network blockchain_side --rm --env-file .env -v "$(pwd)/build:/build/build" deploy_side --network development --reset > /dev/null 2>&1
docker run --network blockchain_side --rm --env-file .env deploy_side --network development --reset > /dev/null 2>&1

View File

@ -10,6 +10,15 @@ RUN npm install truffle-hdwallet-provider
RUN truffle obtain --solc 0.5.9
COPY truffle-config-build.js /build/truffle-config.js
RUN mkdir temp \
&& cd temp \
&& truffle init \
&& mkdir ../contracts \
&& cp ./contracts/Migrations.sol ../contracts/Migrations.sol \
&& cd .. \
&& rm -rf temp
COPY contracts/openzeppelin-solidity /build/contracts/openzeppelin-solidity
RUN truffle compile

View File

@ -1,24 +0,0 @@
pragma solidity ^0.5.9;
contract Migrations {
address public owner;
uint public last_completed_migration;
modifier restricted() {
if (msg.sender == owner) _;
}
constructor() public {
owner = msg.sender;
}
function setCompleted(uint completed) restricted public {
last_completed_migration = completed;
}
function upgrade(address new_address) restricted public {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}

View File

@ -1,5 +0,0 @@
const Migrations = artifacts.require('Migrations')
module.exports = deployer => {
deployer.deploy(Migrations)
}

View File

@ -10,6 +10,15 @@ RUN npm install truffle-hdwallet-provider
RUN truffle obtain --solc 0.5.9
COPY truffle-config-build.js /build/truffle-config.js
RUN mkdir temp \
&& cd temp \
&& truffle init \
&& mkdir ../contracts \
&& cp ./contracts/Migrations.sol ../contracts/Migrations.sol \
&& cd .. \
&& rm -rf temp
COPY contracts /build/contracts
RUN truffle compile

View File

@ -1,24 +0,0 @@
pragma solidity ^0.5.9;
contract Migrations {
address public owner;
uint public last_completed_migration;
modifier restricted() {
if (msg.sender == owner) _;
}
constructor() public {
owner = msg.sender;
}
function setCompleted(uint completed) restricted public {
last_completed_migration = completed;
}
function upgrade(address new_address) restricted public {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}

View File

@ -1,5 +0,0 @@
const Migrations = artifacts.require('Migrations')
module.exports = deployer => {
deployer.deploy(Migrations)
}

View File

@ -10,6 +10,15 @@ RUN npm install truffle-hdwallet-provider
RUN truffle obtain --solc 0.5.9
COPY truffle-config-build.js /build/truffle-config.js
RUN mkdir temp \
&& cd temp \
&& truffle init \
&& mkdir ../contracts \
&& cp ./contracts/Migrations.sol ../contracts/Migrations.sol \
&& cd .. \
&& rm -rf temp
COPY contracts/openzeppelin-solidity /build/contracts/openzeppelin-solidity
RUN truffle compile

View File

@ -1,24 +0,0 @@
pragma solidity ^0.5.9;
contract Migrations {
address public owner;
uint public last_completed_migration;
modifier restricted() {
if (msg.sender == owner) _;
}
constructor() public {
owner = msg.sender;
}
function setCompleted(uint completed) restricted public {
last_completed_migration = completed;
}
function upgrade(address new_address) restricted public {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}

View File

@ -1,5 +0,0 @@
const Migrations = artifacts.require('Migrations')
module.exports = deployer => {
deployer.deploy(Migrations)
}