use local messctl in docker if exists

This commit is contained in:
Mayel 2020-11-05 11:08:52 +01:00
parent bbd5aecd6e
commit 99a9f3681e
2 changed files with 4 additions and 3 deletions

View file

@ -6,6 +6,7 @@ docs/exdoc
.npm
.git
.gitignore
.config
Dockerfile
Makefile
README*

View file

@ -22,11 +22,11 @@ RUN apk add git \
RUN apk add cmake make gcc libc-dev
# dependency manager
RUN git clone https://github.com/commonspub/messctl.git priv/messctl/origin
RUN git clone https://github.com/commonspub/messctl.git libs/messctl/origin 2> /dev/null || (cd libs/messctl/origin && git pull)
# precompile Rust deps
RUN cd priv/messctl && cargo init && mkdir .cargo && cp origin/Cargo.* . && cargo build
RUN cd libs/messctl && cargo init && mkdir .cargo && cp origin/Cargo.* . && cargo build
# compile messctl
RUN cd priv/messctl && cp -r origin/* . && cargo build --release && cargo install --path . --verbose
RUN cd libs/messctl && cp -r origin/* . && cargo build --release && cargo install --path . --verbose
# install
RUN cp /opt/app/.cargo/bin/* /bin/