How to deploy Angular2 + Webpack app on Azure?

I am trying to find information on the Internet on how to deploy angular2 using the webpack app for azure, but I did not find anything useful. I checked the starter package as suggested here How do you deploy Angular 2 applications? but I also could not find much help there.

So, I have an angular2 application working with webpack locally. It works great on the spot. But how to deploy it in Azure Web Apps?

I appreciate any help :)

Thank!

+4
source share
1 answer

, . , , prod CD/CI. . , , ...

http://tattoocoder.com/angular2-azure-codeship-angularcli/ Shane Boyer, .

:

  • GitHub ( )
  • CodeShip GitHub enter image description here enter image description here

  • Configure Project I want to create my custom commands : enter image description here

nvm install 4.1

npm install angular -cli

npm install

  1. : enter image description here

ng serve &

ng e2e

ng build -prod

  1. Save and go to dashboard
  2. Azure Portal (https://portal.azure.com/) / -.
  3. Deployment Options > Choose Source > Local Git Repository enter image description here
  4. Deployment Credentials / enter image description here
  5. Overview Git clone url enter image description here
  6. Project settings > Environment variables AZURE_REPO_URL , git url, / (https://username:password@site.scm.az(...).git): enter image description here enter image description here
  7. Deployment .
  8. , ( ) "", "Custom Script enter image description here
  9. script:
git config --global user.email "email@provider.com"
git config --global user.name "Your name"

git clone $AZURE_REPO_URL repofolder

cd repofolder

rm -rf *

cp -rf ~/clone/dist/* .
git add -A
git commit --all --author "$CI_COMMITTER_NAME <$CI_COMMITTER_EMAIL>" --message "$CI_MESSAGE ($CI_BUILD_URL)"

git push origin master

. , GitHub CodeShip, , PR, .

https://stackoverflow.com/users/595213/shayne-boyer .

+1

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


All Articles