Aurelia Built on VSO Hosted Build Controller

I am trying to build an Aurelia assembly on a VSO Hosted Build Controller. I created a small powershell script to run the following commands

npm install .node_modules/.bin/jspm cc .node_modules/.bin/jspm install -y .node_modules/.bin/gulp build 

I have AfterBuild goals to copy the jspm_packages and dist folders to the _publishedWebsites folder.

npm install works fine, but when it comes to jspm cc (if I remove jspm cc and let it run jspm install -y), it does not try to do this

 jspm cc Migrating global jspm folder from C:\Users\buildguest\.jspm to C:\Users\buildguest\AppData\Local\.jspm... Copying configuration... err Error migrating to new jspm folder 2>EXEC : error : ENOENT, no such file or directory 'C:\Users\buildguest\.jspm\config' [d:\a\src\WebGUI\OwinAureliaScaffold\OwinAureliaScaffold.csproj] at Object.fs.openSync (evalmachine.<anonymous>:427:18) at Object.fs.readFileSync (evalmachine.<anonymous>:284:15) at Object.<anonymous> (d:\a\src\WebGUI\OwinAureliaScaffold\public\node_modules\jspm\lib\global-config.js:36:24) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (d:\a\src\WebGUI\OwinAureliaScaffold\public\node_modules\jspm\lib\registry.js:19:20) ok Loader file cache cleared. ok Package cache cleared. 

I understand that jspm is not installed globally, since it is a hosted controller, I cannot install it globally. My question is, how can I work with this without installing global jspm? Is there a way in which it does not need to transfer the configuration file?

+5
source share
3 answers

Even if you cannot install and run the jspm CLI in a hosted build agent, you can run jspm through node.

First, make sure jspm is installed - which is what your powershell script does. Alternatively, you can use VSO Build "npm install task" if jspm is in your package.json file. enter image description here

I used Gulp to execute jspm through node. I'm not sure if this is the best way to take this step, but it works ... I used VSO "Gulp task"

enter image description here

Here are the relevant bits from gulpfile.js :

 var gulp = require('gulp'), exec = require('child_process').exec; //#region Build Tasks gulp.task('build:jspm', function (cb) { exec("node ./node_modules/jspm/jspm.js install", function(err, stdout, stderr) { console.log(stdout); console.error(stderr); cb(err); }); }); gulp.task('_build', ['build:jspm']); 
+5
source

I understand that jspm is not installed globally, since it is a host controller, I cannot install it globally.

This seems to be wrong (at least for now.) You can install jspm globally on a hosted controller.

I was able to solve this using the build process, which looks like this:

Build steps

  • npm install
  • npm install -g jspm
  • node C: \ NPM \ Modules \ node_modules \ jspm \ jspm.js install

1) Installs all local dependencies from my package.json. 2) Installs the global version of JSPM 3) Calls it from the global installation location

I understood from M Falanga that node is obviously in the controller path, so I could call it from the Powershell / command line. The global JSPM installation location that I discovered is scanning build debug logs. Note for developers, you must make sure that your working directory for steps 1 and 3 is installed in the place where your package.json is located.

Alternative solution

I have not tested this next option in the assembly yet, but you should skip the additional steps of the assembly and just use the NPM scripting function to install JSPM. In this case, you do not need the NPM installation step or the node step above.

In your .json package, you will need the following script entry:

  "keywords": [...], "scripts": { "postinstall": "./node_modules/.bin/jspm install -y" }, "jspm": {... 
+2
source

If installing the package requires administrative privileges on the computer, you cannot do this in a hosted assembly. In this case, you will have to create your own build machine. This is what we hope to solve in the future.

So here is what one person did to set up Aurelia: http://fabhojs.blogspot.com/2015/03/aurelia-app-skeleton-yeoman-generator.html (from this question ). These steps are various and may help.

+1
source

All Articles