mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 04:12:42 +00:00
update rubygems and the Dockerfile for rubygems
This commit is contained in:
parent
d14fbb732b
commit
a8426387fc
4
dockerfiles/rubygems/Dockerfile
Normal file
4
dockerfiles/rubygems/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
||||
FROM cybercode/alpine-ruby:2.3
|
||||
RUN gem install rubygems-mirror
|
||||
ENV BUSYBOX=1
|
||||
volume /data
|
36
rubygems.sh
36
rubygems.sh
@ -6,6 +6,7 @@ CONF="$HOME/.gem/.mirrorrc"
|
||||
mkdir -p "$HOME/.gem"
|
||||
|
||||
INIT=${INIT:-"0"}
|
||||
BUSYBOX=${BUSYBOX:-"0"}
|
||||
|
||||
if [ ! -d "$TUNASYNC_WORKING_DIR" ]; then
|
||||
mkdir -p $TUNASYNC_WORKING_DIR
|
||||
@ -14,8 +15,6 @@ fi
|
||||
|
||||
echo "Syncing to $TUNASYNC_WORKING_DIR"
|
||||
|
||||
if [[ $INIT == "0" ]]; then
|
||||
|
||||
cat > $CONF << EOF
|
||||
---
|
||||
- from: https://rubygems.org
|
||||
@ -26,24 +25,19 @@ if [[ $INIT == "0" ]]; then
|
||||
skiperror: true
|
||||
EOF
|
||||
|
||||
/usr/bin/timeout -s INT 7200 $GEM mirror
|
||||
if [[ $? == 124 ]]; then
|
||||
echo 'Sync timeout (/_\\)'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $INT == "0" ]]; then
|
||||
if [[ $BUSYBOX == "0" ]]; then
|
||||
timeout -t 7200 -s INT $GEM mirror -V
|
||||
else
|
||||
|
||||
cat > $CONF << EOF
|
||||
---
|
||||
- from: https://rubygems.org
|
||||
to: ${TUNASYNC_WORKING_DIR}
|
||||
parallelism: 10
|
||||
retries: 2
|
||||
delete: true
|
||||
skiperror: true
|
||||
EOF
|
||||
|
||||
$GEM mirror
|
||||
|
||||
timeout -s INT 7200 $GEM mirror -V
|
||||
fi
|
||||
else
|
||||
$GEM mirror -V
|
||||
fi
|
||||
|
||||
ret=$?
|
||||
if [[ $ret == 124 ]]; then
|
||||
echo 'Sync timeout (/_\\)'
|
||||
fi
|
||||
|
||||
exit $ret
|
||||
|
Loading…
x
Reference in New Issue
Block a user