Setting up Continuous Integration with Bitbucket pipelines

Do you wanna set up continuous integration for your angular project using bitbucket pipelines? Here’s what can be done.

  1. If you want to use Simple Storage Service (S3), an Amazon Web Service for hosting your static website, then you need to start with creating your S3 bucket.

Under properties tab of that S3 bucket, enter the details and click save. Here’s an example.

Figure 1.1 enable static website hosting

2. Next, under the permissions tab, edit the bucket policy. Something like,

Figure 1.2 edit the bucket policy

3. Also, make sure you have the AWS Access key and AWS secret access key values noted from the Identity access management (IAM) user, under the “My Security Credentials” on AWS management console.

4. Now, switch to your bitbucket account, login and navigate to the “Settings” page. Enable the pipelines feature and go to Environment Variables in the pipelines section.

Figure 1.3 add environment variables

5. Push the bitbucket-pipelines.yml file into your branch to implement pipelines that are triggered for staging and master branches. This can look something like this.

Figure 1.4 : bitbucket-pipelines.yml file

6. Also, push this shell script into your repo branch, that deploys by assigning the AWS credential values. For Ex:

Figure 1.5: deploy-staging shell script

Once you push or merge any code to staging or master branches, these pipelines should automatically get triggered. Hope you enjoy building continuous integration for your projects :)

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade