Fix missing build script/git repo during build
Check Details
Lints Details

When building the dependencies, the build script should not be
considered. When building the actual binary, the git repository needs to
be present and the build script should be run.
This commit is contained in:
Paul van Tilburg 2023-03-22 15:27:10 +01:00
parent 9200a10cef
commit 3fff79a2cd
Signed by: paul
GPG Key ID: C6DE073EDA9EEC4D
2 changed files with 2 additions and 3 deletions

View File

@ -5,9 +5,6 @@ target
Dockerfile*
docker-compose*
# Git folder
.git
# Dot files
.gitignore

View File

@ -11,10 +11,12 @@ ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN USER=root cargo new --bin /usr/src/solar-grabber
WORKDIR /usr/src/solar-grabber
COPY ./Cargo.* ./
RUN sed -i -e 's/^build =/#build =/' Cargo.toml
RUN cargo build --release
RUN rm src/*.rs
# Add the real project files from current folder
COPY ./Cargo.toml ./
ADD . ./
# Build the actual binary from the copied local files