Hello all i am currently trying to build the flutter app with jenkins. for the initial setup what i have done is there is master-slave setup in which the slave is mac machine which will create the build(slave machine is connected as well). Below is the pipeline script:
pipeline {
agent {
label "macos16Node"
}
environment {
flutter = " /Users/username/Desktop/flutter"
}
stages {
stage ('Flutter Doctor') {
steps {
withEnv(['PATH+EXTRA=/opt/flutter/bin']){
sh '$flutter doctor -v'
}
}
}
stage('GIT PULL') {
steps {a
git branch: 'main', credentialsId: 'github_token', url: ‘mygitrepo’
}
}
stage('TEST') {
steps {
sh ‘$flutter test'
}
}
stage('BUILD') {
steps {
sh '''
#!/bin/sh
flutter build apk --debug
'''
}
}
}
}
when ever i build the pipeline it gives me the error
Following is the console output:
[Pipeline] Start of Pipeline
[Pipeline] node
Running on slaveNode in /var/root/workspace/first pipeline
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Flutter Doctor)
[Pipeline] withEnv
[Pipeline] {
[Pipeline] sh
+ /Users/user/Desktop/flutter doctor -v
/var/root/workspace/first pipeline@tmp/durable-f6dbaa4a/script.sh: 1: /Users/user/Desktop/flutter: not found
I have also not set any path in the env variables in jenkins. If any one can let me know why it does not detect flutter, or do i need and additional setup for this one.