DEV Community

Cover image for Continuous deployment of Vue.js app to AWS using Bitbucket Pipelines

Continuous deployment of Vue.js app to AWS using Bitbucket Pipelines

Pavan Vora on May 09, 2019

Hello guys, I recently created a Bitbucket Pipelines to deploy my Vue.js app on Amazon S3 and today in this article I would like to share the step-...
Collapse
 
luisjuarros profile image
Luis • Edited

This is a very nice solution that will save you a lot of money, but if your vue app use a backend, there is no way to set up the backend url in a environment variable, you must hardcoded it in the source code. This is the only pain I found using S3 to host js web apps.

Collapse
 
pavanvora profile image
Pavan Vora

Thanks for reply @juarrosluis . I think by using S3 also you can set the environment variables same way as we can set in our vue app by using .env files. Here's the link to the documentation if you want to have a look. If you have any doubt feel free to reply. :)

Collapse
 
dafplink profile image
dafp-link

Thank you, thank you thank you Pavan for a fantastic tutorial. Straightforward, accurate and up-to-date. I think this is the very first time that I follow a tutorial which gives me a flawless outcome, as this time I had no need to look up weird/unexpected errors on Google to sort out anything, and I didn't need any other tutorials on Bitbucket pipelines to complement anything missing from yours. Keep up the good work!

Collapse
 
pavanvora profile image
Pavan Vora

You're welcome @dafplink . I'm happy that you found it very useful. Thank you for appreciation and Happy Coding :)

Collapse
 
shypixel profile image
shypixel

Thank you so much for this incredibly helpful article. I managed the integration yet got the error fromthe BitBucket front at the last step (updating the pipeline status right after commiting the "bitbucket-pipelines.yml"):

ERROR Error: Cannot find module 'vue-loader-v16/package.json'
I looked up for this, and it could be related to the Vue CLi version (stackoverflow.com/questions/635045...) but there is no way I can config the Vue CLI tool @ BitBucket, right?

Any advice is appreciated!

Collapse
 
pavanvora profile image
Pavan Vora

Thank you shypixel. Are you able to make build from your local machine?

Collapse
 
carlospxndx94 profile image
CarlosPxndx94

Thank you very much, just what I needed, keep it up.

Collapse
 
pavanvora profile image
Pavan Vora

You're welcome. I'm glad that it helped you.✌️

Collapse
 
cjustinobi profile image
Justin

What if I want to use AWS EC2, is it the same process to get it running?

Collapse
 
pavanvora profile image
Pavan Vora

No Justin you can not use the same process. For auto deployment to EC2 you can check AWS Code Deploy Service.
some resource that might be helpful

  1. support.atlassian.com/bitbucket-cl...
  2. docs.aws.amazon.com/codedeploy/lat...

@cejowisz Any specific reason to go with EC2?