Kettenoeler/Jenkinsfile

94 lines
2.4 KiB
Groovy
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

pipeline {
agent any
environment {
BUILD_ENV = "pcb_rev_1-4_serial"
PIO_HOME_DIR = "${WORKSPACE}/.pio"
}
parameters {
choice(
name: 'BUILD_ENV',
choices: ['pcb_rev_1-2_serial', 'pcb_rev_1-3_serial', 'pcb_rev_1-4_serial'],
description: 'Firmware-Umgebung auswählen'
)
}
stages {
stage('🧹 Cleanup') {
steps {
deleteDir()
}
}
stage('🧰 Setup PlatformIO') {
steps {
dir('Software') {
sh """
#!/bin/bash
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip platformio
"""
}
}
}
stage('📄 Dummy WiFi-Creds') {
steps {
dir('Software') {
writeFile file: 'wifi_credentials.ini', text: '''
[wifi_cred]
wifi_ssid_client = DummySSID
wifi_password_client = DummyPass
admin_password = Admin123
wifi_ap_password = DummyAP
'''.stripIndent()
}
}
}
stage('🧪 Build Firmware') {
steps {
dir('Software') {
sh """
#!/bin/bash
source .venv/bin/activate
platformio run -e ${params.BUILD_ENV}
"""
}
}
}
stage('📦 Archive Firmware') {
steps {
archiveArtifacts artifacts: "Software/.pio/build/${params.BUILD_ENV}/firmware.bin", fingerprint: true
}
}
stage('🔌 Flash Hardware (Dummy)') {
steps {
echo "TODO: Flash-Script aufrufen, z.B.: python3 Hardware/flash.py /dev/ttyUSB0"
}
}
stage('🧠 Run Tests (Dummy)') {
steps {
dir('Testing') {
echo "TODO: Testing mit z.B.: python3 test_runner.py oder pytest starten"
}
}
}
}
post {
success {
echo "✅ CI abgeschlossen Firmware gebaut, Dummy-Stages vorbereitet"
}
failure {
echo "❌ Fehler im Build schau in die Logs, Commander Seraphon"
}
}
}