From b47067b31103f109577fbdd8c78b85e7f24fc3cc Mon Sep 17 00:00:00 2001 From: Paul <paulmakles@gmail.com> Date: Mon, 3 May 2021 09:59:40 +0100 Subject: [PATCH] Cache Cargo dependencies for Docker build. --- Dockerfile | 3 +++ publish.sh | 2 +- src/bin/dummy.rs | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 src/bin/dummy.rs diff --git a/Dockerfile b/Dockerfile index 475bc96..542618a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,9 @@ WORKDIR /home/rust/src RUN USER=root cargo new --bin revolt WORKDIR /home/rust/src/revolt COPY Cargo.toml Cargo.lock ./ +COPY src/bin/dummy.rs ./src/bin/dummy.rs +RUN cargo build --release --bin dummy + COPY assets/templates ./assets/templates COPY src ./src RUN cargo build --release diff --git a/publish.sh b/publish.sh index 5248239..18bab40 100755 --- a/publish.sh +++ b/publish.sh @@ -2,6 +2,6 @@ # Tip: for subsequent builds, don't update Cargo.toml # in order to not download all the crates again. # Update Cargo.toml on major release. -version=0.4.1-alpha.4 +version=0.4.1-alpha.4-patch.0 docker build -t revoltchat/server:${version} . && docker push revoltchat/server:${version} diff --git a/src/bin/dummy.rs b/src/bin/dummy.rs new file mode 100644 index 0000000..e71fdf5 --- /dev/null +++ b/src/bin/dummy.rs @@ -0,0 +1 @@ +fn main() {} \ No newline at end of file -- GitLab