mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-23 04:13:21 +02:00
Allow overriding jobs count in Dockerfile
This commit is contained in:
parent
307a7791df
commit
0c635a05ff
2 changed files with 5 additions and 2 deletions
|
@ -48,7 +48,7 @@ ENV LDFLAGS='{% if not LTO %}-fuse-ld=lld{% endif %} -static-libstdc++ -static-l
|
||||||
|
|
||||||
ENV CMAKE_GENERATOR=Ninja
|
ENV CMAKE_GENERATOR=Ninja
|
||||||
ENV CMAKE_BUILD_TYPE=None
|
ENV CMAKE_BUILD_TYPE=None
|
||||||
ENV CMAKE_BUILD_PARALLEL_LEVEL=
|
ENV CMAKE_BUILD_PARALLEL_LEVEL='{{ JOBS }}'
|
||||||
|
|
||||||
RUN git init Implib.so \
|
RUN git init Implib.so \
|
||||||
&& cd Implib.so \
|
&& cd Implib.so \
|
||||||
|
|
|
@ -4,12 +4,15 @@ from os.path import dirname
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
|
|
||||||
def checkEnv(envName, defaultValue):
|
def checkEnv(envName, defaultValue):
|
||||||
return bool(len(environ[envName])) if envName in environ else defaultValue
|
if isinstance(defaultValue, bool):
|
||||||
|
return bool(len(environ[envName])) if envName in environ else defaultValue
|
||||||
|
return environ[envName] if envName in environ else defaultValue
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print(Environment(loader=FileSystemLoader(dirname(__file__))).get_template("Dockerfile").render(
|
print(Environment(loader=FileSystemLoader(dirname(__file__))).get_template("Dockerfile").render(
|
||||||
DEBUG=checkEnv("DEBUG", True),
|
DEBUG=checkEnv("DEBUG", True),
|
||||||
LTO=checkEnv("LTO", True),
|
LTO=checkEnv("LTO", True),
|
||||||
|
JOBS=checkEnv("JOBS", ""),
|
||||||
))
|
))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Add table
Reference in a new issue