Skip to content

Commit e5d6918

Browse files
committed
ci: use -j 4 for docker jobs
locally you can overload it using `export CMAKE_BUILD_PARALLEL_LEVEL=4`
1 parent 18108c0 commit e5d6918

9 files changed

Lines changed: 30 additions & 0 deletions

File tree

ci/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ help:
143143
@echo
144144
@echo -e "\t${BOLD}NOCACHE=1${RESET}: use 'docker build --no-cache' when building container (default use cache)."
145145
@echo -e "\t${BOLD}VERBOSE=1${RESET}: use 'docker build --progress=plain' when building container."
146+
@echo -e "\t${BOLD}CMAKE_BUILD_PARALLEL_LEVEL=4${RESET}: number of concurrent processes to use when building."
146147
@echo
147148
@echo -e "branch: $(BRANCH)"
148149
@echo -e "sha1: $(SHA1)"
@@ -174,6 +175,10 @@ ifdef VERBOSE
174175
DOCKER_BUILD_CMD := ${DOCKER_BUILD_CMD} --progress=plain
175176
DOCKER_BUILDX_CMD := ${DOCKER_BUILDX_CMD} --progress=plain
176177
endif
178+
ifdef CMAKE_BUILD_PARALLEL_LEVEL
179+
DOCKER_BUILD_CMD := ${DOCKER_BUILD_CMD} --build-arg CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}
180+
DOCKER_BUILDX_CMD := ${DOCKER_BUILDX_CMD} --build-arg CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}
181+
endif
177182
DOCKER_RUN_CMD := docker run --rm --init --net=host
178183

179184
# Currently supported distro

ci/docker/almalinux/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ FROM env AS devel
1616
WORKDIR /home/project
1717
COPY . .
1818

19+
ARG CMAKE_BUILD_PARALLEL_LEVEL
20+
ENV CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-4}
21+
1922
FROM devel AS build
2023
RUN cmake --version
2124
RUN cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release

ci/docker/alpine/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ FROM env AS devel
1111
WORKDIR /home/project
1212
COPY . .
1313

14+
ARG CMAKE_BUILD_PARALLEL_LEVEL
15+
ENV CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-4}
16+
1417
FROM devel AS build
1518
RUN cmake --version
1619
RUN cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release

ci/docker/archlinux/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ FROM env AS devel
1111
WORKDIR /home/project
1212
COPY . .
1313

14+
ARG CMAKE_BUILD_PARALLEL_LEVEL
15+
ENV CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-4}
16+
1417
FROM devel AS build
1518
RUN cmake --version
1619
RUN cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release

ci/docker/debian/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ FROM env AS devel
1515
WORKDIR /home/project
1616
COPY . .
1717

18+
ARG CMAKE_BUILD_PARALLEL_LEVEL
19+
ENV CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-4}
20+
1821
FROM devel AS build
1922
RUN cmake --version
2023
RUN cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release

ci/docker/fedora/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ FROM env AS devel
1515
WORKDIR /home/project
1616
COPY . .
1717

18+
ARG CMAKE_BUILD_PARALLEL_LEVEL
19+
ENV CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-4}
20+
1821
FROM devel AS build
1922
RUN cmake --version
2023
RUN cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release

ci/docker/opensuse/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ FROM env AS devel
1414
WORKDIR /home/project
1515
COPY . .
1616

17+
ARG CMAKE_BUILD_PARALLEL_LEVEL
18+
ENV CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-4}
19+
1720
FROM devel AS build
1821
RUN cmake --version
1922
RUN cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release

ci/docker/rockylinux/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ FROM env AS devel
1616
WORKDIR /home/project
1717
COPY . .
1818

19+
ARG CMAKE_BUILD_PARALLEL_LEVEL
20+
ENV CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-4}
21+
1922
FROM devel AS build
2023
RUN cmake --version
2124
RUN cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release

ci/docker/ubuntu/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ RUN apt update -q \
1010
&& apt-get clean \
1111
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
1212

13+
# Add the library src to our build env
1314
FROM env AS devel
1415
WORKDIR /home/project
1516
COPY . .
1617

18+
ARG CMAKE_BUILD_PARALLEL_LEVEL
19+
ENV CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-4}
20+
1721
FROM devel AS build
1822
RUN cmake --version
1923
RUN cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release

0 commit comments

Comments
 (0)