Compare commits

...

22 Commits

Author SHA1 Message Date
Geoff Bourne
bfdb5c075b Auto-merging via docker-versions-create 2020-06-19 13:26:45 -05:00
Geoff Bourne
2ee5a25c91 ci: adjusted main github action name 2020-06-19 13:23:05 -05:00
Geoff Bourne
60ef1b8867 ci: fixed github action tags matching 2020-06-19 13:15:23 -05:00
Geoff Bourne
3eaf756aa2 ci: adjusted github actions to build non-multiarch branches/tags 2020-06-19 11:41:53 -05:00
Geoff Bourne
bc318fa185 Added support for Mohist servers 2020-06-19 11:31:56 -05:00
Geoff Bourne
f93c42a23f Added support for tagging during docker-versions-create.sh 2020-06-19 11:31:41 -05:00
Geoff Bourne
f5dde77efe Enabled iterative development with SCRIPTS var 2020-06-19 11:05:32 -05:00
Geoff Bourne
bd4a184ad7 Auto-merging via docker-versions-create 2020-05-20 08:14:52 -05:00
Geoff Bourne
156786dacf Auto-merging via docker-versions-create 2020-05-02 09:34:17 -05:00
Geoff Bourne
92186c9c8e Auto-merging via docker-versions-create 2020-04-25 12:10:54 -05:00
Geoff Bourne
74ee8a621c Auto-merging via docker-versions-create 2020-04-17 21:28:57 -05:00
Geoff Bourne
64345b0d82 Auto-merging via docker-versions-create 2020-04-11 08:51:46 -05:00
Geoff Bourne
5b45c4ea4e Auto-merging via docker-versions-create 2020-04-10 11:08:53 -05:00
Geoff Bourne
a15e608421 Auto-merging via docker-versions-create 2020-04-03 13:31:40 -05:00
Geoff Bourne
f4561b7a3b Auto-merging via docker-versions-create 2020-04-03 13:28:52 -05:00
Geoff Bourne
c6f0042686 Auto-merging via docker-versions-create 2020-04-02 17:47:41 -05:00
Geoff Bourne
79aabf82ff Auto-merging via docker-versions-create 2020-03-30 08:32:02 -05:00
Geoff Bourne
89b60c7706 Auto-merging via docker-versions-create 2020-03-26 20:54:13 -05:00
Geoff Bourne
4b4cbdfce1 Auto-merging via docker-versions-create 2020-02-01 08:53:03 -06:00
Geoff Bourne
a424346d0c Auto-merging via docker-versions-create 2020-01-17 08:29:12 -06:00
Geoff Bourne
fad48505d7 Auto-merging via docker-versions-create 2019-11-16 09:31:01 -06:00
Geoff Bourne
a535fb7873 Add adoptopenjdk/openjdk11:alpine-jre variant 2019-11-16 09:09:55 -06:00
28 changed files with 179 additions and 56 deletions

View File

@@ -1,10 +1,21 @@
# This is a basic workflow to help you get started with Actions
name: build
name: Build non-multiarch branches/tags
on:
push:
branches: [ master ]
branches:
- master
- openj9
- openj9-nightly
- adopt11
- adopt13
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-openj9"
- "[0-9]+.[0-9]+.[0-9]+-openj9-nightly"
- "[0-9]+.[0-9]+.[0-9]+-adopt11"
- "[0-9]+.[0-9]+.[0-9]+-adopt13"
pull_request:
branches: [ master ]

28
DEVELOPMENT.md Normal file
View File

@@ -0,0 +1,28 @@
Individual scripts can be iteratively developed and tested using the following procedure.
First, build a baseline of the image to include the packages needed by existing or new scripts:
```shell script
docker build -t mc-dev .
```
Using the baseline image, an interactive container can be started to iteratively run the scripts to be developed. By attaching the current workspace directory, you can use the local editor of your choice to iteratively modify scripts while using the container to run them.
```shell script
docker run -it --rm -v ${PWD}:/scripts -e SCRIPTS=/scripts/ --entrypoint bash mc-dev
```
From within the container you can run individual scripts via the attached `/scripts/` path; however, be sure to set any environment variables expected by the scripts by either `export`ing them manually:
```shell script
export VANILLA_VERSION=1.12.2
/scripts/start-magma
```
...or pre-pending script execution:
```shell script
VANILLA_VERSION=1.12.2 /scripts/start-magma
```
> NOTE: You may want to temporarily add an `exit` statement near the end of your script to isolate execution to just the script you're developing.

View File

@@ -1,4 +1,4 @@
FROM openjdk:8u212-jre-alpine
FROM adoptopenjdk/openjdk11:alpine-jre
LABEL maintainer "itzg"

View File

