From a6f76694f7cb41ca848af91437dc1310e7cad294 Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Sat, 6 Feb 2021 06:11:06 +0200 Subject: [PATCH] Update build process Use compose --- Dockerfile | 6 +++--- Makefile | 39 --------------------------------------- README.markdown | 11 ++++++----- build.sh | 8 ++++++-- docker-compose.yml | 13 +++++++++++++ 5 files changed, 28 insertions(+), 49 deletions(-) delete mode 100644 Makefile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index 9a16a6b..36640cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,8 +21,8 @@ WORKDIR /home/amxx/build/base/ RUN wget -q -O amxx.tgz "https://www.amxmodx.org/release/amxmodx-1.8.2-base-linux.tar.gz" && \ wget -q -O amxx_ns.tgz "https://www.amxmodx.org/release/amxmodx-1.8.2-ns-linux.tar.gz" && \ wget -q -O amxx.zip "https://www.amxmodx.org/release/amxmodx-1.8.2-base-windows.zip" && \ - wget -q -O amxx_ns.zip "https://www.amxmodx.org/release/amxmodx-1.8.2-ns-windows.zip" -RUN wget -q -O mm.zip "https://www.amxmodx.org/release/metamod-1.21.1-am.zip" + wget -q -O amxx_ns.zip "https://www.amxmodx.org/release/amxmodx-1.8.2-ns-windows.zip" && \ + wget -q -O mm.zip "https://www.amxmodx.org/release/metamod-1.21.1-am.zip" COPY files/amxmodx.sha /home/amxx/base/ # RUN sha256sum -c amxmodx.sha @@ -68,4 +68,4 @@ RUN cd pkg && zip -9 -r ENSL_SrvPkg.zip * && mv ENSL_SrvPkg.zip .. COPY build.sh /home/amxx/ USER root -ENTRYPOINT ["/home/amxx/build.sh"] +ENTRYPOINT ["/bin/bash", "/home/amxx/build.sh"] diff --git a/Makefile b/Makefile deleted file mode 100644 index 2ec5f19..0000000 --- a/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -#REGISTRY ?= ensl -PROJECT ?= ensl-plugin -TAG ?= latest - -.PHONY: all test clean build - -ifdef REGISTRY - IMAGE=$(REGISTRY)/$(PROJECT):$(TAG) -else - IMAGE=$(PROJECT) -endif - -all: - @echo "Available targets:" - @echo " * build - build a Docker image for $(IMAGE)" - @echo " * pull - pull $(IMAGE)" - @echo " * push - push $(IMAGE)" - @echo " * test - build and test $(IMAGE)" - -build: - docker build . -t $(IMAGE) - -run: build - mkdir -p build - docker run -v $(shell pwd)/build/:/var/build -ti $(IMAGE) - -pull: - docker pull $(IMAGE) || true - -push: - docker push $(IMAGE) - -clean: - rm -rf $(shell pwd)/build/* - docker ps -a | awk '{ print $$1,$$2 }' | grep $(IMAGE) |awk '{print $$1 }' |xargs -I {} docker rm {} - docker images -a |grep $(IMAGE) |awk '{print $$3}' |xargs -I {} docker rmi {} - -test: build - @echo "TODO" diff --git a/README.markdown b/README.markdown index fe3a32b..e47f156 100644 --- a/README.markdown +++ b/README.markdown @@ -1,14 +1,16 @@ ENSL Plugin =========== -This is the source code of ENSL Plugin. It was used on European NS League for many years. +This is the source code of ENSL Plugin. It was used on European NS League for many years. Full description of all the features is here: +http://www.ensl.org/articles/426 ## How to compile Use the provided Dockerfile to install libs, amxmodx and compile it. -1. Run `make build` to build docker image -1. Run `make run` to compile and find it in **build** directory. +1. Run `docker-compose up --build` to build docker image and run it. + * First it will copy the builed plugin and zip file to `./build` + * It will enter bash prompt if you want to compile something manually ## Credits @@ -22,5 +24,4 @@ Originally based on CAL Plugin, but later completely remade by jiriki. Rest of t + www.nsmod.org + www.amxmodx.org -Right now only legacy code is the unstuck function from CAL Plugin. Full description of all the features is here: -http://www.ensl.org/articles/426 +Right now only legacy code is the unstuck function from CAL Plugin. \ No newline at end of file diff --git a/build.sh b/build.sh index c4a4372..3f6241d 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,11 @@ #!/bin/bash -mv /home/amxx/build/* /var/build +echo "Copying files to build folder." +echo "-------------------------------" +mv -v /home/amxx/build/* /var/build +echo "Following files in the package:" +echo "-------------------------------" cd /var/build/pkg find . -type f -bash +/bin/bash \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..954e5eb --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: "3.7" + +services: + plugin: + command: "bash" + tty: true + stdin_open: true + container_name: "ensl_plugin" + build: + context: ./ + dockerfile: Dockerfile + volumes: + - "./build:/var/build" \ No newline at end of file