bazel: rework docker ci
This commit is contained in:
@@ -14,10 +14,11 @@ RUN echo "source /opt/rh/gcc-toolset-13/enable" >> /etc/bashrc
|
||||
SHELL ["/bin/bash", "--login", "-c"]
|
||||
|
||||
# Install Bazelisk
|
||||
ARG TARGETARCH=amd64
|
||||
RUN wget \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-amd64 \
|
||||
&& chmod +x bazelisk-linux-amd64 \
|
||||
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${TARGETARCH} \
|
||||
&& chmod +x bazelisk-linux-${TARGETARCH} \
|
||||
&& mv bazelisk-linux-${TARGETARCH} /usr/local/bin/bazel
|
||||
|
||||
# Install Java
|
||||
RUN dnf -y update \
|
||||
@@ -38,13 +39,7 @@ COPY . .
|
||||
|
||||
FROM devel AS build
|
||||
RUN bazel version
|
||||
RUN bazel build \
|
||||
-c opt \
|
||||
--subcommands=true \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel build --config=ci //ortools/... //examples/...
|
||||
|
||||
FROM build AS test
|
||||
RUN bazel test \
|
||||
-c opt \
|
||||
--test_output=errors \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel test --config=ci //ortools/... //examples/...
|
||||
|
||||
@@ -20,13 +20,7 @@ COPY . .
|
||||
|
||||
FROM devel AS build
|
||||
RUN bazel version
|
||||
RUN bazel build \
|
||||
-c opt \
|
||||
--subcommands=true \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel build --config=ci //ortools/... //examples/...
|
||||
|
||||
FROM build AS test
|
||||
RUN bazel test \
|
||||
-c opt \
|
||||
--test_output=errors \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel test --config=ci //ortools/... //examples/...
|
||||
|
||||
@@ -16,13 +16,7 @@ COPY . .
|
||||
|
||||
FROM devel AS build
|
||||
RUN bazel version
|
||||
RUN bazel build \
|
||||
-c opt \
|
||||
--subcommands=true \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel build --config=ci //ortools/... //examples/...
|
||||
|
||||
FROM build AS test
|
||||
RUN bazel test \
|
||||
-c opt \
|
||||
--test_output=errors \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel test --config=ci //ortools/... //examples/...
|
||||
|
||||
@@ -10,15 +10,12 @@ RUN apt-get update -qq \
|
||||
&& apt-get install -yq default-jdk \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Install Bazel
|
||||
RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
|
||||
# Install Bazelisk
|
||||
ARG TARGETARCH=amd64
|
||||
RUN echo "deb [arch=$TARGETARCH] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get install -yq bazel \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
RUN wget \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${TARGETARCH} \
|
||||
&& chmod +x bazelisk-linux-${TARGETARCH} \
|
||||
&& mv bazelisk-linux-${TARGETARCH} /usr/local/bin/bazel
|
||||
|
||||
FROM env AS devel
|
||||
WORKDIR /home/project
|
||||
@@ -26,13 +23,7 @@ COPY . .
|
||||
|
||||
FROM devel AS build
|
||||
RUN bazel version
|
||||
RUN bazel build \
|
||||
-c opt \
|
||||
--subcommands=true \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel build --config=ci //ortools/... //examples/...
|
||||
|
||||
FROM build AS test
|
||||
RUN bazel test \
|
||||
-c opt \
|
||||
--test_output=errors \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel test --config=ci //ortools/... //examples/...
|
||||
|
||||
@@ -13,10 +13,11 @@ RUN dnf -y update \
|
||||
&& dnf clean all
|
||||
|
||||
# Install Bazelisk
|
||||
ARG TARGETARCH=amd64
|
||||
RUN wget \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-amd64 \
|
||||
&& chmod +x bazelisk-linux-amd64 \
|
||||
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${TARGETARCH} \
|
||||
&& chmod +x bazelisk-linux-${TARGETARCH} \
|
||||
&& mv bazelisk-linux-${TARGETARCH} /usr/local/bin/bazel
|
||||
|
||||
# Install Java
|
||||
RUN dnf -y update \
|
||||
@@ -35,13 +36,7 @@ COPY . .
|
||||
|
||||
FROM devel AS build
|
||||
RUN bazel version
|
||||
RUN bazel build \
|
||||
-c opt \
|
||||
--subcommands=true \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel build --config=ci //ortools/... //examples/...
|
||||
|
||||
FROM build AS test
|
||||
RUN bazel test \
|
||||
-c opt \
|
||||
--test_output=errors \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel test --config=ci //ortools/... //examples/...
|
||||
|
||||
@@ -10,10 +10,11 @@ RUN zypper update -y \
|
||||
ENV CC=gcc CXX=g++
|
||||
|
||||
# Install Bazelisk
|
||||
ARG TARGETARCH=amd64
|
||||
RUN wget \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-amd64 \
|
||||
&& chmod +x bazelisk-linux-amd64 \
|
||||
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${TARGETARCH} \
|
||||
&& chmod +x bazelisk-linux-${TARGETARCH} \
|
||||
&& mv bazelisk-linux-${TARGETARCH} /usr/local/bin/bazel
|
||||
|
||||
# Install Java JDK and Maven
|
||||
RUN zypper refresh \
|
||||
@@ -32,13 +33,7 @@ COPY . .
|
||||
|
||||
FROM devel AS build
|
||||
RUN bazel version
|
||||
RUN bazel build \
|
||||
-c opt \
|
||||
--subcommands=true \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel build --config=ci //ortools/... //examples/...
|
||||
|
||||
FROM build AS test
|
||||
RUN bazel test \
|
||||
-c opt \
|
||||
--test_output=errors \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel test --config=ci //ortools/... //examples/...
|
||||
|
||||
@@ -14,10 +14,11 @@ RUN echo "source /opt/rh/gcc-toolset-13/enable" >> /etc/bashrc
|
||||
SHELL ["/bin/bash", "--login", "-c"]
|
||||
|
||||
# Install Bazelisk
|
||||
ARG TARGETARCH=amd64
|
||||
RUN wget \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-amd64 \
|
||||
&& chmod +x bazelisk-linux-amd64 \
|
||||
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${TARGETARCH} \
|
||||
&& chmod +x bazelisk-linux-${TARGETARCH} \
|
||||
&& mv bazelisk-linux-${TARGETARCH} /usr/local/bin/bazel
|
||||
|
||||
# Install Java
|
||||
RUN dnf -y update \
|
||||
@@ -38,13 +39,7 @@ COPY . .
|
||||
|
||||
FROM devel AS build
|
||||
RUN bazel version
|
||||
RUN bazel build \
|
||||
-c opt \
|
||||
--subcommands=true \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel build --config=ci //ortools/... //examples/...
|
||||
|
||||
FROM build AS test
|
||||
RUN bazel test \
|
||||
-c opt \
|
||||
--test_output=errors \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel test --config=ci //ortools/... //examples/...
|
||||
|
||||
@@ -15,16 +15,12 @@ RUN apt update -qq \
|
||||
&& apt clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Install Bazel
|
||||
RUN apt install -y apt-transport-https curl gnupg \
|
||||
&& curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg \
|
||||
&& mv bazel-archive-keyring.gpg /usr/share/keyrings
|
||||
# Install Bazelisk
|
||||
ARG TARGETARCH=amd64
|
||||
RUN echo "deb [arch=$TARGETARCH signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
|
||||
RUN apt update -qq \
|
||||
&& apt install -yq bazel \
|
||||
&& apt clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
RUN wget \
|
||||
https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${TARGETARCH} \
|
||||
&& chmod +x bazelisk-linux-${TARGETARCH} \
|
||||
&& mv bazelisk-linux-${TARGETARCH} /usr/local/bin/bazel
|
||||
|
||||
FROM env AS devel
|
||||
WORKDIR /home/project
|
||||
@@ -32,13 +28,7 @@ COPY . .
|
||||
|
||||
FROM devel AS build
|
||||
RUN bazel version
|
||||
RUN bazel build \
|
||||
-c opt \
|
||||
--subcommands=true \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel build --config=ci //ortools/... //examples/...
|
||||
|
||||
FROM build AS test
|
||||
RUN bazel test \
|
||||
-c opt \
|
||||
--test_output=errors \
|
||||
//ortools/... //examples/...
|
||||
RUN bazel test --config=ci //ortools/... //examples/...
|
||||
|
||||
Reference in New Issue
Block a user