-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,46 @@ | ||
# Go Version | ||
# Use whatever base image you need: | ||
FROM golang:1.23.1-bullseye | ||
|
||
# Declare build arguments so they're visible inside the Dockerfile | ||
ARG repo | ||
ARG commit_sha | ||
ARG branch | ||
|
||
RUN apt-get update -y | ||
RUN apt install -y g++ gcc make cmake git nano libcurl3-dev python3 python3-dev \ | ||
curl bash linux-headers-amd64 xz-utils jq unzip | ||
|
||
# Switch into /root | ||
WORKDIR /root | ||
|
||
RUN git clone https://github.com/TrueBlocks/trueblocks-core.git /root/trueblocks-core | ||
# Debug: confirm we have the correct values | ||
RUN echo "DEBUG: repo=${repo}, branch=${branch}" | ||
|
||
# 1) Clone | ||
RUN git clone --progress "https://github.com/${repo}.git" /root/trueblocks-core | ||
|
||
# 2) Move into the cloned repo | ||
WORKDIR /root/trueblocks-core | ||
RUN git checkout ${branch} && git submodule update --init --recursive | ||
RUN mkdir build | ||
|
||
# 3) Check out the desired branch | ||
RUN git checkout "${branch}" | ||
|
||
# 4) Update/init submodules | ||
RUN git submodule update --init --recursive | ||
|
||
# 5) Make a build folder | ||
RUN mkdir -v build | ||
|
||
# 6) Switch into that folder | ||
WORKDIR /root/trueblocks-core/build | ||
RUN ../scripts/go-work-sync.sh && cmake ../src | ||
RUN make -j4 | ||
|
||
# RUN git clone --progress https://github.com/$repo.git /root/trueblocks-core && \ | ||
# cd /root/trueblocks-core && \ | ||
# git checkout $branch && \ | ||
# git submodule update --init --recursive && \ | ||
# mkdir -v build && \ | ||
# cd build && \ | ||
# ../scripts/go-work-sync.sh && \ | ||
# cmake ../src && \ | ||
# make -j 4 | ||
# 7) Optionally sync go.work modules (if your script does that) | ||
RUN ../scripts/go-work-sync.sh | ||
|
||
# 8) Run CMake | ||
RUN cmake ../src | ||
|
||
# 9) Run make (compile) | ||
RUN make -j4 | ||
|
||
# Finally, define your entrypoint (if you want to run tests or something) | ||
ENTRYPOINT ["bash", "/root/trueblocks-core/scripts/build-and-test.sh"] |