Build an ionic app on a Jenkins mac slave


#1

Hi everyone,
Here’s my problem : i’m currently creating an ionic app on android and iOS. I’ve recently decided to build my app with Jenkins. To build the app for iOS, i’ve set a mac slave, on which their’s a workspace for Jenkins.
All the compiling environnement is set up with maven.
I’ve succeeded mutliple time to build the app on the Jenkins workspace with the command “ionic cordova build ios --prod --release”
When Jenkins launch a build, it also run “ionic cordova build ios --prod --release”, but failed every time with this exception :


"[09:45:14]  lint started ... 
[09:45:14]  build prod finished in 183.40 s 
> cordova build ios --release

path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.join (path.js:1251:7)
    at Object.<anonymous> (/Users/jenkinsnode/workspace/fe-trophy-app-front_develop-77CK5GUSIH5UUBVXYPQ7OXP6XA6JO4UMRJFKHDTFH7JX3ORNETWA/node_modules/cordova-lib/src/cordova/util.js:36:31)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)"

I have no idea why this exception is thrown, i thought about an user permission problem, but everything is ok. Working environnement is always well initialized…
Does anyone ever faced (and resolved) this problem?


#2

What is the ionic info output there?


#3

I’m a student under contract, so I cannot access the mac until monday
I ran an ionic info today, and by memory, nothing was missing. I’ll post ionic info output Monday morning.
Thanks for answering !


#4

Hi,
Funny thing about ionic info, here’s the Jenkins result :

[fe-trophy-app-front_develop-77CK5GUSIH5UUBVXYPQ7OXP6XA6JO4UMRJFKHDTFH7JX3ORNETWA] Running shell script

+ ionic info



cli packages: (/Users/jenkinsnode/workspace/fe-trophy-app-front_develop- 77CK5GUSIH5UUBVXYPQ7OXP6XA6JO4UMRJFKHDTFH7JX3ORNETWA/node_modules)




    @ionic/cli-utils  : 1.19.2

    ionic (Ionic CLI) : 3.20.0



global packages:



    cordova (Cordova CLI) : not installed



local packages:



    @ionic/app-scripts : 2.0.0

    Cordova Platforms  : none

    Ionic Framework    : ionic-angular 3.5.0



System:



    ios-deploy : 1.9.2 

    ios-sim    : 5.0.13 

    Node       : v8.9.1

    npm        : 5.8.0 

    OS         : macOS High Sierra

    Xcode      : Xcode 9.3 Build version 9E145 



Environment Variables:



    ANDROID_HOME : /home/android_sdk/



Misc:



    backend : legacy

We can see the ionic cli isn’t here
and here’s the ionic info, in the same directory, without Jenkins :

[fe-trophy-app-front_develop-77CK5GUSIH5UUBVXYPQ7OXP6XA6JO4UMRJFKHDTFH7JX3ORNETWA] Running shell script

+ ionic info



cli packages: (/Users/jenkinsnode/workspace/fe-trophy-app-front_develop-77CK5GUSIH5UUBVXYPQ7OXP6XA6JO4UMRJFKHDTFH7JX3ORNETWA/node_modules)



    @ionic/cli-utils  : 1.19.2

    ionic (Ionic CLI) : 3.20.0



global packages:



    cordova (Cordova CLI) : 8.0.0



local packages:



    @ionic/app-scripts : 2.0.0

    Cordova Platforms  : none

    Ionic Framework    : ionic-angular 3.5.0



System:



    ios-deploy : 1.9.2 

    ios-sim    : 5.0.13 

    Node       : v8.9.1

    npm        : 5.8.0 

    OS         : macOS High Sierra

    Xcode      : Xcode 9.3 Build version 9E145 



Environment Variables:



    ANDROID_HOME : /home/android_sdk/



Misc:



    backend : legacy`

I can’t explain why this is happening… In both cases, user logged is root.


#5

Cordova CLI you mean…

But yeah, that is strange. No idea what could be causing it.


#6

Hello, I have the same problem, did you find more information about this issue?


#7

Hello,
I’ve been able to build once, on a mac pro, but still can’t build anything on a mac mini. I have no idea why it worked and never tried again since.
If you find a solution, i’ll be glad to hear it.


#8

I get the source code and the problem is a missing ENV property in jenkins session.

var global_config_path = process.env[‘CORDOVA_HOME’];
if (!global_config_path) {
_ var HOME = process.env[(process.platform.slice(0, 3) === ‘win’) ? ‘USERPROFILE’ : ‘HOME’];_
_ global_config_path = path.join(HOME, ‘.cordova’);_
}


#9

It seems jenkins is using is own env property, maybe there’s something to do with this.