How can can I deploy an angular 2 webapp to azure? I guess I need some type of final compilation script.
Thanks in advance.
To achieve deploying angular application on azure webapps using bitbucket, create bitbucket-pipelines.yml in root directory. Create environment variables for FTP access for your webapps slot (environment variables are referred using $ in script below).
Enable the pipelines from Bitbucket settings. That's it. Whenever you check-in the code in specific branch ( master branch in script below), it will deploy the application to azure webapps slot using FTP.
# registry for your build environment.
image: node:8.9.0
pipelines:
branches:
master:
- step:
script: # Modify the commands below to build your repository.
- npm install -g @angular/cli
- npm install
- ng build --prod
- apt-get update # Now run the FTP bash script to deploy dist folder to UAT
- apt-get install ncftp
- ncftpput -v -u "$FTP_USERNAME" -p $FTP_PASSWORD -R $FTP_HOST $FTP_SITE_ROOT dist/ROOT
- echo Finished uploading files to $FTP_HOST$FTP_SITE_ROOT