How to deploy the Ember CLI app on Azure sites

I am trying to deploy an ember-cli application for Azure websites. When deployed to azure, you run a deployment script that does the following:

- npm install bower - npm install ember-cli - bower install - npm install - ember build 

Well, everything seems to be going fine until it reaches the ember build step. I get an error message:

 this._handle.open(options.fd) Error: EINVAL, Invalid argument at new Socket (net.js:156:18) at process.stdin (node.js:664:19) at ..... ember-cli\bin\ember:28:25 

Search around I found this link in the same problem with Grunt https://github.com/TryGhost/Ghost/pull/3608 So, how would I disable stdin in the Ember CLI? Anyway, can I do this or any workaround so that I can deploy the application?

I am trying to make the build process on a web server and somehow this does not work on Azure. Does anyone have any experience with Azure? Thank you very much!

UPDATE

Please, one of the two methods published below is Felix Rizeberg or Justin Nissner. Thank you for your support and for your attention!

+6
source share
2 answers

I am in the final steps of trying this myself. I'm not sure how you set up the deployment, but I wanted me to create the dist folder in the %DEPLOYMENT_SOURCE% folder, and then copy the resulting folder as part of the deployment.

I struggled with the same problem as yours until I saw the link that you included in your post. This gave me the crazy idea of ​​using grunt and grunt-shell to call ember build instead of calling it directly from my deploy.cmd.

My Gruntfile.js is extremely simple:

 module.exports = function(grunt) { require('load-grunt-tasks')(grunt); grunt.initConfig({ shell: { build: { command: 'ember build -prod', options: { stdout: true, stdin: false } }, test: { command: 'ember test', options: { stdout: true, stdin: false } } } }); grunt.registerTask('default', ['shell:build']) } 

After that, I had a dist folder, which could then be copied using the Kudu Sync command on wwwroot . If you need to see anything else, just let me know and I will update my answer.

Update

I finally had the opportunity to clean things up and add some checks to make sure that I am not installing installed things. You can view the entire deploy.sh file at:

https://github.com/CrshOverride/EmberTodo/blob/master/deploy.sh

+4
source

I actually figured out the way too - and since I'm an open source guy at Microsoft, I just built a small npm module that takes care of everything. If you need a long explanation, check this out - if you just want the tl version; dr:

$ npm install ember-cli-azure-deploy --save-dev -g $ azure-deploy init

+6
source

Source: https://habr.com/ru/post/982419/


All Articles