From e581ed66c85cf80aa67c6f3adc5ebb7034d62a28 Mon Sep 17 00:00:00 2001 From: Richard Lister Date: Mon, 9 Feb 2015 14:14:23 -0500 Subject: [PATCH] rename script and add ghcat --- github-copy/Dockerfile | 8 +++++--- github-copy/ghcat | 10 ++++++++++ github-copy/{ghcp.sh => ghcp} | 0 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 github-copy/ghcat rename github-copy/{ghcp.sh => ghcp} (100%) 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