2021-05-22 00:07:13 -05:00
|
|
|
#! /bin/bash
|
|
|
|
#
|
|
|
|
# Build the Docker image for a series of different Forge versions
|
|
|
|
#
|
|
|
|
|
|
|
|
# MC version list
|
|
|
|
declare -a mcversions=(
|
|
|
|
"1.16.5"
|
|
|
|
)
|
|
|
|
|
|
|
|
# Forge version dictionary (we only support one version per)
|
|
|
|
declare -A forgeversions=(
|
2021-12-20 12:26:22 -06:00
|
|
|
["1.16.5"]="36.2.22"
|
2021-05-22 00:07:13 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
# Build images
|
|
|
|
docker buildx create --use
|
|
|
|
for mc in ${mcversions[@]}; do
|
|
|
|
forge="${forgeversions[$mc]}"
|
|
|
|
echo "Building image for Minecraft $mc, Forge $forge, CI_COMMIT_REF_NAME of $CI_COMMIT_REF_NAME"
|
2021-05-22 00:14:16 -05:00
|
|
|
# --no-cache is required for clean builds
|
2021-05-22 00:07:13 -05:00
|
|
|
docker buildx build \
|
2021-05-22 00:14:16 -05:00
|
|
|
--build-arg MINECRAFT_VERSION="$mc" \
|
|
|
|
--build-arg FORGE_VERSION="$forge" \
|
|
|
|
--no-cache \
|
2021-05-22 00:07:13 -05:00
|
|
|
--platform linux/amd64 \
|
|
|
|
--tag "$CI_HUB_USERNAME/$CI_PROJECT_NAME:$mc-$forge-${CI_COMMIT_REF_NAME:=bleeding}" \
|
|
|
|
--push \
|
|
|
|
.
|
|
|
|
done
|
|
|
|
docker images
|