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

Bitbucket pipeline for Angular 5 build and deploy on Tomcat server

rahul_naik March 7, 2018

I have Angular 5 application developed. I have added following yml file:

pipelines:
default:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install
- npm install -g @angular/cli
- ng build --prod
- ls -ltr
- pwd

 I can see dist folder generated in container using ng build and ls -ltr; However I am unsure about how shall I copy this dist folder to my servers tomcat directory.
Do I have to include gradle file for this ? or yet another step for gradle ? How to copy to my server ? commands for that ? and where should I include those in my yml  file ?

My repo is here.

Thanks in advance

1 answer

0 votes
Raul Gomis
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 28, 2018

Hi Rahul,

There are multiple ways you can publish your files to your server / deployment environment (FTP, SFTP, SSH, etc.). I recommend you choose one of them, make sure your server ports are accessible by Pipelines and set your server credentials in Pipelines as secured variables. Then, you will need to specify the script in the Bitbucket Pipelines YAML file to upload the contents of your dist folder to the tomcat folder in your server.

I recommend you use the recently feature released "Deployments" to track your deployments across your environments: https://confluence.atlassian.com/bitbucket/bitbucket-deployments-940695276.html

Regards,

Raul

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events