From 3b356f1be98ca80523467794199d0edd57b90280 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Tue, 25 Feb 2020 13:49:08 +0800 Subject: [PATCH 01/12] new file: Dockerfile new file: Jenkinsfile --- Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ Jenkinsfile | 26 ++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 Dockerfile create mode 100644 Jenkinsfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bb8f761 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +# 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 in -n tar get gzip +RUN groupadd -g $PM_GID $PM_GROUP +RUN useradd -D -u $PM_UID -g $PM_GROUP -M $PM_USER +RUN mkdir /pmmp +RUN chown $PM_USER:$PM_GROUP /pmmp +RUN cd /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 tar zxvf PHP-7.3-Linux-x86_64.tar.gz +RUN rm PHP-7.3-Linux-x86_64.tar.gz +RUN wget -q -O - https://github.com/pmmp/PocketMine-MP/releases/download/3.9.5/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar +RUN wget -q -O - https://raw.githubusercontent.com/pmmp/PocketMine-MP/master/start.sh > /pmmp/start.sh +RUN chmod 755 start.sh +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..4421586 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,26 @@ +node("docker-node") { + docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') { + + git branch: "3.11.3", url: "ssh://git@git.ervine.org:2222/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") + + stage('Deploy on K8s'){ + sh "/usr/local/bin/kubectl -n test delete po pocketmine-0" + } + } + catch (err) { + currentBuild.result = 'FAILURE' + } + } +} -- 2.45.2 From 695908b12e19085296d0af1470e117bc41f51996 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Tue, 25 Feb 2020 13:54:25 +0800 Subject: [PATCH 02/12] modified: Dockerfile Fixed zypper install command to be non-interactive --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bb8f761..70a83f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ ENV LANG='en_US.UTF-8' \ PM_UID='1003' \ PM_GID='1003' -RUN zypper in -n tar get gzip +RUN zypper -n in tar get gzip RUN groupadd -g $PM_GID $PM_GROUP RUN useradd -D -u $PM_UID -g $PM_GROUP -M $PM_USER RUN mkdir /pmmp -- 2.45.2 From 114cce6ae4501bdf27f821301f59034597471a6e Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Tue, 25 Feb 2020 13:55:13 +0800 Subject: [PATCH 03/12] modified: Dockerfile Fixed typo - wget --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 70a83f9..aefa72a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ ENV LANG='en_US.UTF-8' \ PM_UID='1003' \ PM_GID='1003' -RUN zypper -n in tar get gzip +RUN zypper -n in tar wget gzip RUN groupadd -g $PM_GID $PM_GROUP RUN useradd -D -u $PM_UID -g $PM_GROUP -M $PM_USER RUN mkdir /pmmp -- 2.45.2 From 4f3126e9e577eec2015e88dbdd8e2e6b8f3134e6 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Tue, 25 Feb 2020 14:00:58 +0800 Subject: [PATCH 04/12] modified: Dockerfile Remove -D option to user add --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index aefa72a..87ed5b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ ENV LANG='en_US.UTF-8' \ RUN zypper -n in tar wget gzip RUN groupadd -g $PM_GID $PM_GROUP -RUN useradd -D -u $PM_UID -g $PM_GROUP -M $PM_USER +RUN useradd -u $PM_UID -g $PM_GROUP -M $PM_USER RUN mkdir /pmmp RUN chown $PM_USER:$PM_GROUP /pmmp RUN cd /pmmp -- 2.45.2 From f43f9fd1ae86e232fb1b34332edb612574069d4f Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Tue, 25 Feb 2020 14:02:57 +0800 Subject: [PATCH 05/12] modified: Dockerfile Fixed directory locations and removed unnecessary start script --- Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 87ed5b8..e918ed9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,13 +17,10 @@ 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 cd /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 tar zxvf PHP-7.3-Linux-x86_64.tar.gz -RUN rm PHP-7.3-Linux-x86_64.tar.gz +RUN cd /pmmp && tar zxvf PHP-7.3-Linux-x86_64.tar.gz +RUN rm /pmmp/PHP-7.3-Linux-x86_64.tar.gz RUN wget -q -O - https://github.com/pmmp/PocketMine-MP/releases/download/3.9.5/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar -RUN wget -q -O - https://raw.githubusercontent.com/pmmp/PocketMine-MP/master/start.sh > /pmmp/start.sh -RUN chmod 755 start.sh RUN chown -R $PM_USER:$PM_GROUP /pmmp VOLUME /plugins -- 2.45.2 From 63b11bbf27209830b52130096e4caa6b22924a83 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Tue, 25 Feb 2020 14:38:44 +0800 Subject: [PATCH 06/12] modified: Dockerfile Updated to latest version of PocketMine --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e918ed9..3ae1e05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ 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 RUN rm /pmmp/PHP-7.3-Linux-x86_64.tar.gz -RUN wget -q -O - https://github.com/pmmp/PocketMine-MP/releases/download/3.9.5/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar +RUN wget -q -O - https://github.com/pmmp/PocketMine-MP/releases/download/3.11.6/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar RUN chown -R $PM_USER:$PM_GROUP /pmmp VOLUME /plugins -- 2.45.2 From 5c8baceed2b0ad7942c6d67ed313369f9e0392e0 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Fri, 20 Mar 2020 14:19:32 +0800 Subject: [PATCH 07/12] modified: Dockerfile new file: php.ini Added custom php.ini file --- Dockerfile | 1 + php.ini | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 php.ini diff --git a/Dockerfile b/Dockerfile index 3ae1e05..472763c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,7 @@ 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.11.6/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar RUN chown -R $PM_USER:$PM_GROUP /pmmp diff --git a/php.ini b/php.ini new file mode 100644 index 0000000..6f37094 --- /dev/null +++ b/php.ini @@ -0,0 +1,21 @@ +memory_limit=14096 +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 -- 2.45.2 From 6c77c6677ac6644e33e3b5246562f273495726f4 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Fri, 20 Mar 2020 14:33:41 +0800 Subject: [PATCH 08/12] modified: Jenkinsfile modified: php.ini Removed k8s deploy from Jenkinsfile - fixed typo in php.ini --- Jenkinsfile | 3 +-- php.ini | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4421586..e4aeb71 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,9 +14,8 @@ node("docker-node") { stage "publish" app.push("${env.BUILD_NUMBER}") app.push("latest") + app.push("3.11.6") - stage('Deploy on K8s'){ - sh "/usr/local/bin/kubectl -n test delete po pocketmine-0" } } catch (err) { diff --git a/php.ini b/php.ini index 6f37094..d429b49 100644 --- a/php.ini +++ b/php.ini @@ -1,4 +1,4 @@ -memory_limit=14096 +memory_limit=14096M date.timezone=UTC short_open_tag=0 asp_tags=0 -- 2.45.2 From 067fb8fbd2c0e82ee055acf45afa2be3193dabb5 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Fri, 20 Mar 2020 14:37:58 +0800 Subject: [PATCH 09/12] modified: Jenkinsfile Fixed typo --- Jenkinsfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e4aeb71..ed5ba0c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,8 +15,6 @@ node("docker-node") { app.push("${env.BUILD_NUMBER}") app.push("latest") app.push("3.11.6") - - } } catch (err) { currentBuild.result = 'FAILURE' -- 2.45.2 From f084485db96a40fe5ef654ec81c429ff46c0580e Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Tue, 14 Apr 2020 14:52:31 +0800 Subject: [PATCH 10/12] modified: Dockerfile modified: Jenkinsfile Bumped to version 3.11.7 --- Dockerfile | 2 +- Jenkinsfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 472763c..7048ba4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN wget -q -O - https://jenkins.pmmp.io/job/PHP-7.3-Aggregate/lastSuccessfulBui 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.11.6/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar +RUN wget -q -O - https://github.com/pmmp/PocketMine-MP/releases/download/3.11.7/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar RUN chown -R $PM_USER:$PM_GROUP /pmmp VOLUME /plugins diff --git a/Jenkinsfile b/Jenkinsfile index ed5ba0c..c6364a2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ node("docker-node") { stage "publish" app.push("${env.BUILD_NUMBER}") app.push("latest") - app.push("3.11.6") + app.push("3.11.7") } catch (err) { currentBuild.result = 'FAILURE' -- 2.45.2 From 4af24d2dbeaf93d4a92b86a9fb63912bc3cf8932 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Sat, 18 Apr 2020 23:50:43 +0800 Subject: [PATCH 11/12] modified: Dockerfile modified: Jenkinsfile Bumped to version 3.12.0 --- Dockerfile | 2 +- Jenkinsfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7048ba4..83197f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN wget -q -O - https://jenkins.pmmp.io/job/PHP-7.3-Aggregate/lastSuccessfulBui 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.11.7/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar +RUN wget -q -O - https://github.com/pmmp/PocketMine-MP/releases/download/3.12.0/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar RUN chown -R $PM_USER:$PM_GROUP /pmmp VOLUME /plugins diff --git a/Jenkinsfile b/Jenkinsfile index c6364a2..5b1f2e0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ node("docker-node") { stage "publish" app.push("${env.BUILD_NUMBER}") app.push("latest") - app.push("3.11.7") + app.push("3.12.0") } catch (err) { currentBuild.result = 'FAILURE' -- 2.45.2 From 13cd57e5d75a1d56e805d61c6c3a30cf4ea910a6 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Fri, 5 Jun 2020 15:37:34 +0800 Subject: [PATCH 12/12] modified: Dockerfile modified: Jenkinsfile --- Dockerfile | 2 +- Jenkinsfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 83197f0..178f246 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN wget -q -O - https://jenkins.pmmp.io/job/PHP-7.3-Aggregate/lastSuccessfulBui 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.12.0/PocketMine-MP.phar > /pmmp/PocketMine-MP.phar +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 diff --git a/Jenkinsfile b/Jenkinsfile index 5b1f2e0..864310f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ node("docker-node") { docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') { - git branch: "3.11.3", url: "ssh://git@git.ervine.org:2222/jonny/x86_64-suse-pocketmine", credentialsId: 'jenkins-to-git' + 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() -- 2.45.2