Skip to content

Commit a3ead20

Browse files
authored
Update centos build for weekly security test (#724)
Add LD_PRELOAD var to centos build.Add missed flags. Remove not needed flag. Switched from cmake to make. Make shell using latest curl. Fix archiving. Relates-TO: OLPEDGE-1725, OLPEDGE-896 Signed-off-by: Yaroslav Stefinko <[email protected]>
1 parent fc00797 commit a3ead20

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.gitlab-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ wv_security_job:
1515
tags:
1616
- docker-prod
1717
image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE_SECURITY}:${DOCKER_IMAGE_SECURITY_VERSION}
18+
variables:
19+
LD_PRELOAD: "/lib64/libSegFault.so"
20+
SEGFAULT_SIGNALS: "all"
1821
script:
1922
- $CI_PROJECT_DIR/scripts/linux/weekly/build_centos_debug_wv.sh --centos
2023
- $CI_PROJECT_DIR/scripts/linux/weekly/security_scanner_upload_wv.sh build/binaries.tar.gz [email protected]

scripts/linux/weekly/build_centos_debug_wv.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ export BUILD_DIR="$WORKSPACE/$BUILD_DIR_NAME"
3131
export ARCHIVE_FILE_NAME="binaries.tar.gz" # artifact name is defined by CI so please do not rename it
3232
export BUILD_ZIP=1 # always build artifacts
3333

34-
export CMAKE_CXX_FLAGS="-march=x86-64 -gdwarf-2 -g3 -O0 -fno-builtin"
35-
export CMAKE_C_FLAGS="-march=x86-64 -gdwarf-2 -g3 -O0 -fno-builtin"
34+
export CMAKE_CXX_FLAGS="-march=x86-64 -gdwarf-2 -g3 -O0 -fno-builtin -Wall -Wextra -Werror -Wno-deprecated-declarations -Wno-unused-parameter -Wno-unused-function -Wno-attributes"
35+
export CMAKE_C_FLAGS="-march=x86-64 -gdwarf-2 -g3 -O0 -fno-builtin -Wall -Wextra -Werror -Wno-deprecated-declarations -Wno-unused-parameter -Wno-unused-function -Wno-attributes"
3636

3737
# Add more parameters into CMAKE_PARAM below when needed
3838
export FLAVOR="Debug"
3939
export CMAKE_PARAM="-DCMAKE_CXX_FLAGS=\"${CMAKE_CXX_FLAGS}\" -DCMAKE_C_FLAGS=\"${CMAKE_C_FLAGS}\" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=$FLAVOR -DOLP_SDK_BUILD_EXAMPLES=ON"
4040
export CMAKE_COMMAND="cmake ${CMAKE_PARAM} .."
41-
export CMAKE_BUILD_ALL_TARGETS="cmake --build . -- -j8"
41+
export CMAKE_BUILD_ALL_TARGETS="make -j$(nproc)"
4242

4343
# Function :
4444
build_for_centos() {
@@ -67,8 +67,7 @@ build_for_centos() {
6767
# Prepare artifacts archive for test job
6868
# Zip up all the binaries needed to run the tests but need to leave the tar.gz file in build
6969
# folder as this ensure the CI system archives it automatically
70-
tar -czf "${BUILD_DIR_NAME}/$ARCHIVE_FILE_NAME" --exclude='*.git' \
71-
"${BUILD_DIR_NAME}/olp-*/*.so"
70+
tar -czf "${BUILD_DIR_NAME}/$ARCHIVE_FILE_NAME" --exclude='*.git' --wildcards ${BUILD_DIR_NAME}/olp-*/*.so
7271
# List files in build archive
7372
tar -tvf "${BUILD_DIR_NAME}/$ARCHIVE_FILE_NAME"
7473
fi

scripts/linux/weekly/security_scanner_upload_wv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ tar -tvf build/binaries.tar.gz
4646

4747
echo "Packed file: $1. Uploading it..."
4848

49-
curl -f -v -k -H"X-spc-${SECURITY_SCANNER}-username:${SECURITY_API_USER}" -H"X-spc-${SECURITY_SCANNER}-password:${SECURITY_API_PWD}" \
49+
/usr/local/bin/curl -f -v -k -H"X-spc-${SECURITY_SCANNER}-username:${SECURITY_API_USER}" -H"X-spc-${SECURITY_SCANNER}-password:${SECURITY_API_PWD}" \
5050
-H"X-spc-${SECURITY_SCANNER}-email:$2" -F"file=@$1" https://${SECURITY_API_URL}/${SECURITY_SCANNER}-ws/analysis/start/454830/version/edge-sdk-cpp-${LATEST_HASH}
5151

5252
echo "File $1 was uploaded to Security Scanner via API"

0 commit comments

Comments
 (0)