Skip to content

Commit 1484761

Browse files
committed
[CI] issue: HPCINFRA-3964 add Blackduck step to release job
Signed-off-by: Noam Tsemah <[email protected]>
1 parent 9e1d79d commit 1484761

File tree

3 files changed

+38
-7
lines changed

3 files changed

+38
-7
lines changed

.ci/blackduck_source.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@ cd "$topdir"
55

66
# Check if the variables and pipeline attributes are set
77
[[ -z "${WORKSPACE}" ]] && { echo "Error: WORKSPACE variable is not set"; exit 1; }
8-
[[ -z "$BLACKDUCK_API_TOKEN" ]] && { echo "Error: BLACKDUCK_API_TOKEN variable is not set"; exit 1; }
8+
[[ -z "${BLACKDUCK_API_TOKEN}" ]] && { echo "Error: BLACKDUCK_API_TOKEN variable is not set"; exit 1; }
99
[[ ! -d "${WORKSPACE}/logs" ]] && mkdir -p "${WORKSPACE}/logs"
1010

1111
# Create valid JSON for further authentication in BlackDuck server
1212
json=$(jq -n \
13-
--arg token "$BLACKDUCK_API_TOKEN" \
13+
--arg token "${BLACKDUCK_API_TOKEN}" \
1414
'{"blackduck.url": "https://blackduck.mellanox.com/", "blackduck.api.token": $token }')
1515

1616
export SPRING_APPLICATION_JSON="$json"
1717
export PROJECT_NAME=libxlio
18-
export PROJECT_VERSION="$sha1"
18+
export PROJECT_VERSION="${sha1}"
1919
export PROJECT_SRC_PATH="$topdir"/
2020

21-
echo "Running BlackDuck (SRC) on $name"
21+
echo "Running BlackDuck (SRC) on ${name}"
2222

2323
echo "CONFIG:"
2424
echo " NAME: ${PROJECT_NAME}"
2525
echo " VERSION: ${PROJECT_VERSION}"
2626
echo " SRC_PATH: ${PROJECT_SRC_PATH}"
2727

2828
[[ -d /tmp/blackduck ]] && rm -rf /tmp/blackduck
29-
sudo -u swx-jenkins git clone -c core.sshCommand="ssh -i ~/.ssh/id_ed25519" -b master --single-branch --depth=1 ssh://git-nbu.nvidia.com:12023/DevOps/Tools/blackduck /tmp/blackduck
29+
git clone -c core.sshCommand="ssh -i ~/.ssh/id_ed25519" -b master --single-branch --depth=1 ssh://git-nbu.nvidia.com:12023/DevOps/Tools/blackduck /tmp/blackduck
3030
cd /tmp/blackduck
3131

3232
# disable check errors

.ci/pipeline/release_jjb.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
name: "do_release"
3636
default: true
3737
description: "Release build packges into the release folder, set to false for debugging"
38+
- bool:
39+
name: "do_blackduck"
40+
default: true
41+
description: "Run BlackDuck."
3842
- string:
3943
name: "notification_email"
4044
default: "{jjb_release_email}"

.ci/pipeline/release_matrix_job.yaml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ kubernetes:
1515
arch_table:
1616
x86_64:
1717
nodeSelector: 'kubernetes.io/arch=amd64'
18-
jnlpImage: 'harbor.mellanox.com/toolbox/c3po-jnlp:latest'
18+
jnlpImage: 'nbu-harbor.gtm.nvidia.com/toolbox/c3po-jnlp:latest'
19+
20+
credentials:
21+
- {credentialsId: 'blackduck_api_token', type: 'string', variable: 'BLACKDUCK_API_TOKEN'}
1922

2023
env:
2124
MAIL_FROM: [email protected]
@@ -35,22 +38,46 @@ runs_on_dockers:
3538
arch: 'x86_64',
3639
tag: '20250304'
3740
}
38-
41+
- {
42+
file: '.ci/dockerfiles/Dockerfile.rhel8.6',
43+
arch: 'x86_64',
44+
name: 'xlio_static.bduck',
45+
uri: '$arch/$name',
46+
tag: '20250418',
47+
build_args: '--no-cache --target bduck',
48+
category: 'tool',
49+
runAsUser: '6213',
50+
runAsGroup: '101'
51+
}
3952

4053
steps:
4154
- name: Build-dpcp
4255
parallel: false
56+
containerSelector:
57+
- "{name: 'rhel8.6'}"
4358
run: |
4459
git clone https://github.com/Mellanox/libdpcp.git libdpcp
4560
cd libdpcp
4661
./autogen.sh && ./configure --prefix=/usr && sudo make install
4762
4863
- name: Release
4964
parallel: false
65+
containerSelector:
66+
- "{name: 'rhel8.6'}"
5067
run: |
5168
.ci/do_release.sh
5269
archiveArtifacts: "**/build_pkg.log,**/packages/*.rpm"
5370

71+
- name: Blackduck
72+
enable: ${do_blackduck}
73+
parallel: false
74+
containerSelector:
75+
- "{name: 'xlio_static.bduck', category:'tool'}"
76+
run: |
77+
.ci/blackduck_source.sh
78+
archiveArtifacts: 'logs/'
79+
credentialsId: 'blackduck_api_token'
80+
5481
pipeline_start:
5582
shell: action
5683
module: groovy

0 commit comments

Comments
 (0)