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 12, 2023
1 parent 10d62ce commit 0578f3d
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 @@ -35,6 +35,10 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE_KNOTS=x86_64; el

RUN rm -rf /packages

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

# Install WalletWasabi
COPY vendor/WalletWasabi /opt/WalletWasabi
RUN cd /opt/WalletWasabi/ && DOTNET_EnableWriteXorExecute=0 dotnet build
Expand All @@ -54,9 +58,6 @@ COPY configuration/wallet-wasabi/ /root/.walletwasabi/

RUN mkdir /opt/bitcoin-knots/data

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

ENTRYPOINT ["/bin/bash", "-c"]
CMD ["run-environment && 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: vendor 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 0578f3d

Please sign in to comment.