]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CI: refactor OpenTracing build script
authorIlya Shipitsin <chipitsine@gmail.com>
Sat, 15 Jan 2022 09:23:37 +0000 (14:23 +0500)
committerWilly Tarreau <w@1wt.eu>
Wed, 19 Jan 2022 06:37:40 +0000 (07:37 +0100)
re-use scripts/build-ot.sh in CI again. Bump opentracing-cpp to 1.6.0

.github/workflows/vtest.yml
scripts/build-ot.sh

index d24c3fffaef171ed3ce2506ff54968f5d4c93bd4..d748ee28fd29bc0f6c64b281887b568e59e2df8b 100644 (file)
@@ -42,7 +42,7 @@ jobs:
       TMPDIR: /tmp
       # Force ASAN output into asan.log to make the output more readable.
       ASAN_OPTIONS: log_path=asan.log
-      OT_CPP_VERSION: 1.5.0
+      OT_CPP_VERSION: 1.6.0
     steps:
     - uses: actions/checkout@v2
       with:
@@ -78,20 +78,7 @@ jobs:
     - name: Install OpenTracing libs
       if: ${{ contains(matrix.FLAGS, 'USE_OT=1') && steps.cache_ot.outputs.cache-hit != 'true'  }}
       run: |
-        wget https://github.com/opentracing/opentracing-cpp/archive/v${OT_CPP_VERSION}.tar.gz
-        tar xf v${OT_CPP_VERSION}.tar.gz
-        cd opentracing-cpp-${OT_CPP_VERSION}
-        mkdir build
-        cd build
-        cmake -DCMAKE_INSTALL_PREFIX=${HOME}/opt-ot -DBUILD_STATIC_LIBS=OFF -DBUILD_MOCKTRACER=OFF -DBUILD_TESTING=OFF ..
-        make -j$(nproc)
-        make install
-        git clone https://github.com/haproxytech/opentracing-c-wrapper.git
-        cd opentracing-c-wrapper
-        ./scripts/bootstrap
-        ./configure --prefix=${HOME}/opt-ot --with-opentracing=${HOME}/opt-ot
-        make -j$(nproc)
-        make install
+        OT_PREFIX=${HOME}/opt-ot scripts/build-ot.sh
     - name: Build WURFL
       if: ${{ contains(matrix.FLAGS, 'USE_WURFL=1') }}
       run: make -C addons/wurfl/dummy
index 1c296b64b29c1287b40a0421588515c14ca11dcd..fb128b39023ac993297dced1477c86ebc98e02cc 100755 (executable)
@@ -6,29 +6,22 @@
 
 set -e
 
-export OT_CPP_VERSION=1.5.0
+OT_CPP_VERSION="${OT_CPP_VERSION:-1.6.0}"
+OT_PREFIX="${OT_PREFIX:-${HOME}/opt}"
 
-if [ ! -f "download-cache/v${OT_CPP_VERSION}.tar.gz" ]; then
-    wget -P download-cache/ \
-        "https://github.com/opentracing/opentracing-cpp/archive/v${OT_CPP_VERSION}.tar.gz"
-fi
+wget -P download-cache/ "https://github.com/opentracing/opentracing-cpp/archive/v${OT_CPP_VERSION}.tar.gz"
 
-if [ "$(cat ${HOME}/opt/.ot-cpp-version)" != "${OT_CPP_VERSION}" ]; then
-    tar xf download-cache/v${OT_CPP_VERSION}.tar.gz
-    cd opentracing-cpp-${OT_CPP_VERSION}
-    mkdir build
-    cd build
-    cmake -DCMAKE_INSTALL_PREFIX=${HOME}/opt -DBUILD_STATIC_LIBS=OFF -DBUILD_MOCKTRACER=OFF -DBUILD_TESTING=OFF ..
-    make -j$(nproc)
-    make install
-    echo "${OT_CPP_VERSION}" > "${HOME}/opt/.ot-cpp-version"
-fi
+tar xf download-cache/v${OT_CPP_VERSION}.tar.gz
+cd opentracing-cpp-${OT_CPP_VERSION}
+mkdir build
+cd build
+cmake -DCMAKE_INSTALL_PREFIX=${OT_PREFIX} -DBUILD_STATIC_LIBS=OFF -DBUILD_MOCKTRACER=OFF -DBUILD_TESTING=OFF ..
+make -j$(nproc)
+make install
 
 git clone https://github.com/haproxytech/opentracing-c-wrapper.git
 cd opentracing-c-wrapper
  ./scripts/bootstrap
- ./configure --prefix=${HOME}/opt --with-opentracing=${HOME}/opt
+ ./configure --prefix=${OT_PREFIX} --with-opentracing=${OT_PREFIX}
  make -j$(nproc)
  make install
-
-