Skip to content

Commit

Permalink
use branch in docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Jan 5, 2022
1 parent febd3ac commit c7378a1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,5 @@ with-keyring = [ "keyring" ]
[target."cfg(target_family = \"unix\")".dependencies]
users = "0.11.0"

[profile.release]
incremental = true

[profile.dev]
incremental = true
4 changes: 2 additions & 2 deletions dist/build/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cd -
mkdir -p ${PKGS_DIR}/
# Build x86_64_deb
cd x86_64_debian9/
docker build --tag termscp-${VERSION}-x86_64_debian9 .
docker build --build-arg branch=${VERSION} --tag termscp-${VERSION}-x86_64_debian9 .
cd -
mkdir -p ${PKGS_DIR}/deb/
mkdir -p ${PKGS_DIR}/x86_64-unknown-linux-gnu/
Expand All @@ -30,7 +30,7 @@ rm termscp
cd -
# Build x86_64_centos7
cd x86_64_centos7/
docker build --tag termscp-${VERSION}-x86_64_centos7 .
docker build --build-arg branch=${VERSION} --tag termscp-${VERSION}-x86_64_centos7 .
cd -
mkdir -p ${PKGS_DIR}/rpm/
CONTAINER_NAME=$(docker create termscp-${VERSION}-x86_64_centos7 /bin/bash)
Expand Down
4 changes: 3 additions & 1 deletion dist/build/x86_64_centos7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM centos:centos7 as builder

ARG branch
ENV branch=$branch
WORKDIR /usr/src/
# Install dependencies
RUN yum -y install \
Expand All @@ -15,7 +17,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rust.sh &&
chmod +x /tmp/rust.sh && \
/tmp/rust.sh -y
# Clone repository
RUN git clone https://github.com/veeso/termscp.git
RUN git clone --branch $branch https://github.com/veeso/termscp.git
# Set workdir to termscp
WORKDIR /usr/src/termscp/
# Install cargo arxch
Expand Down
4 changes: 3 additions & 1 deletion dist/build/x86_64_debian9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM debian:stretch

ARG branch
ENV branch=$branch
WORKDIR /usr/src/
# Install dependencies
RUN apt update && apt install -y \
Expand All @@ -17,7 +19,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rust.sh &&
chmod +x /tmp/rust.sh && \
/tmp/rust.sh -y
# Clone repository
RUN git clone https://github.com/veeso/termscp.git
RUN git clone --branch $branch https://github.com/veeso/termscp.git
# Set workdir to termscp
WORKDIR /usr/src/termscp/
# Install cargo deb
Expand Down

0 comments on commit c7378a1

Please sign in to comment.