Skip to content

Commit

Permalink
rubygems: Fetch versions file from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed Aug 13, 2024
1 parent cf8884e commit 0b9dff1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rubygems/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ustcmirror/base:alpine
LABEL maintainer="Yifan Gao <[email protected]>"
ENV UPSTREAM=http://rubygems.org
ENV UPSTREAM=https://rubygems.org
RUN apk add --no-cache ruby ca-certificates && \
gem install --no-document rubygems-mirror
ADD sync.sh pre-sync.sh /
9 changes: 9 additions & 0 deletions rubygems/sync.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -x

export HOME=/root
cat << EOF > /root/.gem/.mirrorrc
---
Expand All @@ -10,4 +12,11 @@ cat << EOF > /root/.gem/.mirrorrc
delete: false
skiperror: true
EOF

# Fetch index
wget -qO "$TO/versions.new" "$UPSTREAM/versions"
md5sum "$TO/versions.new" > "$TO/versions.md5sum.new"
mv -f "$TO/versions.new" "$TO/versions"
mv -f "$TO/versions.md5sum.new" "$TO/versions.md5sum"

exec gem mirror

0 comments on commit 0b9dff1

Please sign in to comment.