@@ -24,14 +24,28 @@ ENV PYTHONDONTWRITEBYTECODE yes
2424RUN 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.
2839ARG 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=""
3042WORKDIR /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*
4862RUN rm rpm/rpmbuild/RPMS/x86_64/*devel*
4963RUN 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.
6367WORKDIR /root/ovn/
0 commit comments