Skip to content

Commit

Permalink
fix: use git monkeypatch for WalletWasabi build
Browse files Browse the repository at this point in the history
prints `git rev-parse HEAD`
  • Loading branch information
szymonlesisz authored and onvej-sl committed Jul 13, 2023
1 parent 30766ab commit 0214698
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scripts/WalletWasabi-HEAD
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ RUN wget https://bitcoinknots.org/~luke-jr/.RISKY/programs/bitcoin/files/bitcoin
RUN tar -xzf /packages/bitcoin-23.0.knots20220529-x86_64-linux-gnu.tar.gz --one-top-level=/opt/bitcoin-knots/ --strip-components=1
RUN rm -rf /packages

# Install scripts
COPY scripts/ /opt/bin/
ENV PATH="/opt/bin/:${PATH}"

# Install WalletWasabi
RUN apt-get install -y libx11-dev libice-dev libsm-dev libfontconfig1
COPY vendor/WalletWasabi /opt/WalletWasabi
Expand All @@ -30,9 +34,6 @@ COPY configuration/wallet-wasabi/backend/ /root/.walletwasabi/backend/

RUN mkdir /opt/bitcoin-knots/data

# Install scripts
COPY scripts/ /opt/bin/
ENV PATH="/opt/bin/:${PATH}"

ENTRYPOINT ["/bin/bash", "-c"]
CMD ["run-environment-testnet && sleep infinity"]
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ build: build-image create-container
vendor:
git submodule update --init --recursive --force

build-image: Dockerfile
docker build -t coinjoin-backend-image .
build-image:
# create file for git monkeypatch (see ./scripts/git)
(cd ./vendor/WalletWasabi && git rev-parse HEAD) > scripts/WalletWasabi-HEAD
docker build -f ./Dockerfile -t coinjoin-backend-image .

create-container:
if [[ $$(docker ps -q -f name=coinjoin-backend-container) ]]; then docker kill coinjoin-backend-container; else true; fi
Expand Down
5 changes: 5 additions & 0 deletions scripts/git
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# monkey patch for git + WalletWasabi submodule
# WalletWasabi build uses `git rev-parse HEAD` to include commitHash
# unfortunatelly whole .git directory is listed the .dockerignore since it's too big to copy into docker context
# instead of using real `git` binary just print out commit hash stored in the HEAD file explicitly copied by the Makefile
echo "$(cat /opt/bin/WalletWasabi-HEAD)"

0 comments on commit 0214698

Please sign in to comment.