Skip to content

Commit

Permalink
tools: cron: add newt update job
Browse files Browse the repository at this point in the history
This job can be used before weekly runs to make sure newt is up to
date to avoid build or flash error
  • Loading branch information
piotrnarajowski committed Jan 16, 2025
1 parent 4660e47 commit 09793a3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tools/cron/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,4 +899,25 @@ def merge_db_job(cfg, **kwargs):
log(f'The {merge_db_job.__name__} Job finished')


def newt_update_job(cfg, **kwargs):
log(f'Started {newt_update_job.__name__} Job, config: {cfg}')

config = get_cron_config(cfg, **kwargs)

prj_path = config['auto_pts']['project_path']
newt_path = config['auto_pts']['newt_path']
newt_exe = '/home/codecoup/workspace/mynewt-newt/newt/newt'
which_newt = '/home/codecoup/bin/newt'

cmd = f'git pull origin && ./build.sh && mv {newt_exe} {which_newt}'
log(f'Running: {cmd}')
check_call(cmd.split(), cwd=newt_path)

cmd = 'newt upgrade'
log(f'Running: {cmd}')
check_call(cmd.split(), cwd=prj_path)

log(f'The {newt_update_job.__name__} Job finished')


set_run_test_fun(run_test)

0 comments on commit 09793a3

Please sign in to comment.