Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Angular 6 CLI Deploy Pipeline


Hi all,

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:

image: node:8.11
- step:
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
- dist/**

- step:
name: Deploy app
script: # The script below will deploy the application to the webserver.
- apt-get update
- apt-get install ncftp

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.

Cheers all.


Comments for this post are closed

Community moderators have prevented the ability to post new comments.

Post a new discussion

Why should I use FTP , can I use ssh instead of that if yes what command should I use instead of nsftpput command ?

I used FTP because it is simple to use in my opinion, and almost every webhost provides FTP and info.

Not all webhosts/hosting solutions provides an SSH option and ftp is easier to understand and use by new users to deploying.

With ssh you would also require to do more trickier stuff, because you will need to copy and move the files on a system level (at least so far i understand ssh is a command line connection with the machine).

So ssh also requires more setup (user rights perhaps on hosting end etc).
With FTP this is usually already taken care of (depending on host).

But yes it should be possible, it should be the same as working with ssh yourself in terminal (what the yml script does, is run those 'script' lines in its container os terminal).

Open a connection with the commands in the yml and then just make new lines with terminal commands to move/copy the files to your hosting location, like you would when doing it yourself manual on your machine.

something like this i think:

scp [path of file/folder to send] root@[receiver/host's IP]:[target/wwwroot directory]

instead of the install and ncftp line.
But i am also used to ftp, and not ssh for copying files/folders to my hosts so if this is all there is to it and if it is correct, i cannot say.

@dkeulen  I solved my issue with SCP command as you said, you saved my day :).


Glad it helped! :)

How does the FTP handle the deploy for a new version? Will it overwrite existing files and delete old ones? 

yes just overwriting the files

And delete old files?


Thank you for this tutorial.  I have just started learning about bitbucket pipeline.  I have two questions for you. My repository name is "xyz" 

I have to upload all the files of dist folder into this test folder.

1.  This code created a folder named xyz automatically inside the test folder  that contains all the content of dist. How can I just deploy all the content of dist to test folder.

2. This test folder already consists of my htaccess file. So for each deployment I have to delete all the files inside test folder except this htaccess file.


Can you please help me. 


Thank you.


Thank you very much was breaking my head for long, just because that pitty thing artifact tag was missing the whole build pipeline was failing.

I'm using firebase


image: node:10

pipelines: branches: main: - step: name: "Build, test and deploy to firebase production" deployment: production caches: - node script: - npm install -g @angular/cli - npm install -g firebase-tools - npm install - ng build --prod - firebase deploy --only hosting --token "$FIREBASE_TOKEN"
image: node:10.15.3

- step:
name: Build
- npm install
- npm install -g @angular/cli
- ng build --prod
- step:
name: Deployment
deployment: Staging

- pipe: atlassian/ftp-deploy:0.3.2

I am using ftp-pipe provided by bitbucket, but I am unable to upload the dist folder, instead it uploads the root folder items. can you please point me out what I am doing wrong?

PS: I tried your method too, but no luck

I recommend to remove the last /**:


Should be:


 otherwise only the /assets folder will be uploaded

Comments for this post are closed

Community moderators have prevented the ability to post new comments.

Post a new discussion

AUG Leaders

Atlassian Community Events