Using monorepo's contracts instead of dockerfile.

This commit is contained in:
rzadp 2019-05-21 16:27:47 +02:00
parent b39336ea57
commit 93d42a34b3
6 changed files with 37 additions and 29 deletions

@ -1,24 +0,0 @@
FROM node:8
RUN mkdir /stuff
WORKDIR /stuff
RUN git clone https://github.com/poanetwork/poa-bridge-contracts.git
RUN mkdir submodules && \
mv poa-bridge-contracts submodules && \
cd submodules/poa-bridge-contracts && \
git fetch && \
git checkout 2.1.0
RUN cd submodules/poa-bridge-contracts && \
npm install && \
./node_modules/.bin/truffle compile && \
cd deploy && \
npm install
COPY deploy.sh .
COPY contracts.env submodules/poa-bridge-contracts/deploy/
COPY erc-contracts.env submodules/poa-bridge-contracts/deploy/
COPY erc-native-contracts.env submodules/poa-bridge-contracts/deploy/
COPY deployERC20.js submodules/poa-bridge-contracts/deploy/
RUN cd submodules/poa-bridge-contracts/deploy && cp contracts.env .env

@ -1,15 +1,18 @@
/* eslint import/no-unresolved: 0 node/no-missing-require: 0 */
const path = require('path')
require('dotenv').config();
require('dotenv').config({
path: path.join(__dirname, '../../contracts-2.1.0/deploy/.env')
})
const {
deployContract,
sendRawTx
} = require('./src/deploymentUtils')
} = require('../../contracts-2.1.0/deploy/src/deploymentUtils')
const {
web3Foreign,
deploymentPrivateKey
} = require('./src/web3')
const POA20 = require('../build/contracts/ERC677BridgeToken.json')
} = require('../../contracts-2.1.0/deploy/src/web3')
const POA20 = require('../../contracts-2.1.0/build/contracts/ERC677BridgeToken.json')
const user = '0x7FC1442AB55Da569940Eb750AaD2BAA63DA4010E'
const { DEPLOYMENT_ACCOUNT_ADDRESS } = process.env

@ -171,3 +171,6 @@ services:
- REACT_APP_FOREIGN_GAS_PRICE_FALLBACK=5000000000
- REACT_APP_FOREIGN_GAS_PRICE_UPDATE_INTERVAL=15000
command: "true"
e2e:
build: ../
command: "true"

@ -5,5 +5,8 @@
"private": true,
"devDependencies": {
"mocha": "^5.1.1"
},
"scripts": {
"deploy": "node ./scripts/deploy.js"
}
}

@ -5,7 +5,7 @@ docker-compose down
docker-compose up -d --build --force-recreate
node ./scripts/blocks.js &
docker-compose run contracts ./deploy.sh
docker-compose run e2e yarn workspace ui-e2e run deploy
docker-compose run -d bridge npm run watcher:signature-request
docker-compose run -d bridge npm run watcher:collected-signatures
docker-compose run -d bridge npm run watcher:affirmation-request

23
ui-e2e/scripts/deploy.js Normal file

@ -0,0 +1,23 @@
const path = require('path')
const shell = require('shelljs')
const envsDir = path.join(__dirname, '../contracts')
const deployContractsDir = path.join(__dirname, '../../contracts-2.1.0/deploy')
const erc20ScriptDir = path.join(__dirname, '../contracts')
shell.cp(path.join(envsDir, 'contracts.env'), path.join(deployContractsDir, '.env'))
shell.cd(deployContractsDir)
shell.exec('node deploy.js')
shell.cd(erc20ScriptDir)
shell.exec('node deployERC20.js')
shell.cd(deployContractsDir)
shell.rm('.env')
shell.cp(path.join(envsDir, 'erc-contracts.env'), path.join(deployContractsDir, '.env'))
shell.exec('node deploy.js')
shell.rm('.env')
shell.cp(
path.join(envsDir, 'erc-native-contracts.env'),
path.join(deployContractsDir, '.env')
)
shell.exec('node src/utils/deployBlockReward.js')
shell.exec('node deploy.js')