Skip to content

Commit 274a040

Browse files
author
Wang, Gang(Gary)
committed
MNEMONIC-264: Add option to suppress the confirmation for Docker build
1 parent cdde2b2 commit 274a040

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

build-tools/runall.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818
#
19+
ARGCONFIRMED=false
20+
21+
while getopts ":y" opt; do
22+
case $opt in
23+
y)
24+
ARGCONFIRMED=true
25+
;;
26+
\?)
27+
echo "Invalid option: -$OPTARG" >&2
28+
;;
29+
esac
30+
done
1931

2032
continueprompt() {
2133
while true; do
@@ -35,7 +47,13 @@ fi
3547
pushd "$MNEMONIC_HOME" || { echo "the environment variable \$MNEMONIC_HOME contains invalid home directory of Mnemonic project."; exit 11; }
3648

3749
echo [INFO] Cleaning up and re-building...
38-
git ls-files --error-unmatch pom.xml > /dev/null 2>&1 && continueprompt "Please make sure all source codes have already been checked in or backed up otherwise un-checked files would be purged" && git clean -xdf > /dev/null
50+
git ls-files --error-unmatch pom.xml > /dev/null 2>&1; rc=$?
51+
if [[ $rc == 0 ]]; then
52+
if [[ "$ARGCONFIRMED" == "false" ]]; then
53+
continueprompt "Please make sure all source codes have already been checked in or backed up otherwise un-checked files would be purged"
54+
fi
55+
git clean -xdf > /dev/null
56+
fi
3957

4058
if [ ! -d "testlog" ]
4159
then

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ RUN cd /ws && git clone https://github.com/apache/incubator-mnemonic.git && \
6666

6767
ENV MNEMONIC_HOME /ws/incubator-mnemonic
6868

69-
RUN cd /ws/incubator-mnemonic && build-tools/runall.sh
69+
RUN cd /ws/incubator-mnemonic && build-tools/runall.sh -y
7070

7171
WORKDIR /ws
7272
CMD ["bash"]

0 commit comments

Comments
 (0)