This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch 5.0.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/5.0.x by this push:
     new 48240ad  Do not require .git to build (#5181)
48240ad is described below

commit 48240ad9ce59071e0a7a7e4541c57738b442fd23
Author: Zach Hoffman <[email protected]>
AuthorDate: Wed Oct 21 13:11:48 2020 -0600

    Do not require .git to build (#5181)
    
    * Use latest clean_build.sh
    
    * Do not require .git repo to build
    
    (cherry picked from commit dced3833eab080ed8f8a34d5a21594aafe36c062)
---
 build/clean_build.sh                                   | 8 +++++---
 infrastructure/docker/build/Dockerfile-docs            | 3 +--
 infrastructure/docker/build/Dockerfile-grove           | 4 +---
 infrastructure/docker/build/Dockerfile-grovetccfg      | 4 +---
 infrastructure/docker/build/Dockerfile-source          | 3 +--
 infrastructure/docker/build/Dockerfile-traffic_monitor | 3 +--
 infrastructure/docker/build/Dockerfile-traffic_ops     | 3 +--
 infrastructure/docker/build/Dockerfile-traffic_ops_ort | 3 +--
 infrastructure/docker/build/Dockerfile-traffic_portal  | 3 +--
 infrastructure/docker/build/Dockerfile-traffic_router  | 3 +--
 infrastructure/docker/build/Dockerfile-traffic_stats   | 3 +--
 11 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/build/clean_build.sh b/build/clean_build.sh
index a857a1b..f989cba 100755
--- a/build/clean_build.sh
+++ b/build/clean_build.sh
@@ -50,13 +50,15 @@ fi
  mkdir -p src pkg bin "$(dirname "$tc_dir")"
 )
 rsync -a --exclude=/dist --exclude=/.m2 "${tc_volume}/" "$tc_dir";
-if ! [ -d ${tc_dir}/.git ]; then
+if [ -d "${tc_volume}/.git" ] && [ ! -d ${tc_dir}/.git ]; then
        rsync -a "${tc_volume}/.git" $tc_dir; # Docker for Windows compatibility
 fi
 
 cd "$tc_dir"
-# In case the mirrored repo already exists, remove gitignored files
-git clean -fdX
+if [ -d "${tc_volume}/.git" ]; then
+       # In case the mirrored repo already exists, remove gitignored files
+       git clean -fdX
+fi
 
 rm -rf "dist"
 mkdir -p "${tc_volume}/dist"
diff --git a/infrastructure/docker/build/Dockerfile-docs 
b/infrastructure/docker/build/Dockerfile-docs
index 9b9dae6..a37079a 100644
--- a/infrastructure/docker/build/Dockerfile-docs
+++ b/infrastructure/docker/build/Dockerfile-docs
@@ -44,7 +44,6 @@ RUN   python3 -m pip install --upgrade setuptools && \
        python3 -m pip install -r /docs.requirements.txt
 ###
 
-ADD build/clean_build.sh /
-CMD /clean_build.sh docs
+CMD /trafficcontrol/build/clean_build.sh docs
 
 # vi:syntax=Dockerfile
diff --git a/infrastructure/docker/build/Dockerfile-grove 
b/infrastructure/docker/build/Dockerfile-grove
index 6acac11..9996ed2 100644
--- a/infrastructure/docker/build/Dockerfile-grove
+++ b/infrastructure/docker/build/Dockerfile-grove
@@ -45,10 +45,8 @@ RUN go_version=$(cat /GO_VERSION) && \
 
 ###
 
-ADD build/clean_build.sh /
-
 ENV GOPATH=/go
 RUN mkdir -p /go/src/github.com/apache && ln -s /tmp/trafficcontrol 
/go/src/github.com/apache/trafficcontrol
-CMD /clean_build.sh grove
+CMD /trafficcontrol/build/clean_build.sh grove
 
 # vi:syntax=Dockerfile
diff --git a/infrastructure/docker/build/Dockerfile-grovetccfg 
b/infrastructure/docker/build/Dockerfile-grovetccfg
index f139b6a..34679d9 100644
--- a/infrastructure/docker/build/Dockerfile-grovetccfg
+++ b/infrastructure/docker/build/Dockerfile-grovetccfg
@@ -45,10 +45,8 @@ RUN go_version=$(cat /GO_VERSION) && \
 
 ###
 
-ADD build/clean_build.sh /
-
 ENV GOPATH=/go
 RUN mkdir -p /go/src/github.com/apache && ln -s /tmp/trafficcontrol 
/go/src/github.com/apache/trafficcontrol
-CMD /clean_build.sh grove/grovetccfg
+CMD /trafficcontrol/build/clean_build.sh grove/grovetccfg
 
 # vi:syntax=Dockerfile
diff --git a/infrastructure/docker/build/Dockerfile-source 
b/infrastructure/docker/build/Dockerfile-source
index e4e9d17..9de6c3c 100644
--- a/infrastructure/docker/build/Dockerfile-source
+++ b/infrastructure/docker/build/Dockerfile-source
@@ -37,7 +37,6 @@ RUN   yum -y install \
        yum -y clean all
 
 WORKDIR /trafficcontrol
-ADD build/clean_build.sh /
-CMD /clean_build.sh tarball
+CMD build/clean_build.sh tarball
 
 # vi:syntax=Dockerfile
diff --git a/infrastructure/docker/build/Dockerfile-traffic_monitor 
b/infrastructure/docker/build/Dockerfile-traffic_monitor
index 77c1bfc..74a9066 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_monitor
+++ b/infrastructure/docker/build/Dockerfile-traffic_monitor
@@ -47,7 +47,6 @@ RUN go_version=$(cat /GO_VERSION) && \
 
 ###
 
-ADD build/clean_build.sh /
-CMD /clean_build.sh traffic_monitor
+CMD /trafficcontrol/build/clean_build.sh traffic_monitor
 
 # vi:syntax=Dockerfile
diff --git a/infrastructure/docker/build/Dockerfile-traffic_ops 
b/infrastructure/docker/build/Dockerfile-traffic_ops
index b93f993..3f4ab37 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_ops
+++ b/infrastructure/docker/build/Dockerfile-traffic_ops
@@ -52,7 +52,6 @@ RUN go_version=$(cat /GO_VERSION) && \
 
 ###
 
-ADD build/clean_build.sh /
-CMD /clean_build.sh traffic_ops
+CMD /trafficcontrol/build/clean_build.sh traffic_ops
 
 # vi:syntax=Dockerfile
diff --git a/infrastructure/docker/build/Dockerfile-traffic_ops_ort 
b/infrastructure/docker/build/Dockerfile-traffic_ops_ort
index 57c7b02..550ab95 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_ops_ort
+++ b/infrastructure/docker/build/Dockerfile-traffic_ops_ort
@@ -33,7 +33,6 @@ RUN go_version=$(cat /GO_VERSION) && \
        ln -s /usr/local/go/bin/go /usr/bin/go && \
        rm go.tar.gz
 
-ADD build/clean_build.sh /
-CMD /clean_build.sh traffic_ops_ort
+CMD /trafficcontrol/build/clean_build.sh traffic_ops_ort
 
 #vi:syntax=Dockerfile
diff --git a/infrastructure/docker/build/Dockerfile-traffic_portal 
b/infrastructure/docker/build/Dockerfile-traffic_portal
index 86043e4..8d516bc 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_portal
+++ b/infrastructure/docker/build/Dockerfile-traffic_portal
@@ -54,7 +54,6 @@ RUN   echo '{ "allow_root": true }' > /root/.bowerrc
 
 ###
 
-ADD build/clean_build.sh /
-CMD /clean_build.sh traffic_portal
+CMD /trafficcontrol/build/clean_build.sh traffic_portal
 
 # vi:syntax=Dockerfile
diff --git a/infrastructure/docker/build/Dockerfile-traffic_router 
b/infrastructure/docker/build/Dockerfile-traffic_router
index b167371..263a811 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_router
+++ b/infrastructure/docker/build/Dockerfile-traffic_router
@@ -47,7 +47,6 @@ RUN curl -L 
https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3
 
 ###
 
-ADD build/clean_build.sh /
-CMD /clean_build.sh traffic_router
+CMD /trafficcontrol/build/clean_build.sh traffic_router
 
 # vi:syntax=Dockerfile
diff --git a/infrastructure/docker/build/Dockerfile-traffic_stats 
b/infrastructure/docker/build/Dockerfile-traffic_stats
index 9725a2f..3901b89 100644
--- a/infrastructure/docker/build/Dockerfile-traffic_stats
+++ b/infrastructure/docker/build/Dockerfile-traffic_stats
@@ -45,7 +45,6 @@ RUN go_version=$(cat /GO_VERSION) && \
 
 ###
 
-ADD build/clean_build.sh /
-CMD /clean_build.sh traffic_stats
+CMD /trafficcontrol/build/clean_build.sh traffic_stats
 
 # vi:syntax=Dockerfile

Reply via email to