[PATCH compass-ci 1/4] container: consider the situation that GITCACHE_HOST is undefined

Error Msg: Step 5/12 : RUN [ -n "$GITCACCACHE_PORT:-5000}/\"]\n\tinsteadOf = https://" >> /etc/gitconfig ---> Running in 52ffe9f8ecd1 The command '/bin/sh -c [ -n "$GITCACHE_HOST" ] && echo -e "[url\"http://$GITCACHE_HOST:${GITCACHE_PORT:-5000}/\"]\n\tinsteadOf = https://" >> /etc/gitconfig' reton-zero code: 1 Signed-off-by: Hu XueJiao <huxuejiao1@huawei.com> --- container/crystal-shards/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/crystal-shards/Dockerfile b/container/crystal-shards/Dockerfile index 0c5713c..bdc5b66 100644 --- a/container/crystal-shards/Dockerfile +++ b/container/crystal-shards/Dockerfile @@ -7,7 +7,7 @@ MAINTAINER chief <taxcom@tom.com> ARG GITCACHE_HOST ARG GITCACHE_PORT -RUN [ -n "$GITCACHE_HOST" ] && echo -e "[url \"http://$GITCACHE_HOST:${GITCACHE_PORT:-5000}/\"]\n\tinsteadOf = https://" >> /etc/gitconfig +RUN [ -z "$GITCACHE_HOST" ] || echo -e "[url \"http://$GITCACHE_HOST:${GITCACHE_PORT:-5000}/\"]\n\tinsteadOf = https://" >> /etc/gitconfig copy shard.yml /usr/share/crystal/app/shard.yml -- 2.23.0

On Tue, Sep 29, 2020 at 06:27:06PM +0800, Hu Xuejiao wrote:
Error Msg: Step 5/12 : RUN [ -n "$GITCACCACHE_PORT:-5000}/\"]\n\tinsteadOf = https://" >> /etc/gitconfig ---> Running in 52ffe9f8ecd1 The command '/bin/sh -c [ -n "$GITCACHE_HOST" ] && echo -e "[url\"http://$GITCACHE_HOST:${GITCACHE_PORT:-5000}/\"]\n\tinsteadOf = https://" >> /etc/gitconfig' reton-zero code: 1
Better include Yuchuan's reasoning here. Thanks, Fengguang
participants (2)
-
Hu Xuejiao
-
Wu Fengguang