Ionic command doesn't works for jenkins job

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Ionic command doesn't works for jenkins job

Francesco Sisca
Hello everyone, i'm in trouble about some jenkins stuff.

I have a hybrid application, and i need to setup automatic build for that. i follow those steps to build the app.

npm i
ionic cordova platform add android --no-interactive
ionic cordova build android --prod --no-interactive

and that's works fine. But when i put this commands into a build.sh file, and put this file into Jenkins "shell command", when i run "build" into jenkins, i get an error "ionic: command not found".

I'm working on MacOS, and Jenkins have a separate User. Of Course, from CLI, all works fine.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/056ae4f1-8b84-48a2-878d-62f360f97580%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ionic command doesn't works for jenkins job

Victor Martinez
It sounds a kind of environmental issue with the PATH env variable. You can confirm how that particular PATH env variable looks like in your local and also within Jenkins, then you can set it accordingly,.

Cheers

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/7ece0ed9-230b-4c68-9b6c-31727e380ad3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ionic command doesn't works for jenkins job

Francesco Sisca

Thanks for the answer!

this is  ENV PATH for the owner (masdev).



Mac-mini-di-masdev:mobilehub-reference-application masdev$ echo $PATH

/Users/masdev/.rvm/gems/ruby-2.4.2/bin:/Users/masdev/.rvm/gems/ruby-2.4.2@global/bin:/Users/masdev/.rvm/rubies/ruby-2.4.2/bin:~/.npm-global/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/masdev/Library/Android/sdk/tools:/Users/masdev/Library/Android/sdk/platform-tools:/Users/masdev/Downloads/apache-maven-3.5.2/bin:/Users/masdev/.rvm/bin


while ENV PATH on the jenkins user (Jenkins) is this  



how i fix this?


Il giorno lunedì 8 gennaio 2018 17:36:51 UTC+1, Victor Martinez ha scritto:
It sounds a kind of environmental issue with the PATH env variable. You can confirm how that particular PATH env variable looks like in your local and also within Jenkins, then you can set it accordingly,.

Cheers

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/819bdaaf-501f-4195-badb-6cc0f827cb72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ionic command doesn't works for jenkins job

Victor Martinez
It looks like this is not an issue within Jenkins itself but the agent configuration. I'm afraid you need to install all the specific requirements in the agent and I'm not sure if those env variables refers to the same machine or two different ones.
Therefore, whoever owns that particular agent might help you to set it up accordingly, just in case they use any kind of configuration management tool. In case you need to bypass the above, you can append to the PATH env variable with the path to that particular ionic binary before running any shell stuff


Something like :

PATH=$PATH:<ionic-absolute-path>
<then the rest of ionic commands you run>

My two cents

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a174f245-f4fe-4379-acdc-4a399912d354%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Ionic command doesn't works for jenkins job

Francesco Sisca
ok thanks for the advice

Il giorno lunedì 8 gennaio 2018 20:11:57 UTC+1, Victor Martinez ha scritto:
It looks like this is not an issue within Jenkins itself but the agent configuration. I'm afraid you need to install all the specific requirements in the agent and I'm not sure if those env variables refers to the same machine or two different ones.
Therefore, whoever owns that particular agent might help you to set it up accordingly, just in case they use any kind of configuration management tool. In case you need to bypass the above, you can append to the PATH env variable with the path to that particular ionic binary before running any shell stuff


Something like :

PATH=$PATH:<ionic-absolute-path>
<then the rest of ionic commands you run>

My two cents

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/dbb26491-7c07-4191-887d-ecdef8d0679e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.