Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - add ci to ndt #89

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 9 additions & 25 deletions plugins/UFM_NDT_Plugin/.ci/ci_matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ credentials:
volumes:
- {mountPath: /var/run/docker.sock, hostPath: /var/run/docker.sock}
runs_on_dockers:
- {file: '.ci/Dockerfile_static_tests_ub2004', arch: 'x86_64', name: 'swx_static', tag: 'latest'}
- {file: 'plugins/UFM_NDT_Plugin/.ci/Dockerfile_static_tests_ub2004', arch: 'x86_64', name: 'swx_static', tag: 'latest'}
runs_on_agents:
- nodeLabel: 'UFM-POC'

Expand Down Expand Up @@ -50,32 +50,17 @@ steps:
enable: false


- name: Running Bandit
containerSelector: "{name: 'swx_static'}"
shell: '#!/bin/bash -x'
run: |
pwd
mkdir $WORKSPACE/logs/
lst=$(git diff --name-status remotes/origin/$ghprbTargetBranch | grep -v ^D | awk '{print $NF}' |grep ".py$")
if [ "$lst" == "" ]; then
echo "No *.py changed files" > $WORKSPACE/logs/bandit.html
else
/usr/local/bin/bandit -lll -f html -c $WORKSPACE/.ci/bandit.yaml ${lst} > $WORKSPACE/logs/bandit.html || true
fi
parallel: true
archiveArtifacts: 'logs/*'

- name: build Plugin
agentSelector: "{nodeLabel: 'UFM-POC'}"
run: |
cd build
cd plugins/UFM_NDT_Plugin/build
bash -x ./docker_build.sh
cp /ufm-plugin-ndt* /auto/UFM/tmp/${JOB_NAME}/${BUILD_ID}/
parallel: false

- name: remove plugin start
agentSelector: "{nodeLabel: 'UFM-POC'}"
run: .ci/do_remove_plugin.sh
run: plugins/UFM_NDT_Plugin/.ci/do_remove_plugin.sh
parallel: false


Expand All @@ -84,19 +69,19 @@ steps:
credentialsId: '2c8fd3fe-df05-4f6f-9d1f-f1896d611434'
run: |
export PASSWORD=$PASSWORD
.ci/do_install_plugin_server.sh
plugins/UFM_NDT_Plugin/.ci/do_install_plugin_server.sh
parallel: false

- name: load plugin
agentSelector: "{nodeLabel: 'UFM-POC'}"
run: |
service opensmd start
.ci/do_load_plugin.sh
plugins/UFM_NDT_Plugin/.ci/do_load_plugin.sh
parallel: false

- name: add plugin
agentSelector: "{nodeLabel: 'UFM-POC'}"
run: .ci/do_add_plugin.sh
run: plugins/UFM_NDT_Plugin/.ci/do_add_plugin.sh
parallel: false


Expand All @@ -106,21 +91,20 @@ steps:
service rsyslog restart
sleep 30
export SERVER_HOST=$SERVER_HOST
cd tests
python3 ndt_plugin_test.py --host $SERVER_HOST
python3 ./plugins/UFM_NDT_Plugin/tests/ndt_plugin_test.py --host $SERVER_HOST
parallel: false

- name: get ndt logs
agentSelector: "{nodeLabel: 'UFM-POC'}"
run: |
mkdir $WORKSPACE/logs/
.ci/do_get_logs.sh
plugins/UFM_NDT_Plugin/.ci/do_get_logs.sh
archiveArtifacts: 'logs/ndt.log'
parallel: false

- name: remove plugin end
agentSelector: "{nodeLabel: 'UFM-POC'}"
run: .ci/do_remove_plugin.sh
run: plugins/UFM_NDT_Plugin/.ci/do_remove_plugin.sh
parallel: false


Expand Down
13 changes: 7 additions & 6 deletions plugins/UFM_NDT_Plugin/build/docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ function build_docker_image()

echo "Updating the git submodules..."
pushd ${PARENT_DIR}
git submodule update --init --remote
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "The git submodules wasn't updated successfully, please make sure that you have the correct access"
return $exit_code
fi
whoami
# git submodule update --init --remote
# exit_code=$?
# if [ $exit_code -ne 0 ]; then
# echo "The git submodules wasn't updated successfully, please make sure that you have the correct access"
# return $exit_code
# fi
popd

pushd ${SCRIPT_DIR}
Expand Down