@@ -78,33 +78,33 @@ poetry shell
7878## ⚗️ Workflow
7979### 🐳 Docker
8080#### The no-brainer workflow to run tests on any machine with ** only Docker** installed
81- Clone repo and build a fresh image:
81+ Clone the repo and build a fresh image:
8282``` shell
83- user@local: ~ # git clone [email protected] :lidofinance/scripts.git84- user@local: ~ # cd scripts
85- user@local: ~ /scripts# docker build -t scripts-env .
83+ git clone
[email protected] :lidofinance/scripts.git
84+ cd scripts
85+ docker build -t scripts-env .
8686```
87- Run the container filling all ENV VARs:
87+ Make sure you have set up all the ENV VARs you are using:
88+ - ` PINATA_CLOUD_TOKEN ` , ` WEB3_INFURA_PROJECT_ID ` , ` DEPLOYER ` , etc.
89+ - ` ROOT_PASSWORD ` for the ssh password
90+
91+ Run the container passing all ENV VARs you are using:
8892``` shell
89- user@local:~ /scripts# docker run \
90- -e PINATA_CLOUD_TOKEN=" <FILL>" \
91- -e WEB3_INFURA_PROJECT_ID=" <FILL>" \
92- -e DEPLOYER=" <FILL>" \
93- -it scripts-env bash
93+ docker run -e ROOT_PASSWORD -e PINATA_CLOUD_TOKEN -e WEB3_INFURA_PROJECT_ID -e DEPLOYER -d -p 2222:22 scripts-env
9494```
95- You are now inside the docker container, ready to run tests :
95+ Now connect to the running container using SSH :
9696``` shell
97- root@container:~ /scripts# poetry run brownie test
97+ # ssh-keygen -R [localhost]:2222 # use this if you get a 'REMOTE HOST IDENTIFICATION HAS CHANGED' error
98+ ssh root@localhost -p 2222
99+ # type 'yes' and then <ENTER> if you are asked 'Are you sure you want to continue connecting'
100+ # use password from $ROOT_PASSWORD ENV VAR
98101```
99- If new tests have been added/branches switched/etc. outside the container - update files inside the running container :
102+ You now have a fully functional environment to run tests in, which already contains the repo from which the image was built :
100103``` shell
101- # find the container id:
102- user@local:~ /scripts# docker ps -a
103-
104- # update files:
105- user@local:~ /scripts# docker exec < CONTAINER_ID> rm -rf /home/root/scripts/*
106- user@local:~ /scripts# docker cp . < CONTAINER_ID> :/home/root/scripts
104+ poetry run brownie test tests/acceptance/test_accounting_oracle.py -s
107105```
106+ You can use VS Code/PyCharm to connect via SSH and make code changes.
107+ For future maintenance, see [ Dockerfile] ( Dockerfile ) .
108108
109109### Network setup
110110
0 commit comments