Skip to content

Commit

Permalink
Dispatch script for the kubernetes container
Browse files Browse the repository at this point in the history
  • Loading branch information
gousiosg committed Dec 19, 2019
1 parent 586402a commit 3cc5b3a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
33 changes: 33 additions & 0 deletions bin/docker-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

usage()
{
cat <<EOF 1>&2
Usage: $0 [command] <args>
Dispatch to a GHTorrent data retrieval operation
[command] can be one of: events, data-retrival, load
<args> 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 $@

0 comments on commit 3cc5b3a

Please sign in to comment.