GitLab Pipeline Sample Code
The sample code is as follows:
stages:
- build
- migrating-applications
source-code-migration:
stage: migrating-applications
tags:
- kunpeng_scanner # This is the tag used during gitlab-runner registration. Multiple tags may be selected.
script:
- echo '====== Source code porting ======'
# Example: devkit porting src-mig -i /home/TestData/wtdbg2-2.5 -c make -r html || [ $? -eq 1 ] && echo 'Warning: The scan report contains suggestion items.
- devkit porting src-mig -i path to the source code folder or package to be scanned -c source code build command -r html || [ $? -eq 1 ] && echo 'Warning: The scan report contains suggestion items.
- mv ./src-mig*.html ./SourceCodeScanningReport.html
artifacts:
paths:
- SourceCodeScanningReport.html
name: src-mig
- When using the source code porting function, you are advised to port a source code file before the build process, or scan a software package after the build process.
- /home/TestData/wtdbg2-2.5 indicates the path to the source code folder or package to be scanned. Replace it with the actual path.
- For details about the source code porting report, see Viewing Analysis Results.
Parent topic: Source Code Porting