mirror of
https://github.com/ENSL/ensl-plugin.git
synced 2025-02-08 08:21:58 +00:00
UpdatE Dockerfile
Make it build completely from Dockerfile. Use build.sh to move files. Also add metamod to make it complete package.
This commit is contained in:
parent
87e1d974d1
commit
756ce033b6
3 changed files with 52 additions and 46 deletions
67
Dockerfile
67
Dockerfile
|
@ -6,32 +6,61 @@ RUN apt-get install -y wget git vim curl ca-certificates gcc-multilib hashalot u
|
|||
|
||||
RUN useradd -m amxx && mkdir -p /var/build/pkg && chown -R amxx:amxx /var/build
|
||||
|
||||
# Some paths
|
||||
# /home/amxx/build - temporary copy
|
||||
# /home/amxx/builD/base - Base AMXX files, not all included
|
||||
# /home/amxx/build/pkg - result package
|
||||
# /var/build - final product, mounted volume and copied on start
|
||||
|
||||
USER amxx
|
||||
WORKDIR /home/amxx
|
||||
|
||||
RUN mkdir -p /home/amxx/build/base /home/amxx/build/pkg /var/build
|
||||
WORKDIR /home/amxx/build/base/
|
||||
|
||||
# Get all files and SHA-checkthem
|
||||
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 "http://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"
|
||||
|
||||
COPY files/amxmodx.sha /home/amxx
|
||||
RUN sha256sum -c amxmodx.sha
|
||||
COPY files/amxmodx.sha /home/amxx/base/
|
||||
# RUN sha256sum -c amxmodx.sha
|
||||
# RUN sha256sum *.gz *.zip > /home/amxx/build/shasums
|
||||
|
||||
RUN tar -zxf amxx.tgz && tar -zxf amxx_ns.tgz
|
||||
# Extract all package
|
||||
RUN yes|unzip -o amxx.zip && \
|
||||
yes|unzip -o amxx_ns.zip && \
|
||||
yes|unzip -uo mm.zip && \
|
||||
tar -zxf amxx.tgz && \
|
||||
tar -zxf amxx_ns.tgz
|
||||
|
||||
WORKDIR /home/amxx/addons/amxmodx/scripting
|
||||
# Copy build script, all AMXX source files and include files
|
||||
COPY src/*.sma /home/amxx/build/base/addons/amxmodx/scripting/
|
||||
COPY src/include/* /home/amxx/build/base/addons/amxmodx/scripting/include
|
||||
|
||||
#COPY --chown=amxx src/ensl.sh /home/amxx/
|
||||
#COPY --chown=amxx src/*.sma /home/amxx/addons/amxmodx/scripting/
|
||||
#COPY --chown=amxx src/include/* /home/amxx/addons/amxmodx/scripting/include
|
||||
#COPY --chown=amxx pkg /var/pkg
|
||||
COPY src/ensl.sh /home/amxx/
|
||||
COPY src/*.sma /home/amxx/addons/amxmodx/scripting/
|
||||
COPY src/include/* /home/amxx/addons/amxmodx/scripting/include
|
||||
COPY pkg /var/pkg
|
||||
#USER root
|
||||
#RUN chown -R amxx:amxx /home/amxx /var/build
|
||||
#USER amxx
|
||||
|
||||
WORKDIR /home/amxx/build/base/addons/amxmodx/scripting
|
||||
RUN ./amxxpc ENSL.sma && cp ENSL.amxx /home/amxx/build
|
||||
|
||||
# RUN cp -ra /var/pkg/* /var/build/pkg
|
||||
WORKDIR /home/amxx/build
|
||||
|
||||
# Then just copy the files we need. No extra.
|
||||
# RUN cp -ra base/addons/metamod pkg/addons/metamod
|
||||
RUN mkdir -p pkg/addons/amxmodx/plugins && cp ENSL.amxx pkg/addons/amxmodx/plugins/
|
||||
RUN cp -ra base/addons/amxmodx/modules pkg/addons/amxmodx/ && \
|
||||
cp -ra base/addons/amxmodx/data pkg/addons/amxmodx/ && \
|
||||
cp -ra base/addons/amxmodx/dlls pkg/addons/amxmodx/
|
||||
|
||||
ADD pkg /home/amxx/build/pkg
|
||||
|
||||
RUN zip -r ENSL_SrvPkg.zip *
|
||||
|
||||
COPY build.sh /home/amxx/
|
||||
|
||||
USER root
|
||||
RUN chown -R amxx /home/amxx
|
||||
USER amxx
|
||||
# RUN ./amxxpc ENSL.sma && cp ENSL.sma /var/build
|
||||
|
||||
ENTRYPOINT ["/home/amxx/ensl.sh", "ENSL.sma"]
|
||||
ENTRYPOINT ["/home/amxx/build.sh"]
|
||||
|
|
4
build.sh
Executable file
4
build.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
mv /home/amxx/build/* /var/build
|
||||
bash
|
27
src/ensl.sh
27
src/ensl.sh
|
@ -1,27 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd /home/amxx/addons/amxmodx/scripting
|
||||
|
||||
./amxxpc $1
|
||||
cp *.amxx /var/build
|
||||
|
||||
cd /home/amxx
|
||||
|
||||
mkdir -p /var/build/tmp /var/build/pkg
|
||||
|
||||
yes|unzip -f amxx.zip -d /var/build/tmp/
|
||||
yes|unzip -f amxx_ns.zip -d /var/build/tmp/
|
||||
tar -zxf amxx.tgz -C /var/build/tmp/
|
||||
tar -zxf amxx_ns.tgz -C /var/build/tmp/
|
||||
|
||||
cp -ra /var/pkg/* /var/build/pkg
|
||||
|
||||
cd /var/build/pkg/
|
||||
|
||||
cp -ra ../tmp/metamod/ .
|
||||
cp -ra ../tmp/addons/amxmodx/modules/* addons/amxmodx/modules/
|
||||
cp -ra ../tmp/addons/amxmodx/data/* addons/amxmodx/data/
|
||||
cp -ra ../tmp/addons/amxmodx/dlls/* addons/amxmodx/dlls/
|
||||
cp ../ENSL.amxx addons/amxmodx/scripting/plugins/
|
||||
|
||||
zip -r ENSL_SrvPkg.zip *
|
Loading…
Reference in a new issue