LF08/jenkinsfile
Yadciel 47ceeca0cd _
2023-05-11 20:04:04 +02:00

45 lines
1.1 KiB
Plaintext

pipeline {
agent {
label 'python' // Uses the Jenkins agent with the label 'python'
}
stages {
stage('Build') {
steps {
bat """
@echo off
rem Set the path to the workspace directory
cd C:/Program Files/jenkins-agent/workspace/TS
rem Delete the "dist" folder if it exists
if exist dist rmdir /s /q dist
rem Use PyInstaller to compile the Python application into a single executable file
python -m PyInstaller --onefile main.py
rem Move the "resources" folder into the "dist" folder
move resources dist
rem Output a success message
echo Resources folder was successfully moved to the dist folder.
"""
}
}
stage('SCM') {
steps {
checkout scm
}
}
stage('SonarQube Analysis') {
steps {
script {
def scannerHome = tool(name: 'SonarScanner');
withSonarQubeEnv(installationName: 'SonarScanner') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
}
}
}