I have a Bamboo build plan that ultimately runs the following command.
ionic build windows --arch=x86 --release --buildNumber=${bamboo.buildNumber}
The buildNumber is used by an “after prepare” script to update the version with a build number in the appropriate files.
Everything works great except when it doesn’t, but Bamboo still thinks the build completed successfully and marks it as suchl. It appears errors during the build process do not cause the ionic command to exit with a status other than 0.
For example, I will get an npm exit status 1, but it appears that ionic exits gracefully and Bamboo is unaware of a problem even though the stdout/stderr output that bamboo collects into a log show the errors. Am I mistaken in my conclusion?
I’ve tried a Bamboo plugin that parses log files, but I believe the error is not written in the npm-debug.log file in time to be seen by the parser before the build is concluded.
Any suggestions? How can I make ionic error out?
Relevant log snippet:
build 03-May-2017 08:46:22 > MyIonicApp@ ionic:build C:\builds\TIONIC-CEH0-JOB1
build 03-May-2017 08:46:22 > ionic-app-scripts build "--arch=x86" "--release" "--buildNumber=22"
build 03-May-2017 08:46:22
build 03-May-2017 08:46:24 e[2m[08:46:24]e[22me[36m ionic-app-scripts 1.2.2 e[39m
build 03-May-2017 08:46:24 e[2m[08:46:24]e[22m build dev started e[2m...e[22m
build 03-May-2017 08:46:24 e[2m[08:46:24]e[22m clean started e[2m...e[22m
build 03-May-2017 08:46:24 e[2m[08:46:24]e[22m clean finished e[2min less than 1 mse[22m
build 03-May-2017 08:46:24 e[2m[08:46:24]e[22m copy started e[2m...e[22m
build 03-May-2017 08:46:24 e[2m[08:46:24]e[22m transpile started e[2m...e[22m
error 03-May-2017 08:46:29 e[31m[08:46:29] typescript: C:/builds/TIONIC-CEH0-JOB1/src/pages/form1898/form1898.ts, line: 847 e[39m
build 03-May-2017 08:46:29 Property 'operatorId' does not exist on type 'Form1898'.
build 03-May-2017 08:46:29
build 03-May-2017 08:46:29 e[2m L846: e[22m trans.useCode = this.useCode;
build 03-May-2017 08:46:29 e[2m L847: e[22m trans.e[41moe[49me[41mpe[49me[41mee[49me[41mre[49me[41mae[49me[41mte[49me[41moe[49me[41mre[49me[41mIe[49me[41mde[49m = this.operatorId;
build 03-May-2017 08:46:29
error 03-May-2017 08:46:29 e[31m[08:46:29] ionic-app-script task: "build" e[39m
error 03-May-2017 08:46:29 e[31m[08:46:29] Error: Failed to transpile program e[39m
error 03-May-2017 08:46:29 e[31mError: Failed to transpile program
error 03-May-2017 08:46:29 at new BuildError (C:\builds\TIONIC-CEH0-JOB1\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
error 03-May-2017 08:46:29 at C:\builds\TIONIC-CEH0-JOB1\node_modules\@ionic\app-scripts\dist\transpile.js:102:20
error 03-May-2017 08:46:29 at transpileWorker (C:\builds\TIONIC-CEH0-JOB1\node_modules\@ionic\app-scripts\dist\transpile.js:68:12)
error 03-May-2017 08:46:29 at Object.transpile (C:\builds\TIONIC-CEH0-JOB1\node_modules\@ionic\app-scripts\dist\transpile.js:26:12)
error 03-May-2017 08:46:29 at buildProject (C:\builds\TIONIC-CEH0-JOB1\node_modules\@ionic\app-scripts\dist\build.js:98:78)
error 03-May-2017 08:46:29 at C:\builds\TIONIC-CEH0-JOB1\node_modules\@ionic\app-scripts\dist\build.js:46:16e[39m
error 03-May-2017 08:46:29
error 03-May-2017 08:46:29 npm ERR! Windows_NT 10.0.14393
error 03-May-2017 08:46:29 npm ERR! argv "C:\\nodejs-7\\node.exe" "C:\\nodejs-7\\node_modules\\npm\\bin\\npm-cli.js" "run" "ionic:build" "--" "--arch=x86" "--release" "--buildNumber=22"
error 03-May-2017 08:46:29 npm ERR! node v7.7.4
error 03-May-2017 08:46:29 npm ERR! npm v4.1.2
error 03-May-2017 08:46:29 npm ERR! code ELIFECYCLE
error 03-May-2017 08:46:29 npm ERR! MyIonicApp@ ionic:build: `ionic-app-scripts build "--arch=x86" "--release" "--buildNumber=22"`
error 03-May-2017 08:46:29 npm ERR! Exit status 1
error 03-May-2017 08:46:29 npm ERR!
error 03-May-2017 08:46:29 npm ERR! Failed at the MyIonicApp@ ionic:build script 'ionic-app-scripts build "--arch=x86" "--release" "--buildNumber=22"'.
error 03-May-2017 08:46:29 npm ERR! Make sure you have the latest version of node.js and npm installed.
error 03-May-2017 08:46:29 npm ERR! If you do, this is most likely a problem with the MyIonicApp package,
error 03-May-2017 08:46:29 npm ERR! not with npm itself.
error 03-May-2017 08:46:29 npm ERR! Tell the author that this fails on your system:
error 03-May-2017 08:46:29 npm ERR! ionic-app-scripts build "--arch=x86" "--release" "--buildNumber=22"
error 03-May-2017 08:46:29 npm ERR! You can get information on how to open an issue for this project with:
error 03-May-2017 08:46:29 npm ERR! npm bugs MyIonicApp
error 03-May-2017 08:46:29 npm ERR! Or if that isn't available, you can get their info via:
error 03-May-2017 08:46:29 npm ERR! npm owner ls MyIonicApp
error 03-May-2017 08:46:29 npm ERR! There is likely additional logging output above.
error 03-May-2017 08:46:29
error 03-May-2017 08:46:29 npm ERR! Please include the following file with any support request:
error 03-May-2017 08:46:29 npm ERR! C:\builds\TIONIC-CEH0-JOB1\npm-debug.log
simple 03-May-2017 08:46:29 Finished task 'ionic build' with result: Success