Skip to content

Commit 8f70ddb

Browse files
authored
Merge pull request #1105 from helinanever/codemagic-integration
Codemagic integration
2 parents f0a3cd7 + 0ee4a5a commit 8f70ddb

File tree

4 files changed

+66
-71
lines changed

4 files changed

+66
-71
lines changed

docs/best-practices/continuous-integration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Multiple CI products and services offer integrations with _fastlane_:
1818
- [Bamboo](/best-practices/continuous-integration/bamboo/)
1919
- [Bitrise](/best-practices/continuous-integration/bitrise/)
2020
- [CircleCI](/best-practices/continuous-integration/circle-ci/)
21+
- [Codemagic](/best-practices/continuous-integration/codemagic/)
2122
- [GitHub Actions](/best-practices/continuous-integration/github/)
2223
- [GitLab CI](/best-practices/continuous-integration/gitlab/)
2324
- [Jenkins](/best-practices/continuous-integration/jenkins/)
24-
- [Nevercode](/best-practices/continuous-integration/nevercode/)
2525
- [Semaphore](/best-practices/continuous-integration/semaphore/)
2626
- [Travis](/best-practices/continuous-integration/travis/)
2727

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Codemagic Integration
2+
3+
[Codemagic](https://codemagic.io/) is a cloud-based CI/CD tool for mobile applications that you can use for continuous integration and delivery together with *fastlane*. Codemagic has *fastlane* pre-installed, so you can easily run your *fastlane* scripts as part of the Codemagic build process. You only need a Fastfile in your repository to get started. You can find the version of pre-installed *fastlane* based on build machine type from [here](https://docs.codemagic.io/specs/machine-type/).
4+
5+
## Getting started
6+
7+
For publishing iOS apps, it is recommended to create an App Store Connect API key so you don't have to use 2FA. This also offers better performance and increased reliability. More details can be found [here](https://docs.fastlane.tools/app-store-connect-api/).
8+
9+
## Adding environment variables
10+
11+
The following **environment variables** need to be added to your workflow for *fastlane* integration.
12+
13+
- `MATCH_PASSWORD` - the password used to encrypt/decrypt the repository used to store your distrbution certificates and provisioning profiles.
14+
- `MATCH_KEYCHAIN` - an arbitrary name to use for the keychain on the Codemagic build server, e.g "fastlane_keychain"
15+
- `MATCH_SSH_KEY` - an SSH private key used for cloning the Match repository that contains your distrbution certificates and provisioning profiles. The public key should be added to your Github account. See [here](https://docs.codemagic.io/configuration/access-private-git-submodules/) for more information about accessing Git dependencies with SSH keys.
16+
- `APP_STORE_CONNECT_PRIVATE_KEY` - the App Store Connect API key. Copy the entire contents of the .p8 file and paste into the environment variable value field.
17+
- `APP_STORE_CONNECT_KEY_IDENTIFIER` - the key identifier of your App Store Connect API key.
18+
- `APP_STORE_CONNECT_ISSUER_ID` - the issuer of your App Store Connect API key.
19+
20+
Environment variables can be added in the Codemagic web app using the 'Environment variables' tab. Save all the variables to the same variable group and make sure that the **secure** checkbox is checked to encrypt any senstive values such as API keys or passwords.
21+
22+
You can then import your variable group into your `codemagic.yaml`. For example, if you named your variable group 'fastlane', the group should be imported as follows:
23+
24+
```yaml
25+
workflows:
26+
workflow-name:
27+
environment:
28+
groups:
29+
- fastlane
30+
```
31+
32+
## Executing *fastlane* in your workflow
33+
34+
It is recommended to run your *fastlane* lanes using the `codemagic.yaml` configuration file.
35+
36+
You should install your depenpendencies with `bundle install` and then execute the *fastlane* lane with `bundle exec fastlane <lane_name>` as follows:
37+
38+
```yaml
39+
scripts:
40+
- bundle install
41+
- bundle exec fastlane beta
42+
```
43+
44+
If you need to use a specific version of bundler as defined in the `Gemfile.lock` file, you should install it with `gem install bundler:<version>` as follows:
45+
46+
```yaml
47+
scripts:
48+
- gem install bundler:2.2.27
49+
- bundle install
50+
- bundle exec fastlane beta
51+
```
52+
53+
## CocoaPods
54+
55+
If you are using dependencies from Cocoapods, it might be necessary to include the CocoaPods gem in your Gemfile to prevent scope conflict issues.
56+
57+
```
58+
gem "fastlane"
59+
gem "cocoapods"
60+
```
61+
62+
## Starting your build
63+
64+
You can start your build manually from within the Codemagic web app, or configure your builds to start on events such as pushing to your repository, creating or updating a pull request, adding a new tag, or even monitoring for file system changes. See more info in [Codemagic docs](https://docs.codemagic.io/).

docs/best-practices/continuous-integration/nevercode.md

-69
This file was deleted.

mkdocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,10 @@ nav:
317317
- Bamboo: best-practices/continuous-integration/bamboo.md
318318
- Bitrise: best-practices/continuous-integration/bitrise.md
319319
- CircleCI: best-practices/continuous-integration/circle-ci.md
320+
- Codemagic: best-practices/continuous-integration/codemagic.md
320321
- GitHub Actions: best-practices/continuous-integration/github.md
321322
- GitLab CI: best-practices/continuous-integration/gitlab.md
322323
- Jenkins: best-practices/continuous-integration/jenkins.md
323-
- Nevercode: best-practices/continuous-integration/nevercode.md
324324
- Semaphore: best-practices/continuous-integration/semaphore.md
325325
- Travis: best-practices/continuous-integration/travis.md
326326
- Keys: best-practices/keys.md

0 commit comments

Comments
 (0)