This is not actually a discussion but more of a bit of information for other people that are (maybe) struggling with the same issue i had (sorry if this is not the correct place for this).
If you want to build and deploy (push the dist folder/files) an angular app with ftp, without having to do another build/deploy on your own webserver, keep on reading.
That issue is about deploying an angular app build to the webserver.
So what i wanted was, when i pushed a new version to my master branch, the pipeline would build the app with the ng cli and afterwards push the dist/ folder output to my webserver.
This is now done with ftp, and not git (that so many others suggested on this community).
I was not looking for git pushes or anything that would also trigger a build on my webserver, all i needed was my already builded app to be pushed to my webserver right into my site root.
So here is my pipeline yml:
name: Build app
script: # The script below will build the application.
- npm install
- npm install -g @angular/cli
- ng build --prod --build-optimizer --progress=false
name: Deploy app
script: # The script below will deploy the application to the webserver.
- apt-get update
- apt-get install ncftp
- ncftpput -v -u "$FTP_USERNAME" -p "$FTP_PASSWORD" -R $FTP_HOST $FTP_SITE_ROOT $BITBUCKET_CLONE_DIR/dist/**/**
I am not saying this is the best solution, but i have been trying stuff for a week and this was the only successful pipeline i got to work for simply pushing my already builded app files to my webserver.
- i used environment variables, so you have to add your own for the ftp config.
- also note the '--progress=false', i don't know if others have the same issue, but the progress output for the angular build messes up the entire steps output.
- mind your ftp host, ncftp does not support FTPS, and the hostname should not contain ftp:// or http://
I hope people that are looking to just build their ng site/app and push the final files to the webserver/site root have any use of this.
Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events