1
0
mirror of https://github.com/rlister/dockerfiles.git synced 2025-12-12 17:26:15 +00:00

add github-copy

This commit is contained in:
Richard Lister
2015-01-21 00:43:08 -05:00
parent 6d385c852b
commit b250874828
2 changed files with 26 additions and 0 deletions

10
github-copy/Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM radial/busyboxplus:curl
MAINTAINER Ric Lister, rlister@gmail.com
WORKDIR /app
ADD ghcp.sh /app/
RUN chmod 0755 ghcp.sh
ENTRYPOINT [ "/app/ghcp.sh" ]

16
github-copy/ghcp.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
## loop each pair of args as a src path and dest dir
while [ $# -gt 0 ]
do
src=$1; shift
dest=$1; shift
mkdir -p "$dest"
(
cd "$dest" && \
/usr/bin/curl -sOL \
-H "Authorization: token $TOKEN" \
-H 'Accept: application/vnd.github.v3.raw' \
"https://api.github.com/repos/${REPO}/contents/${src}"
)
done