Home > front end >  Jenkins - Get System Variables in which Jenkins is installed for Flutter Build
Jenkins - Get System Variables in which Jenkins is installed for Flutter Build

Time:08-13

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.

CodePudding user response:

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'
  }
}
  • Related