Skip to content

Commit 7f18fb5

Browse files
authored
Merge pull request #5369 from npinaeva/ovs-build
[OVN build] Fetch ovs package from the ovn submodule.
2 parents 99fecd7 + 7b1b7dd commit 7f18fb5

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

dist/images/Dockerfile.fedora

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,28 @@ ENV PYTHONDONTWRITEBYTECODE yes
2424
RUN INSTALL_PKGS="git rpm-build dnf-plugins-core" && \
2525
dnf install --best --refresh -y --setopt=tsflags=nodocs $INSTALL_PKGS
2626

27+
# Clone OVN Source Code.
28+
ARG OVN_REPO=https://github.com/ovn-org/ovn.git
29+
ARG OVN_GITREF=main
30+
WORKDIR /root
31+
RUN mkdir ovn && pushd ovn && \
32+
git init && \
33+
git remote add origin $OVN_REPO && \
34+
git fetch origin ${OVN_GITREF} --depth 1 && \
35+
git reset --hard FETCH_HEAD && \
36+
popd
37+
2738
# Clone OVS Source Code.
2839
ARG OVS_REPO=https://github.com/openvswitch/ovs.git
29-
ARG OVS_GITREF=branch-*
40+
# OVS_GITREF can be set to a specific commit or branch, otherwise the version pinned by OVN will be used.
41+
ARG OVS_GITREF=""
3042
WORKDIR /root
31-
RUN mkdir ovs && pushd ovs && \
43+
RUN OVS_OVN_GITREF=$(cd ovn && git submodule status ovs|cut -c 2-|cut -d ' ' -f 1) && \
44+
mkdir ovs && pushd ovs && \
3245
git init && \
3346
git remote add origin $OVS_REPO && \
34-
git fetch $OVS_REPO $(git ls-remote origin "${OVS_GITREF}" | sort -V -k2 | tail -1 | awk '{print $1}') --depth 1 && \
47+
OVS_GITREF="${OVS_GITREF:-$OVS_OVN_GITREF}" && \
48+
git fetch $OVS_REPO ${OVS_GITREF} --depth 1 && \
3549
git reset --hard FETCH_HEAD && \
3650
echo "1" && \
3751
find rhel && \
@@ -48,16 +62,6 @@ RUN rm rpm/rpmbuild/RPMS/x86_64/*debug*
4862
RUN rm rpm/rpmbuild/RPMS/x86_64/*devel*
4963
RUN git log -n 1
5064

51-
# Clone OVN Source Code.
52-
ARG OVN_REPO=https://github.com/ovn-org/ovn.git
53-
ARG OVN_GITREF=main
54-
WORKDIR /root
55-
RUN mkdir ovn && pushd ovn && \
56-
git init && \
57-
git remote add origin $OVN_REPO && \
58-
git fetch origin ${OVN_GITREF} --depth 1 && \
59-
git reset --hard FETCH_HEAD && \
60-
popd
6165

6266
# Build OVN rpms.
6367
WORKDIR /root/ovn/

0 commit comments

Comments
 (0)