From 40a611585e397ff600ae7ab9c34c2c9b3bc19786 Mon Sep 17 00:00:00 2001 From: Martin Folkerts Date: Tue, 30 Jan 2024 16:06:55 +0100 Subject: [PATCH] minor changes to build_report.sh --- build_report.sh | 14 ++++++++++---- laravel_app/app/Jobs/ProjectReportGeneratorJob.php | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/build_report.sh b/build_report.sh index e04fbac..c5a3c71 100755 --- a/build_report.sh +++ b/build_report.sh @@ -30,8 +30,14 @@ echo "Filename: $filename" echo "Weeks ago: $weeks_ago" echo "Report date: $report_date" -echo '\n' - -echo 'zx28tb' | /usr/bin/sudo -S launchctl load -w /System/Library/LaunchAgents/com.apple.fontd.useragent.plist -cd /Users/mfolkerts/smartCane/r_app +if [ "$(uname)" == "Darwin" ]; then + # Commando's voor Mac + echo 'zx28tb' | /usr/bin/sudo -S launchctl load -w /System/Library/LaunchAgents/com.apple.fontd.useragent.plist + cd /Users/mfolkerts/smartCane/r_app +elif [ "$(uname)" == "Linux" ]; then + # Commando's voor Linux + cd /var/www/vhosts/smartcane.sobit.nl/r_app +else + echo "Onbekend systeem" +fi Rscript -e "rmarkdown::render('CI_report_dashboard_planet.Rmd', output_file='$filename', params=list(ref='$ref', report_date='$report_date'))" \ No newline at end of file diff --git a/laravel_app/app/Jobs/ProjectReportGeneratorJob.php b/laravel_app/app/Jobs/ProjectReportGeneratorJob.php index f4ac9fa..dabba42 100644 --- a/laravel_app/app/Jobs/ProjectReportGeneratorJob.php +++ b/laravel_app/app/Jobs/ProjectReportGeneratorJob.php @@ -49,7 +49,7 @@ public function handle(): void $process = new Process($command); $process->setTimeout(220); - $currentPath = '/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin/Users/mfolkerts/anaconda3/bin:/Library/Apple/usr/bin'; + $currentPath = '/usr/bin:/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin/Users/mfolkerts/anaconda3/bin:/Library/Apple/usr/bin'; $process->setEnv(['PATH' => $currentPath.':/usr/local/Cellar/pandoc/3.1.8/bin/pandoc']); // $process->setTimeout(36000); // stel een geschikte timeout in