diff --git a/github-copy/Dockerfile b/github-copy/Dockerfile index 3e99d99..1342b2c 100644 --- a/github-copy/Dockerfile +++ b/github-copy/Dockerfile @@ -4,7 +4,9 @@ MAINTAINER Ric Lister, rlister@gmail.com WORKDIR /app -ADD ghcp.sh /app/ -RUN chmod 0755 ghcp.sh +ADD ghcp /app/ +RUN chmod 0755 ghcp +ADD ghcat /app/ +RUN chmod 0755 ghcat -ENTRYPOINT [ "/app/ghcp.sh" ] +ENTRYPOINT [ "/app/ghcp" ] diff --git a/github-copy/ghcat b/github-copy/ghcat new file mode 100644 index 0000000..d063d76 --- /dev/null +++ b/github-copy/ghcat @@ -0,0 +1,10 @@ +#!/bin/sh + +## simply cat all remote files to stdout +for src in $* +do + /usr/bin/curl -sL \ + -H "Authorization: token $TOKEN" \ + -H 'Accept: application/vnd.github.v3.raw' \ + "https://api.github.com/repos/${REPO}/contents/${src}" +done diff --git a/github-copy/ghcp.sh b/github-copy/ghcp similarity index 100% rename from github-copy/ghcp.sh rename to github-copy/ghcp