I have pipelines enabled in my Bitbucket repository and I need to run Angular 2 build and deploy the dist folder (which gets created after the build command is executed) in my server after every build.
I have following in my bitbucket-pipelines.yml file:
image: node:4.6.0
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- npm install
- npm run build:prod
I found this code snippet on the Internet:
- apt-get update
- apt-get -qq install git-ftp
- git ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://123.456.789.123/timount/angular_app
I use a pem file to login to my server through the SSH client. So is the above code snippet useful? If not, how can I use the pem file in the above command?
To make it more clear, npm run build:prod
command actually creates the dist folder, which needs to be deployed on the server at the above location. How can I achieve this?
1. Write this in bitbucket-pipelines.yml
2. Configure your bitbucket environment variables