All checks were successful
CI-Build/Kettenoeler/pipeline/head This commit looks good
104 lines
3.1 KiB
Groovy
104 lines
3.1 KiB
Groovy
pipeline {
|
||
agent any
|
||
|
||
environment {
|
||
PIO_HOME_DIR = "${WORKSPACE}/.pio"
|
||
VENV_PATH = "${WORKSPACE}/Software/.venv"
|
||
}
|
||
stages {
|
||
|
||
stage('🧰 Setup PlatformIO') {
|
||
steps {
|
||
dir('Software') {
|
||
sh """
|
||
[ -d .venv ] || python3 -m venv .venv
|
||
${env.VENV_PATH}/bin/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 for All Environments') {
|
||
steps {
|
||
dir('Software') {
|
||
script {
|
||
def allEnvironments = ['pcb_rev_1-2_serial', 'pcb_rev_1-3_serial', 'pcb_rev_1-4_serial']
|
||
for (envName in allEnvironments) {
|
||
echo "🔧 Baue Firmware für: ${envName}"
|
||
sh "${env.VENV_PATH}/bin/platformio run -e ${envName}"
|
||
}
|
||
env.REPRESENTATIVE_ENV = allEnvironments[0]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
stage('📁 Build Filesystem') {
|
||
steps {
|
||
dir('Software') {
|
||
script {
|
||
echo "📁 Baue Filesystem für ${env.REPRESENTATIVE_ENV} (repräsentativ)"
|
||
sh "${env.VENV_PATH}/bin/platformio run -t buildfs -e ${env.REPRESENTATIVE_ENV}"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
stage('📦 Archive Firmware & FS') {
|
||
steps {
|
||
dir('Software') {
|
||
echo "🔍 Archiviere Artefakte (.fw.bin / .fs.gz)…"
|
||
archiveArtifacts artifacts: '.pio/build/**/*.fw.bin, .pio/build/**/*.fs.gz',
|
||
allowEmptyArchive: true,
|
||
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"
|
||
}
|
||
}
|
||
}
|
||
|
||
stage('🧹 Cleanup Build Output') {
|
||
steps {
|
||
dir('Software') {
|
||
sh "rm -rf .pio"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
post {
|
||
success {
|
||
echo "✅ CI abgeschlossen – Firmware gebaut, Dummy-Stages bereit"
|
||
}
|
||
failure {
|
||
echo "❌ Fehler im Build – Logs checken, Commander Seraphon"
|
||
}
|
||
}
|
||
}
|