Signed-off-by: Cao Xueliang caoxl78320@163.com --- container/crystal-shards/Dockerfile | 7 +++++-- container/crystal-shards/git | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100755 container/crystal-shards/git
diff --git a/container/crystal-shards/Dockerfile b/container/crystal-shards/Dockerfile index 2311554..15fe523 100644 --- a/container/crystal-shards/Dockerfile +++ b/container/crystal-shards/Dockerfile @@ -5,7 +5,10 @@ FROM alpine:crystal-base
MAINTAINER chief taxcom@tom.com
-copy shard.yml /usr/share/crystal/app/shard.yml +COPY git /usr/local/sbin/git +RUN echo -e "[url "git://"]\n\tinsteadOf = https://" >> /etc/gitconfig + +COPY shard.yml /usr/share/crystal/app/shard.yml
WORKDIR /usr/share/crystal/app RUN shards @@ -14,7 +17,7 @@ sed -i '99s/arguments[:id]/arguments[:id]?/' /usr/share/crystal/app/lib/elast sed -i 's/, Utils.__listify(arguments[:q].as(String))/ /' /usr/share/crystal/app/lib/elasticsearch-crystal/src/elasticsearch/api/actions/search.cr;\ sed -i '205a \ params.clear' /usr/share/crystal/app/lib/elasticsearch-crystal/src/elasticsearch/api/actions/search.cr;
-copy shard-amqp.yml /usr/share/crystal/app/shard.yml +COPY shard-amqp.yml /usr/share/crystal/app/shard.yml RUN shards
CMD ["bash"] diff --git a/container/crystal-shards/git b/container/crystal-shards/git new file mode 100755 index 0000000..7bb0b85 --- /dev/null +++ b/container/crystal-shards/git @@ -0,0 +1,7 @@ +#!/bin/bash + +if [[ "$*" = "ls-remote --get-url origin" ]]; then + /usr/bin/git "$@" | sed 's|git://|https://%7Cg' +else + /usr/bin/git "$@" +fi