@@ -525,6 +525,15 @@ A [Magma](https://magmafoundation.org/) server, which is a combination of Forge
> **NOTE** there are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2"
## Running a Mohist server
A [Mohist](https://github.com/Mohist-Community/Mohist) server can be used with
-e TYPE=MOHIST
> **NOTE** there are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2"
## Running a server with a Feed the Beast modpack
> **NOTE** requires `itzg/minecraft-server:multiarch` image

View File

@@ -10,12 +10,28 @@ function TrapExit {
batchMode=false
while getopts "b" arg
while getopts "hbt:" arg
do
case $arg in
b)
batchMode=true
;;
t)
tag=${OPTARG}
;;
h)
echo "
Usage $0 [options]
Options:
-b enable batch mode, which avoids interactive prompts and causes script to fail immediately
when any merge fails
-t TAG tag and push the current revision on master with the given tag
and apply respective tags to each branch
-h display this help and exit
"
exit
;;
*)
echo "Unsupported arg $arg"
exit 2
@@ -34,6 +50,10 @@ test -d ./.git || { echo ".git folder was not found. Please start this script fr
git checkout master
git pull --all || { echo "Can't pull the repo!"; \
exit 1; }
if [[ $tag ]]; then
git tag $tag
git push origin $tag
fi
git_branches=$(git branch -a)
@@ -57,6 +77,10 @@ for branch in "${branches_list[@]}"; do
git commit -m "Auto merge branch with master" -a
# push may fail if remote doesn't have this branch yet. In this case - sending branch
git push || git push -u origin "$branch" || { echo "Can't push changes to the origin."; exit 1; }
if [[ $tag ]]; then
git tag "$tag-$branch"
git push origin "$tag-$branch"
fi
elif ${batchMode}; then
status=$?
echo "Git merge failed in batch mode"

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
if isTrue "${ENABLE_AUTOPAUSE}" && [[ "$( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }')" =~ ^T.*$ ]]; then
echo "Java process suspended by Autopause function"

6
start
View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
umask 0002
chmod g+w /data
@@ -45,7 +45,7 @@ if [ $(id -u) = 0 ]; then
echo 'hosts: files dns' > /etc/nsswitch.conf
fi
exec su-exec ${runAsUser}:${runAsGroup} /start-configuration $@
exec su-exec ${runAsUser}:${runAsGroup} ${SCRIPTS:-/}start-configuration $@
else
exec /start-configuration $@
exec ${SCRIPTS:-/}start-configuration $@
fi

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
log "Autopause functionality enabled"

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
shopt -s nullglob
@@ -69,53 +69,57 @@ cd /data || exit 1
export ORIGINAL_TYPE=${TYPE^^}
if isTrue "${ENABLE_AUTOPAUSE}"; then
/start-autopause
${SCRIPTS:-/}start-autopause
fi
log "Resolving type given ${TYPE}"
case "${TYPE^^}" in
*BUKKIT|SPIGOT)
exec /start-deployBukkitSpigot "$@"
exec ${SCRIPTS:-/}start-deployBukkitSpigot "$@"
;;
PAPER)
exec /start-deployPaper "$@"
exec ${SCRIPTS:-/}start-deployPaper "$@"
;;
TUINITY)
exec /start-deployTuinity "$@"
exec ${SCRIPTS:-/}start-deployTuinity "$@"
;;
FORGE)
exec /start-deployForge "$@"
exec ${SCRIPTS:-/}start-deployForge "$@"
;;
FABRIC)
exec /start-deployFabric "$@"
exec ${SCRIPTS:-/}start-deployFabric "$@"
;;
FTB|CURSEFORGE)
exec /start-deployFTB "$@"
exec ${SCRIPTS:-/}start-deployFTB "$@"
;;
VANILLA)
exec /start-deployVanilla "$@"
exec ${SCRIPTS:-/}start-deployVanilla "$@"
;;
SPONGEVANILLA)
exec /start-deploySpongeVanilla "$@"
exec ${SCRIPTS:-/}start-deploySpongeVanilla "$@"
;;
CUSTOM)
exec /start-deployCustom "$@"
exec ${SCRIPTS:-/}start-deployCustom "$@"
;;
CURSE_INSTANCE)
exec /start-validateCurseInstance "$@"
exec ${SCRIPTS:-/}start-validateCurseInstance "$@"
;;
MAGMA)
exec /start-magma "$@"
exec ${SCRIPTS:-/}start-magma "$@"
;;
MOHIST)
exec ${SCRIPTS:-/}start-mohist "$@"
;;
*)

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
set -e
@@ -102,4 +102,4 @@ export TYPE=SPIGOT
export SKIP_LOG4J_CONFIG=true
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-finalSetup01World $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
if isURL ${CUSTOM_SERVER}; then
filename=$(basename ${CUSTOM_SERVER})
@@ -28,4 +28,4 @@ fi
export SKIP_LOG4J_CONFIG=true
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-finalSetup01World $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
export FTB_BASE_DIR=/data/FeedTheBeast
legacyJavaFixerUrl=http://ftb.cursecdn.com/FTB2/maven/net/minecraftforge/lex/legacyjavafixer/1.0/legacyjavafixer-1.0.jar
@@ -135,4 +135,4 @@ elif [ -e "${FTB_DIR}/Install.sh" ]; then
fi
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-finalSetup01World $@

View File

