Compare commits
No commits in common. "876fd3b84f73bc1ce4b0b6fe418afcd9ca6c5b38" and "7117579c6b82df5a99043901df4ade64efb75d53" have entirely different histories.
876fd3b84f
...
7117579c6b
|
@ -1,20 +0,0 @@
|
||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
|
|
||||||
stages {
|
|
||||||
stage('Build') {
|
|
||||||
steps {
|
|
||||||
git branch: 'main', url: 'https://git.siwatsystem.com/ise-senior-iot/iot-firmware.git'
|
|
||||||
sh 'export PLATFORMIO_PATH=/root/.platformio/penv/bin/platformio'
|
|
||||||
sh '/usr/bin/python3 gen_release.py'
|
|
||||||
stash includes: 'release/**/*', name: 'release_binaries'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Publish') {
|
|
||||||
steps {
|
|
||||||
unstash 'release_binaries'
|
|
||||||
archiveArtifacts artifacts: 'release/**/*', fingerprint: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -19,23 +19,11 @@ current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
# Define the path to the firmware folder
|
# Define the path to the firmware folder
|
||||||
firmware_folder = os.path.join(current_dir, 'firmware')
|
firmware_folder = os.path.join(current_dir, 'firmware')
|
||||||
|
|
||||||
# Create the firmware folder if it does not exist
|
|
||||||
if not os.path.exists(firmware_folder):
|
|
||||||
os.makedirs(firmware_folder)
|
|
||||||
|
|
||||||
# Define the path to the release folder
|
# Define the path to the release folder
|
||||||
release_folder = os.path.join(current_dir, 'release')
|
release_folder = os.path.join(current_dir, 'release')
|
||||||
|
|
||||||
# Get the platformio path from environment variable
|
# Add the path to the PlatformIO executable to the system PATH
|
||||||
platformio_path = os.environ.get('PLATFORMIO_PATH')
|
platformio_path = os.path.expanduser('~/.platformio/penv/Scripts')
|
||||||
# If the environment variable is not set, use the default path
|
|
||||||
if platformio_path is None:
|
|
||||||
if platform.system() == 'Darwin':
|
|
||||||
platformio_path = os.path.expanduser('~/.platformio/penv/bin/platformio')
|
|
||||||
elif platform.system() == 'Windows':
|
|
||||||
platformio_path = os.path.expanduser('~/.platformio/penv/Scripts/platformio.exe')
|
|
||||||
elif platform.system() == 'Linux':
|
|
||||||
platformio_path = os.path.expanduser('~/.platformio/penv/bin/platformio')
|
|
||||||
|
|
||||||
if os.path.exists(release_folder):
|
if os.path.exists(release_folder):
|
||||||
# If the release folder exists, delete it
|
# If the release folder exists, delete it
|
||||||
|
@ -91,11 +79,11 @@ for environment in environments:
|
||||||
|
|
||||||
# if argument is not supplied, build all environments listed in platformio.ini
|
# if argument is not supplied, build all environments listed in platformio.ini
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
subprocess.run([f'{platformio_path}', 'run','-c',f'{firmware_folder}/platformio.ini'], cwd=current_dir)
|
subprocess.run([f'{platformio_path}/platformio.exe', 'run','-c',f'{firmware_folder}/platformio.ini'], cwd=current_dir)
|
||||||
|
|
||||||
for environment in environments:
|
for environment in environments:
|
||||||
if(len(sys.argv) > 1):
|
if(len(sys.argv) > 1):
|
||||||
subprocess.run([f'{platformio_path}', 'run', '-e', environment,'-c',f'{firmware_folder}/platformio.ini'], cwd=current_dir)
|
subprocess.run([f'{platformio_path}/platformio.exe', 'run', '-e', environment,'-c',f'{firmware_folder}/platformio.ini'], cwd=current_dir)
|
||||||
|
|
||||||
# Iterate over the subfolders in the firmware folder
|
# Iterate over the subfolders in the firmware folder
|
||||||
for subfolder in os.listdir(firmware_folder):
|
for subfolder in os.listdir(firmware_folder):
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
build_dir = firmware
|
build_dir = .\firmware
|
||||||
|
|
||||||
[env:full]
|
[env:full]
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
|
|
Loading…
Reference in New Issue