diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..178f246 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# Base on latest (edge) alpine image +FROM opensuse/leap:15.1 + +MAINTAINER “Jonathan Ervine” + +# Install updates +ENV LANG='en_US.UTF-8' \ + LANGUAGE='en_US.UTF-8' \ + TERM='xterm' \ + PM_USER='pmmp' \ + PM_GROUP='pmmp' \ + PM_UID='1003' \ + PM_GID='1003' + +RUN zypper -n in tar wget gzip +RUN groupadd -g $PM_GID $PM_GROUP +RUN useradd -u $PM_UID -g $PM_GROUP -M $PM_USER +RUN mkdir /pmmp +RUN chown $PM_USER:$PM_GROUP /pmmp +RUN wget -q -O - https://jenkins.pmmp.io/job/PHP-7.3-Aggregate/lastSuccessfulBuild/artifact/PHP-7.3-Linux-x86_64.tar.gz > /pmmp/PHP-7.3-Linux-x86_64.tar.gz +RUN cd /pmmp && tar zxvf PHP-7.3-Linux-x86_64.tar.gz +ADD php.ini /pmmp/bin/php7/bin/php.ini +RUN rm /pmmp/PHP-7.3-Linux-x86_64.tar.gz +RUN wget -q -O - https://github.com/pmmp/PocketMine-MP/releases/download/3.13.0/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar +RUN chown -R $PM_USER:$PM_GROUP /pmmp + +VOLUME /plugins +VOLUME /config + +EXPOSE 19132/udp + +USER $PM_USER + +CMD [ "/pmmp/bin/php7/bin/php", "/pmmp/PocketMine-MP.phar", "--no-wizard", "--enable-ansi", "--data=/config", "--plugins=/plugins" ] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..864310f --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,23 @@ +node("docker-node") { + docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') { + + git branch: "3.11.3", url: "ssh://git@git.ervine.org/jonny/x86_64-suse-pocketmine", credentialsId: 'jenkins-to-git' + + sh "git rev-parse HEAD > .git/commit-id" + def commit_id = readFile('.git/commit-id').trim() + println commit_id + + try { + stage "build" + def app = docker.build "library/x86_64/suse/pocketmine" + + stage "publish" + app.push("${env.BUILD_NUMBER}") + app.push("latest") + app.push("3.12.0") + } + catch (err) { + currentBuild.result = 'FAILURE' + } + } +} diff --git a/php.ini b/php.ini new file mode 100644 index 0000000..d429b49 --- /dev/null +++ b/php.ini @@ -0,0 +1,21 @@ +memory_limit=14096M +date.timezone=UTC +short_open_tag=0 +asp_tags=0 +phar.readonly=0 +phar.require_hash=1 +igbinary.compact_strings=0 +zend.assertions=-1 +error_reporting=-1 +display_errors=1 +display_startup_errors=1 +recursionguard.enabled=0 ;disabled due to minor performance impact, only enable this if you need it for debugging +;zend_extension=opcache.so +opcache.enable=1 +opcache.enable_cli=1 +opcache.save_comments=1 +opcache.fast_shutdown=0 +opcache.max_accelerated_files=4096 +opcache.interned_strings_buffer=8 +opcache.memory_consumption=128 +opcache.optimization_level=0xffffffff