LF08/jenkinsfile

45 lines
1.1 KiB
Plaintext
Raw Normal View History

2023-04-26 10:13:42 +02:00
pipeline {
2023-04-26 10:59:56 +02:00
agent {
2023-04-27 10:10:20 +02:00
label 'python' // Uses the Jenkins agent with the label 'python'
2023-04-26 10:59:56 +02:00
}
2023-04-26 10:13:42 +02:00
stages {
stage('Build') {
steps {
bat """
@echo off
2023-04-27 10:10:20 +02:00
rem Set the path to the workspace directory
cd C:/Program Files/jenkins-agent/workspace/TS
2023-04-26 10:13:42 +02:00
2023-04-27 10:10:20 +02:00
rem Delete the "dist" folder if it exists
2023-04-27 09:58:50 +02:00
if exist dist rmdir /s /q dist
2023-04-27 10:10:20 +02:00
rem Use PyInstaller to compile the Python application into a single executable file
2023-04-27 09:53:48 +02:00
python -m PyInstaller --onefile main.py
2023-04-27 09:47:26 +02:00
2023-04-27 10:10:20 +02:00
rem Move the "resources" folder into the "dist" folder
move resources dist
2023-04-26 10:13:42 +02:00
2023-04-27 10:10:20 +02:00
rem Output a success message
echo Resources folder was successfully moved to the dist folder.
2023-04-26 10:13:42 +02:00
"""
}
2023-05-11 19:55:14 +02:00
}
stage('SCM') {
steps {
checkout scm
2023-05-11 19:41:32 +02:00
}
2023-05-11 19:55:14 +02:00
}
stage('SonarQube Analysis') {
steps {
script {
2023-05-11 20:09:31 +02:00
def scannerHome = tool 'SQ'; // Use the name you configured in Jenkins
withSonarQubeEnv(installationName: 'SQ') { // Use the same name here
sh "${scannerHome}/bin/sonar-scanner"
}
2023-05-11 19:55:14 +02:00
}
2023-05-11 19:41:32 +02:00
}
2023-04-26 10:13:42 +02:00
}
}
2023-05-11 19:55:14 +02:00
}
2023-05-11 20:04:04 +02:00