Skip to content

Commit

Permalink
Mirror Forge files in forgemaven
Browse files Browse the repository at this point in the history
  • Loading branch information
peterix committed Nov 15, 2021
1 parent 1645c72 commit dbce0b2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
http_cache
multimc
upstream
forgemaven
forge_cache
__pycache__
*.kdev4
config_local.sh
config_local.sh
5 changes: 5 additions & 0 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ export DEPLOY_FOLDER_master=/var/www/meta/v1/
export DEPLOY_FOLDER_develop=/var/www/meta/dev/
export DEPLOY_FOLDER_USER=http
export DEPLOY_FOLDER_GROUP=http

export UPDATE_FORGE_MAVEN=true
export DEPLOY_FORGE_MAVEN=false
export DEPLOY_FORGE_MAVEN_S3=false
export S3_FORGE_MAVEN=s3://forgemaven.multimc.org/
4 changes: 2 additions & 2 deletions enumerateForge.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ def GetLibraryDownload (library : MultiMCLibrary):

for entry in urlSet:
libraryName = entry.name
folderPath = "maven/%s" % libraryName.getBase()
filePath = "maven/%s" % libraryName.getPath()
folderPath = "forgemaven/%s" % libraryName.getBase()
filePath = "forgemaven/%s" % libraryName.getPath()
if not os.path.isfile(filePath):
os.makedirs(folderPath, exist_ok=True)
rfile = sess.get(entry.url, stream=True)
Expand Down
11 changes: 11 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ if [ "${DEPLOY_TO_GIT}" = true ] ; then
fi
fi

if [ "${UPDATE_FORGE_MAVEN}" = true ] ; then
echo "Updating the copy of Forge maven"
./enumerateForge.py
if [ "${DEPLOY_FORGE_MAVEN}" = true ] ; then
chown -RL ${DEPLOY_FOLDER_USER}:${DEPLOY_FOLDER_GROUP} ${BASEDIR}/forgemaven/
if [ "${DEPLOY_FORGE_MAVEN_S3}" = true ] ; then
s3cmd -c ${BASEDIR}/config/s3cmd.cfg --exclude=".git*" --delete-removed sync ${BASEDIR}/forgemaven/ ${S3_FORGE_MAVEN} || exit 2
fi
fi
fi

cd "${BASEDIR}"
if [ "${DEPLOY_TO_FOLDER}" = true ] ; then
DEPLOY_FOLDER_var="DEPLOY_FOLDER_$MODE"
Expand Down

0 comments on commit dbce0b2

Please sign in to comment.