4 # Licensed under the Apache License 2.0
5 # SPDX-License-Identifier: Apache-2.0
7 # Build script to create c2m container.
13 if [[ -z "${http_proxy}" ]]; then
14 echo "http_proxy is empty"
16 echo "http_proxy is set to $http_proxy"
18 if [[ $http_proxy =~ ^http:\/\/[0-9] ]]; then
19 echo "starts with http"
21 elif [[ $http_proxy =~ ^[0-9] ]]; then
22 echo "starts with number"
23 proxy=http://$http_proxy
25 echo "Acquire::http::Proxy \"${proxy}\";" > proxy.conf
28 echo "Proxy set to $proxy, build env is $build_env."
30 docker build --no-cache --build-arg http_proxy=$proxy --build-arg https_proxy=$proxy --build-arg build_env=$build_env -t c2m:latest -t c2m:`git log -1 --format=%h` . || echo "Build failed."