mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-24 14:33:02 +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_BUILD_TYPE=None
|
||||
ENV CMAKE_BUILD_PARALLEL_LEVEL=
|
||||
ENV CMAKE_BUILD_PARALLEL_LEVEL='{{ JOBS }}'
|
||||
|
||||
RUN git init Implib.so \
|
||||
&& cd Implib.so \
|
||||
|
|
|
@ -4,12 +4,15 @@ from os.path import dirname
|
|||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
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():
|
||||
print(Environment(loader=FileSystemLoader(dirname(__file__))).get_template("Dockerfile").render(
|
||||
DEBUG=checkEnv("DEBUG", True),
|
||||
LTO=checkEnv("LTO", True),
|
||||
JOBS=checkEnv("JOBS", ""),
|
||||
))
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Reference in a new issue