LF08/jenkinsfile

29 lines
769 B
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-04-27 10:10:20 +02:00
}