Issue
I want to build a flutter application using jenkins. But in the pipeline script, so I installed jenkins in my system. For building the app, I created a job and a pipeline. Inside the pipeline I want to run the commands like 'flutter devices, flutter build etc', is it possible. jenkins is not able to recognize these commands. My shell can find those commands and build the app. what is going wrong.
Solution
Yes you can. Try setting your PATH like below within your pipeline.
environment {
PATH="FLUTTER_PATH:${env.PATH}
}
Or
steps {
withEnv(["PATH+FLUTTER=FLUTTER_PATH"]) {
echo "PATH is: $PATH"
sh 'flutter'
}
}
Answered By - ycr
Answer Checked By - Mary Flores (JavaFixing Volunteer)