Update build process

Use compose
This commit is contained in:
Ari Timonen 2021-02-06 06:11:06 +02:00
parent 0360a26dae
commit a6f76694f7
5 changed files with 28 additions and 49 deletions

View File

@ -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" && \ 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_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.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" 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 mm.zip "https://www.amxmodx.org/release/metamod-1.21.1-am.zip"
COPY files/amxmodx.sha /home/amxx/base/ COPY files/amxmodx.sha /home/amxx/base/
# RUN sha256sum -c amxmodx.sha # 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/ COPY build.sh /home/amxx/
USER root USER root
ENTRYPOINT ["/home/amxx/build.sh"] ENTRYPOINT ["/bin/bash", "/home/amxx/build.sh"]

View File

@ -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"

View File

@ -1,14 +1,16 @@
ENSL Plugin 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 ## How to compile
Use the provided Dockerfile to install libs, amxmodx and compile it. Use the provided Dockerfile to install libs, amxmodx and compile it.
1. Run `make build` to build docker image 1. Run `docker-compose up --build` to build docker image and run it.
1. Run `make run` to compile and find it in **build** directory. * 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 ## Credits
@ -22,5 +24,4 @@ Originally based on CAL Plugin, but later completely remade by jiriki. Rest of t
+ www.nsmod.org + www.nsmod.org
+ www.amxmodx.org + www.amxmodx.org
Right now only legacy code is the unstuck function from CAL Plugin. Full description of all the features is here: Right now only legacy code is the unstuck function from CAL Plugin.
http://www.ensl.org/articles/426

View File

@ -1,7 +1,11 @@
#!/bin/bash #!/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 cd /var/build/pkg
find . -type f find . -type f
bash /bin/bash

13
docker-compose.yml Normal file
View File

@ -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"