mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
updating forgeapi tests and adding is false (#1548)
Co-authored-by: christopher blodgett <christopher.blodgett@gmail.com>
This commit is contained in:
parent
1fb04c069c
commit
4f9de809f8
@ -118,7 +118,7 @@ modFileByProjectID(){
|
||||
# Looks for file by name
|
||||
current_project_file=$(jq -n "$project_files" | jq --arg FILE_NAME "$project_id_file_name" -jc '
|
||||
.data | map(select(.fileName<=($FILE_NAME))) | .[0] // empty')
|
||||
elif $( ! isTrue "$MODS_FORGEAPI_IGNORE_GAMETYPE" ) && $FILTER_BY_FAMILY ; then
|
||||
elif isFalse "${MODS_FORGEAPI_IGNORE_GAMETYPE}" && $FILTER_BY_FAMILY ; then
|
||||
# Looks for file by version and server type in lowercase
|
||||
current_project_file=$(jq -n "$project_files" | jq --arg RELEASE_FILTER "$RELEASE_NUMBER_FILTER" --arg GAME_TYPE "${FAMILY,,}" --arg VERSION "$VANILLA_VERSION" -jc '
|
||||
.data | sort_by(.id) | reverse | map(select(.gameVersions[] | ascii_downcase | contains ($GAME_TYPE))) | map(select(.gameVersions[] | contains ($VERSION))) | map(select(.releaseType<=($RELEASE_FILTER|tonumber))) | .[0] // empty')
|
||||
@ -160,7 +160,7 @@ downloadModPackfromModFile() {
|
||||
fi
|
||||
# trys to make the output directory incase it doesnt exist.
|
||||
mkdir -p "$out_dir"
|
||||
|
||||
debug "DEBUG: PROJECT_FILE: ${PROJECT_FILE}"
|
||||
# grabs needed values from our json return
|
||||
file_name=$(jq -n "$PROJECT_FILE" | jq -jc '.fileName // empty' )
|
||||
download_url=$(jq -n "$PROJECT_FILE" | jq -jc '.downloadUrl // empty' )
|
||||
@ -204,9 +204,10 @@ if [ "$MODS_FORGEAPI_FILE" ] && [ -z "$MODS_FORGEAPI_PROJECTIDS" ]; then
|
||||
log "ERROR: given MODS_FORGEAPI_FILE file does not exist"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
debug "DEBUG: MODS_FORGEAPI_KEY: ${MODS_FORGEAPI_FILE}"
|
||||
# Needs loop here to look up release types befor calling download.
|
||||
while read -r current_project; do
|
||||
debug "DEBUG: current_project: ${current_project}"
|
||||
# Per stack overflow we can use //empty to return empty string that works with -z
|
||||
project_id=$(jq -n "$current_project" | jq -r '.projectId // empty' )
|
||||
current_release_type=$(jq -n "$current_project" | jq -r '.releaseType // empty' )
|
||||
|
@ -66,6 +66,28 @@ function isTrue() {
|
||||
return ${result}
|
||||
}
|
||||
|
||||
function isFalse() {
|
||||
local oldState
|
||||
oldState=$(shopt -po xtrace)
|
||||
shopt -u -o xtrace
|
||||
|
||||
local value=${1,,}
|
||||
|
||||
result=
|
||||
|
||||
case ${value} in
|
||||
false | off)
|
||||
result=0
|
||||
;;
|
||||
*)
|
||||
result=1
|
||||
;;
|
||||
esac
|
||||
|
||||
eval "$oldState"
|
||||
return ${result}
|
||||
}
|
||||
|
||||
function isDebugging() {
|
||||
if isTrue "${DEBUG:-false}"; then
|
||||
return 0
|
||||
|
@ -7,6 +7,7 @@ services:
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
SETUP_ONLY: "TRUE"
|
||||
DEBUG: "FALSE"
|
||||
# Using custom to bypass Fabric setup
|
||||
TYPE: CUSTOM
|
||||
# Using family to test FORGEAPI Family filter.
|
@ -1,11 +1,11 @@
|
||||
[{
|
||||
"name": "On A Stick [FABRIC]",
|
||||
"projectId": "550544",
|
||||
"releaseType": "release"
|
||||
},
|
||||
{
|
||||
"name": "Fabric Voice Mod",
|
||||
"projectId": "416089",
|
||||
"releaseType": "beta"
|
||||
}
|
||||
[
|
||||
{
|
||||
"name": "Flan (Land Claim Tool)",
|
||||
"projectId": "404578"
|
||||
},
|
||||
{
|
||||
"name": "Fabric Voice Mod",
|
||||
"projectId": "416089",
|
||||
"releaseType": "beta"
|
||||
}
|
||||
]
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Validates specific beta call out for specific mod:
|
||||
mc-image-helper assert fileExists "/data/mods/voicechat-fabric*"
|
||||
mc-image-helper assert fileExists "/data/mods/onastick-fabric*"
|
||||
# Dependent of on a stick:
|
||||
mc-image-helper assert fileExists "/data/mods/flan*"
|
||||
# Dependent of flan:
|
||||
mc-image-helper assert fileExists "/data/mods/fabric-api*"
|
||||
|
@ -7,6 +7,7 @@ services:
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
SETUP_ONLY: "TRUE"
|
||||
DEBUG: "FALSE"
|
||||
# Using custom to bypass Fabric setup
|
||||
TYPE: CUSTOM
|
||||
# Using family to test FORGEAPI Family filter.
|
||||
@ -17,13 +18,13 @@ services:
|
||||
MODS_FORGEAPI_IGNORE_GAMETYPE: "TRUE"
|
||||
# Validates that Biomes does not download terrablender
|
||||
# Using default false for testing:
|
||||
# MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES: "FALSE"
|
||||
MODS_FORGEAPI_DOWNLOAD_DEPENDENCIES: "FALSE"
|
||||
# Contains mix of Forge and Fabric mods
|
||||
MODS_FORGEAPI_PROJECTIDS: 306612,416089,220318
|
||||
MODS_FORGEAPI_PROJECTIDS: 416089,493246
|
||||
# Allows for Beta releases of 416089 the Fabric Voice Mod
|
||||
MODS_FORGEAPI_RELEASES: BETA
|
||||
MODS_FORGEAPI_KEY: ${MODS_FORGEAPI_KEY}
|
||||
REMOVE_OLD_FORGEAPI_MODS: "FALSE"
|
||||
REMOVE_OLD_FORGEAPI_MODS: "TRUE"
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- ./fake.jar:/servers/fake.jar
|
@ -1,5 +1,5 @@
|
||||
mc-image-helper assert fileExists "/data/mods/BiomesOPlenty*"
|
||||
# testing dependencies don't get downloaded when download dependencies is set to false.
|
||||
! mc-image-helper assert fileExists "/data/mods/TerraBlender*"
|
||||
mc-image-helper assert fileExists "/data/mods/voicechat-fabric*"
|
||||
mc-image-helper assert fileExists "/data/mods/fabric-api*"
|
||||
mc-image-helper assert fileExists "/data/mods/flan*"
|
||||
# Dependent of flan, but dependencies are set to false:
|
||||
! mc-image-helper assert fileExists "/data/mods/fabric-api*"
|
||||
|
Loading…
Reference in New Issue
Block a user