Skip to content

Commit

Permalink
Use docker mounts for running updated scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
pool2win committed Mar 19, 2024
1 parent 046b881 commit 852a183
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
dir := justfile_directory()
docker_command := "docker run -it --mount type=bind,source="+dir+"/lib,target=/bitcoin-dsl/lib --mount type=bind,source="+dir+"/spec,target=/bitcoin-dsl/spec bitcoin-dsl"

default: build-docker

build-docker:
docker build -t bitcoin-dsl .

run script:
docker run bitcoin-dsl ruby ./lib/run.rb -s {{script}}
{{docker_command}} ruby ./lib/run.rb -s {{script}}

test:
docker run bitcoin-dsl rake spec
{{docker_command}} rake spec

bash:
{{docker_command}} bash
2 changes: 1 addition & 1 deletion spec/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

describe 'Running lightning contracts' do
it_behaves_like 'script evaluation', './lib/contracts/lightning/funding.rb'
it_behaves_like 'script evaluation', './lib/contracts/lightning/commitment.rb'
it_behaves_like 'script evaluation', './lib/contracts/lightning/commitment_without_htlcs.rb'
it_behaves_like 'script evaluation', './lib/contracts/lightning/close_cooperatively_without_htlcs.rb'
it_behaves_like 'script evaluation', './lib/contracts/lightning/close_unilaterally_without_htlcs.rb'
end
Expand Down

0 comments on commit 852a183

Please sign in to comment.