diff --git a/Dockerfile b/Dockerfile index 5d00cde..9ed1e07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,5 @@ COPY Gemfile ghtorrent.gemspec ./ghtorrent/ COPY lib/ ./ghtorrent/lib/ COPY bin/ ./ghtorrent/bin RUN cd ghtorrent && bundle install --without development test -RUN cd ghtorrent && gem install sqlite3 -CMD /usr/bin/env bash -#ENTRYPOINT ["/usr/local/bin/ruby", "-I/ghtorrent/lib", "/ghtorrent/bin/ght-retrieve-repo"] +ENTRYPOINT ["/ghtorrent/bin/docker-init.sh"] diff --git a/bin/docker-init.sh b/bin/docker-init.sh new file mode 100755 index 0000000..5a46513 --- /dev/null +++ b/bin/docker-init.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +usage() +{ +cat <&2 +Usage: $0 [command] + +Dispatch to a GHTorrent data retrieval operation + +[command] can be one of: events, data-retrival, load + are passed verbatim to the dispatched program +EOF +} + +cmd="" +case $1 in + events) + cmd="/usr/local/bin/ruby -I/ghtorrent/lib/ /ghtorrent/bin/ght-mirror-events" + ;; + data-retrieval) + cmd="/usr/local/bin/ruby -I/ghtorrent/lib/ /ghtorrent/bin/ght-data-retrieval" + ;; + load) + cmd="/usr/local/bin/ruby -I/ghtorrent/lib/ /ghtorrent/bin/ght-load" + ;; + *) + usage + ;; +esac + +shift + +$cmd $@