angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.76k stars 11.98k forks source link

How to build with circleci? #2675

Closed gamalielhere closed 7 years ago

gamalielhere commented 8 years ago

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

El Capitan

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.17 node: 5.4.1 os: darwin x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

Uploading to circleci so code can get synced to a bucket in amazon.

The log given by the failure.

Normally this include a stack trace and some more information.

` bash: line 1: ng: command not found

ng build --env=prod returned exit code 127

Action failed: ng build --env=prod `

Mention any other details that might be useful.

I added ng build in the deployment commands in the circle.yml trying to build so it calls the correct api url when sync'd in the amazon bucket.


Thanks! We'll be in touch soon.

deebloo commented 8 years ago

I would do some reading on how circle works. Also in the future you may get faster answers on Stackoverflow or the gitter channel.

The ng command isn't working because angular-cli isn't installed globally on the circle ci machine. First you will need to install and use PhantomJs instead of chrome-launcher so you have a headless browser. Second you can wrap your command in an npm script and have circle run that instead.

filipesilva commented 8 years ago

^ what @deebloo said 💃

Except that I'd recommend something like what we do in https://github.com/angular/quickstart/blob/master/.travis.yml to be able to use chromium in a CI enviroment. It allows us to run karma and protractor tests.

baruchvlz commented 7 years ago

You could add angular-cli as a dependency and have it run before anything else.

circle.yml

dependencies:
  pre:
    - npm install angular-cli@latest -g
hansl commented 7 years ago

Closing this as not relevant; this is a circleci configuration issue. The discussion above seems to provide some hints as to what to do to fix.

charpeni commented 7 years ago

This article could be helpful https://medium.com/@charpeni/continuous-integration-with-angular-cli-ea6a40fa7d3c

filipesilva commented 7 years ago

We're also adding some CircleCI/TravisCI integration docs https://github.com/angular/angular-cli/pull/6947.

angular-automatic-lock-bot[bot] commented 5 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.