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:
10
github-copy/Dockerfile
Normal file
10
github-copy/Dockerfile
Normal 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
16
github-copy/ghcp.sh
Normal 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
|
||||
Reference in New Issue
Block a user