Skip to content

Commit df90211

Browse files
authored
Add documentation for CodeBuild (#1271)
* 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.
1 parent 1cfa5ab commit df90211

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

docs/best-practices/continuous-integration.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ Multiple CI products and services offer integrations with _fastlane_:
2424
- [Jenkins](/best-practices/continuous-integration/jenkins/)
2525
- [Semaphore](/best-practices/continuous-integration/semaphore/)
2626
- [Travis](/best-practices/continuous-integration/travis/)
27-
27+
- [AWS CodeBuild](/best-practices/continuous-integration/codebuild/)
28+
2829
## Authenticating with Apple services
2930

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

110112
This content was moved and now lives [here](/best-practices/continuous-integration/nevercode/).
113+
114+
#### AWS CodeBuild Integration
115+
116+
This content was moved and now lives [here](/best-practices/continuous-integration/codebuild/).
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# AWS CodeBuild Integration
2+
3+
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_.
4+
5+
## Repository setup
6+
7+
First create a `Gemfile` in the root of your project with the following content:
8+
9+
```ruby
10+
source 'https://rubygems.org'
11+
12+
gem 'fastlane'
13+
```
14+
15+
Add a buildspec.yml file to your repository with the following content:
16+
17+
```yml
18+
version: 0.2
19+
20+
env:
21+
secrets-manager:
22+
MATCH_PASSWORD: <secret-id>:<json-key>:<version-stage>:<version-id>
23+
FASTLANE_SESSION: <secret-id>:<json-key>:<version-stage>:<version-id>
24+
25+
phases:
26+
install:
27+
commands:
28+
- bundle install
29+
build:
30+
commands:
31+
- bundle exec fastlane beta
32+
```
33+
34+
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.
35+
36+
## Setting up the lanes
37+
38+
Here's an example of a `Fastfile` with a lane that runs _match_, builds the app, and uploads to TestFlight:
39+
40+
```ruby
41+
platform :ios do
42+
lane :beta do
43+
setup_ci
44+
match(type: 'appstore')
45+
build_app
46+
upload_to_testflight(skip_waiting_for_build_processing: true)
47+
end
48+
end
49+
```
50+
51+
Note the usage of `setup_ci`: it creates a temporary keychain. Without this, the build could freeze and never finish.

0 commit comments

Comments
 (0)