AWS CodePipeline — Build React Native App

In this article, we are talking about how to create the CI/CD Pipeline for the React Native app.

What is AWS CodePipeline?

AWS CodePipeline is a fully managed continuous delivery service you can use to model, visualize, and automate the steps required to release your software. You can quickly model and configure the different stages of a software release process. CodePipeline automates the steps required to release your software changes continuously.

With AWS CodePipeline, you model the full release process for building your code, deploying to pre-production environments, testing your application, and releasing it to production.

What is CodeBuild?

AWS CodeBuild is a fully managed continuous integration service that compiles source code, runs tests, and produces software packages that are ready to deploy. With CodeBuild, you don’t need to provision, manage, and scale your own build servers. CodeBuild scales continuously and processes multiple builds concurrently, so your builds are not left waiting in a queue. You can get started quickly by using prepackaged build environments, or you can create custom build environments that use your own build tools.

CodeBuild compiles your source code, runs unit tests, and produces artifacts that are ready to deploy.

Let’s Create our pipeline for the React Native app.

In this tutorial, We will create and configure a React Native application’s pipeline with two actions: source and Build.

CodePipeline:

  • Click on Create Pipeline
  • Pipeline name: Enter the name for your pipeline.
  • Click the Next step.

Source provider: AWS CodeCommit

We will be using AWS CodeCommit but you can use GitHub, Amazon S3, AWS ECR as well as Bitbucket.

  • Source provider: Choose the AWS CodeCommit as a Source Provider.
  • Repository name: Choose the name of your AWS CodeCommit repository.
  • Branch name: Choose the name of the branch that contains the sample file.
  • Click the Next step.

Build provider: AWS CodeBuild

We will be using AWS CodeBuild but you can use Jenkins Open source build tool also.

  • Build provider: Choose the AWS CodeBuild as a Build Provider.
  • Click Create Project.

It will open a new screen to create CodeBuild Project.

CodeBuild:

There are 4 steps in CodeBuild Project.

  1. Project Configuration
  • Project Name: Enter the name for your pipeline
  • Description: Enter the Description for your pipeline

2. Environment

  • Environment image: Choose the Managed image.
  • Operating system: Choose the Ubuntu OS.
  • Privileged: Unchecked.
  • Service role: Choose to Create a new Role.
  • Role name: Enter the name for your Service Role.

3. Buildspec

  • Build specifications: Choose Insert build commands
  • Click on Switch to the editor.
  • Enter belove code in Code Editor.

4. Logs

  • CloudWatch: Choose CloudWatch logs.
  • Click on Continue to CodePipeline.

Deploy provider

  • Click the Skip deploy stage.
  • Review our Pipeline.
  • Click on Create Pipeline.

🎊 🎉🤖🎊 🎉 Our AWS CodePipeline for the React Native app is ready now.

Once Pipeline runs Successfully Goto S3 and checks AWS CodePipeline bucket > It will display BuildArtifact Folder that contents our Build Arficatcs (.apk).

After this, you can integrate CodePipeline notification with Slack also.

Please follow this article to create AWS Chatbot that connects with your Slack account.

Once AWS Chatbot is ready Goto your Created CodePipeline project.

  • Click on Notify.
  • Click on Create Notification Rule.
  • Notification name: Enter the name of the notification rule.
  • Detail type: Choose Full Detail type.
  • Events that trigger notifications: Select events.

Targets:

  • Choose target type: Choose AWS Chatbot(Slack)
  • Choose target: Choose arn:aws:chatbot of your created AWS Chatbot.
  • Click Submit.

Thank you for reading, if you have anything to add please send a response or add a note!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Prashant Bhatasana

Prashant Bhatasana

514 Followers

AWS Community Builder | Terraform Associate | Automation Engineer, Love to work with #AWS #Terraform #Jenkins #kubernetes #Docker #Ansible #Selenium