wpilibsuite/wpilib-docs
Document GradleRIO predeploy task for running commands before robot program deploy and start
開放
#1,150 建立於 2021年1月25日
Component: WPILibJ/WPILibCHelp WantedType: New Article
倉庫指標
- 星標
- (187 顆星)
- PR 合併指標
- (平均合併 7天 6小時) (30 天內合併 14 個 PR)
描述
The following gradle-fu I learned from @ThadHouse is very useful for running commands as admin on the roboRIO before the robot program deploys and starts. We should document it. (Note that the robot program is deleted at this point.)
deploy {
...
artifacts {
frcNativeArtifact('frcCpp') {
...
predeploy << {
// Give RT capability
it.execute('setcap cap_sys_nice+eip /home/lvuser/frcUserProgram')
// Disable crond because it uses 50% CPU and there's no cronjobs to run
it.execute('/etc/init.d/crond stop')
// Disable NI web server because it leaks memory badly
it.execute('/usr/local/natinst/etc/init.d/systemWebServer stop')
// Compress old log files
it.execute('find . -type f | grep \\.csv$ | xargs -d \\n gzip -q')
}
}