Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build React Native with AWS CodeBuild

This may be a simple question. I have a client who has a significant presence/infrastructure within AWS. Starting up a new mobile app for the client and they have said they would like to utilize the AWS toolset as much as possible. However, after going through all the documentation for some such tools as AWS CodeBuild, I don't see how I would be able to build an iOS app on the platform. Have I missed something, can you use the AWS toolset such as AWS CodePipeline and AWS CodeBuild to automate the builds of iOS and Android apps from a React Native base?

My belief is that you are limited to only Android because you would not have a MacOS-based server to actually compile the underlying iOS code.

like image 620
Perry Hoekstra Avatar asked Oct 28 '22 13:10

Perry Hoekstra


1 Answers

Codebuild uses docker to create build environments. AWS create a whole bunch of docker images for regular development purposes, a full list of which is here.

If you need to customise a build environment, or create something totally unique, that's no problem. Just create the docker image you want to use as a build environment (for example a MacOS server), upload it to Amazon EC2 container registry and then reference that image in CodeBuild. Details on that can be found here.

Build environments are Docker images that include a complete file system with everything required to build and test your project. To use a custom build environment in a CodeBuild project, you build a container image for your platform that contains your build tools, push it to a Docker container registry such as Amazon EC2 Container Registry (ECR), and reference it in the project configuration. When building your application, CodeBuild will retrieve the Docker image from the container registry specified in the project configuration and use the environment to compile your source code, run your tests, and package your application.

EDIT: See comments below. As docker doesn't currently support MacOS images, and iOS apps basically require MacOS hosts for building, I would conclude its not possible to build iOS apps on Codebuild.

like image 59
F_SO_K Avatar answered Nov 15 '22 09:11

F_SO_K