@@ -1,7 +1,7 @@
#!/bin/bash
set -eu
. /start-utils
. ${SCRIPTS:-/}start-utils
export TYPE=FABRIC
@@ -75,4 +75,4 @@ else
fi
# Contineut to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-finalSetup01World $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
export TYPE=FORGE
@@ -113,4 +113,4 @@ else
fi
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-finalSetup01World $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
: ${PAPERBUILD:=latest}
export SERVER=paper_server-${VANILLA_VERSION}-${PAPERBUILD}.jar
@@ -20,4 +20,4 @@ export TYPE=SPIGOT
export SKIP_LOG4J_CONFIG=true
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-finalSetup01World $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
export TYPE=spongevanilla
@@ -36,4 +36,4 @@ if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
fi
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-finalSetup01World $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
if [ "${VERSION}" != "LATEST" ]; then
log "ERROR: Tunity server type only supports VERSION=LATEST"
@@ -24,4 +24,4 @@ fi
export TYPE=SPIGOT
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-finalSetup01World $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
isDebugging && set -x
set -o pipefail
@@ -43,4 +43,4 @@ fi
isDebugging && ls -l
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-finalSetup01World $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
set -e
isDebugging && set -x
@@ -51,4 +51,4 @@ if [[ "$WORLD" ]] && [ ! -d "$worldDest" ]; then
fi
fi
exec /start-finalSetup02Modpack $@
exec ${SCRIPTS:-/}start-finalSetup02Modpack $@

View File

@@ -2,7 +2,7 @@
set -e
. /start-utils
. ${SCRIPTS:-/}start-utils
# CURSE_URL_BASE used in manifest downloads below
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
@@ -154,4 +154,4 @@ if [[ "${GENERIC_PACK}" ]]; then
fi
fi
exec /start-finalSetup03Modconfig $@
exec ${SCRIPTS:-/}start-finalSetup03Modconfig $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
# If supplied with a URL for a config (simple zip of configurations), download it and unpack
if [[ "$MODCONFIG" ]]; then
@@ -24,4 +24,4 @@ case "X$MODCONFIG" in
esac
fi
exec /start-finalSetup04ServerProperties $@
exec ${SCRIPTS:-/}start-finalSetup04ServerProperties $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
# FUNCTIONS
function setServerProp {
@@ -194,4 +194,4 @@ if isDebugging; then
cat /data/server.properties
fi
exec /start-finalSetup05EnvVariables $@
exec ${SCRIPTS:-/}start-finalSetup05EnvVariables $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
if [ "${REPLACE_ENV_VARIABLES^^}" = "TRUE" ]; then
log "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX..."
@@ -25,4 +25,4 @@ if [ "${REPLACE_ENV_VARIABLES^^}" = "TRUE" ]; then
done < <(env)
fi
exec /start-minecraftFinalSetup $@
exec ${SCRIPTS:-/}start-minecraftFinalSetup $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
export SERVER="/data/magma-server-${VANILLA_VERSION}.jar"
@@ -15,4 +15,4 @@ fi
export SKIP_LOG4J_CONFIG=true
# Continue to Final Setup
exec /start-finalSetup01World $@
exec ${SCRIPTS:-/}start-finalSetup01World $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
if [ -n "$OPS" ]; then
log "Setting/adding ops"

40
start-mohist Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/bash
. ${SCRIPTS:-/}start-utils
requireVar VANILLA_VERSION
set -o pipefail
set -e
isDebugging && set -x
mohistJobs=https://ci.codemc.io/job/Mohist-Community/job/
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
if ! curl -X HEAD -o /dev/null -fsSL "${mohistJob}"; then
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
exit 1
fi
latestBuildRelPath=$(
curl -fsSL "${mohistJob}lastSuccessfulBuild/api/json" |
jq -r '.artifacts[0].relativePath'
)
baseName=$(basename "${latestBuildRelPath}")
if [[ ${baseName} != *-server.jar* ]]; then
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
log " check https://ci.codemc.io/job/Mohist-Community/ for available versions"
exit 1
fi
export SERVER="/data/${baseName}"
if [ ! -f ${SERVER} ]; then
log "Downloading ${SERVER}"
curl -o "${SERVER}" -fsSL "${mohistJob}lastSuccessfulBuild/artifact/${latestBuildRelPath}"
fi
export SKIP_LOG4J_CONFIG=true
# Continue to Final Setup
exec ${SCRIPTS:-/}start-finalSetup01World $@

View File

@@ -99,4 +99,11 @@ function versionLessThan {
return 1
fi
fi
}
}
requireVar() {
if [ ! -v $1 ]; then
log "ERROR: $1 is required to be set"
exit 1
fi
}

View File

@@ -1,6 +1,6 @@
#!/bin/bash
. /start-utils
. ${SCRIPTS:-/}start-utils
if ! [[ -v CURSE_INSTANCE_JSON ]]; then
log "ERROR: CURSE_INSTANCE_JSON needs to be set"
@@ -15,4 +15,4 @@ fi
log "Resolved CURSE_INSTANCE_JSON as ${CURSE_INSTANCE_JSON}"
# Continue to Final Setup
exec /start-finalSetup01World "$@"
exec ${SCRIPTS:-/}start-finalSetup01World "$@"