Skip to content

Commit

Permalink
Add documentation for CodeBuild (#1271)
Browse files Browse the repository at this point in the history
* Create codebuild.md

Adds best-practices to use fastlane with codebuild CI

* Update continuous-integration.md

Add CodeBuild as one of the supported CI products for fastlane.
  • Loading branch information
jigar-lab authored Feb 4, 2025
1 parent 1cfa5ab commit df90211
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/best-practices/continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Multiple CI products and services offer integrations with _fastlane_:
- [Jenkins](/best-practices/continuous-integration/jenkins/)
- [Semaphore](/best-practices/continuous-integration/semaphore/)
- [Travis](/best-practices/continuous-integration/travis/)

- [AWS CodeBuild](/best-practices/continuous-integration/codebuild/)

## Authenticating with Apple services

Check out [Authenticating with Apple services](/getting-started/ios/authentication) to learn the best ways to authenticate, catered for your specific use case.
Expand Down Expand Up @@ -60,6 +61,7 @@ You can set up your own `Release` job, which is only triggered manually.
"gitlab-ci-integration": "/best-practices/continuous-integration/gitlab/",
"visual-studio-team-services": "/best-practices/continuous-integration/azure-devops/",
"nevercode-integration": "/best-practices/continuous-integration/nevercode/",
"codebuild-integration": "/best-practices/continuous-integration/codebuild/",
}
/*
* Best practice for extracting hashes:
Expand Down Expand Up @@ -108,3 +110,7 @@ This content was moved and now lives [here](/best-practices/continuous-integrati
#### Nevercode Integration

This content was moved and now lives [here](/best-practices/continuous-integration/nevercode/).

#### AWS CodeBuild Integration

This content was moved and now lives [here](/best-practices/continuous-integration/codebuild/).
51 changes: 51 additions & 0 deletions docs/best-practices/continuous-integration/codebuild.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# AWS CodeBuild Integration

Use [AWS CodeBuild Reserved Capacity Fleets](https://docs.aws.amazon.com/codebuild/latest/userguide/fleets.html) running on a macOS machine to build using _fastlane_.

## Repository setup

First create a `Gemfile` in the root of your project with the following content:

```ruby
source 'https://rubygems.org'

gem 'fastlane'
```

Add a buildspec.yml file to your repository with the following content:

```yml
version: 0.2

env:
secrets-manager:
MATCH_PASSWORD: <secret-id>:<json-key>:<version-stage>:<version-id>
FASTLANE_SESSION: <secret-id>:<json-key>:<version-stage>:<version-id>

phases:
install:
commands:
- bundle install
build:
commands:
- bundle exec fastlane beta
```
See [Buildspec syntax for AWS CodeBuild](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html) for more information on how this file works.
## Setting up the lanes
Here's an example of a `Fastfile` with a lane that runs _match_, builds the app, and uploads to TestFlight:

```ruby
platform :ios do
lane :beta do
setup_ci
match(type: 'appstore')
build_app
upload_to_testflight(skip_waiting_for_build_processing: true)
end
end
```

Note the usage of `setup_ci`: it creates a temporary keychain. Without this, the build could freeze and never finish.

0 comments on commit df90211

Please sign in to comment.