From b8dfb29529b958f930d001867ff0b0e48393cb39 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Tue, 1 May 2018 19:58:19 +0200 Subject: [PATCH] add .s2i/environment and rm Dockerfile (#19) To work, this requires vorburger/s2i#gradle which includes: * https://github.com/fabric8io-images/s2i/issues/146 * https://github.com/fabric8io-images/s2i/issues/118 --- .s2i/environment | 3 +++ Dockerfile | 18 ------------------ README.md | 20 +++++++++++++------- 3 files changed, 16 insertions(+), 25 deletions(-) create mode 100644 .s2i/environment delete mode 100644 Dockerfile diff --git a/.s2i/environment b/.s2i/environment new file mode 100644 index 00000000..17e7bcd0 --- /dev/null +++ b/.s2i/environment @@ -0,0 +1,3 @@ +ARTIFACT_DIR=web/build/libs/ +ARTIFACT_COPY_ARGS=*-all.jar +DEPLOYMENTS_DIR=/deployments/mods/ diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 556be7a9..00000000 --- a/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM s2i-minecraft-server - -# NB: The .dockerignore file excludes a lot to make "Uploading context" faster. -# This helps for Docker but not OpenShift; see https://github.com/openshift/origin/issues/13255. - -COPY web/build/libs/web-*-all.jar /deployments/mods/ - - -# NB: The EXPOSE is really just for "UI convenience", not technically required... - -# Minecraft server -EXPOSE 25565 - -# Vert.x EventBus -EXPOSE 8080 - -# Static HTTP web server for JS -EXPOSE 7070 diff --git a/README.md b/README.md index 380111eb..c2af785a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Please do Star & Watch this GitHub project if you like it! ## Scratch integration -This project has two parts, delivered as separate Minecraft plugins: +This project has two parts, delivered as separate Minecraft plugins: * The first, described below, lets you create stories by writing .story text files. * The second, [described in a separate README](/scratch/README.md), lets you script Minecraft with Scratch! @@ -75,13 +75,23 @@ In Docker: docker run --rm -p 25565:25565 -p 8080:8080 -p 7070:7070 minecraft-storeys-maker -In OpenShift, just ignore the "error: build error: No source files were specified" from the first command: +In OpenShift: + +Until [S2I #146](https://github.com/fabric8io-images/s2i/issues/146) and [S2I #118] (https://github.com/fabric8io-images/s2i/issues/118) are reviewed, merged and available on DockerHub, we first: + + oc new-build https://github.com/vorburger/s2i#gradle --context-dir=java/images/jboss + +and then: + + oc new-build s2i~https://github.com/vorburger/s2i-minecraft-server oc new-app https://github.com/vorburger/minecraft-storeys-maker.git +or if have this project's source code locally (but beware of #28!), then: + oc start-build minecraft-storeys-maker --from-dir=. --follow -Expose the [Minecraft server port 25565 via a LoadBalancer service](https://github.com/vorburger/s2i-minecraft-server/), +Now expose the [Minecraft server port 25565 via a LoadBalancer service](https://github.com/vorburger/s2i-minecraft-server/), and similarly also (specific to this plugin) expose our JS web site code and Vert.x EventBus port, for now via Edit YAML on the minecraft-storeys-maker(-server) Service, and adding 7070 and 8080 just like 25565. NB that you do not set the `nodePort:` when editing the YAML; it will get automatically added. We then have to set Environment variables @@ -100,10 +110,6 @@ Or just with local port forwarding instead: oc port-forward minecraft-storeys-maker-.... 7070:7070 oc port-forward minecraft-storeys-maker-.... 8080:8080 -You'll need to have [the "s2i-minecraft-server" base image](https://github.com/vorburger/s2i-minecraft-server) available. - -See also [minecraft-storeys-maker-server](https://github.com/vorburger/minecraft-storeys-maker-server). - ## FAQ