Skip to content

Commit 05044b9

Browse files
huydosgtechHuyDo
andauthored
feat: add bitbucket readme file (#312)
* feat: add bit bucket readme file * fix: remove code push --------- Co-authored-by: HuyDo <[email protected]>
1 parent 89388d2 commit 05044b9

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

docs/bitbucket-pipelines.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# 📌 Bitbucket Pipelines Guide
2+
3+
## 📖 Overview
4+
This project uses **Bitbucket Pipelines** for automating builds, deployments
5+
Bitbucket Pipelines is configured with firebase to:
6+
7+
- **Auto-trigger builds** when pushing code to `develop`, `staging`, or `production`.
8+
- **Support manual execution** using **custom pipelines** for specific tasks.
9+
10+
---
11+
12+
## 🚀 Automatic Branch-Based Pipelines
13+
When code is pushed to a branch (`develop`, `staging`, `production`), Bitbucket Pipelines will execute different tasks depending on what has changed.
14+
15+
### 🔹 Conditional Builds
16+
```yaml
17+
condition:
18+
changesets:
19+
includePaths:
20+
- "ios/**"
21+
- "android/**"
22+
- "package.json"
23+
- "*.env.*"
24+
...
25+
```
26+
• If these files change, a full build (Xcode & Android) is triggered.
27+
28+
### 🔹 Pipeline Execution Flow
29+
30+
| Branch | Condition | Action |
31+
|------------|-------------------------------------------------|---------------------------------------|
32+
| `develop` | Code changes in `ios/`, `android/`, `package.json`, `.env.*` | Full Build & Upload to TestFlight(iOS) |
33+
| `staging` | Always builds | Full Build & Upload |
34+
| `production` | Always builds | Full Build & Upload |
35+
36+
37+
## 🛠️ Running Pipelines in Bitbucket
38+
39+
### 🔹 How to Trigger a Pipeline Manually
40+
1. Open **Bitbucket** → Navigate to your repository.
41+
2. Click **Pipelines** (left menu).
42+
3. Click **Run Pipeline**.
43+
4. Select a **Branch** (e.g., `develop`).
44+
5. Choose a **Custom Pipeline** from the dropdown:
45+
- **`buildDev`** → Manually build development version
46+
- **`buildStaging`** → Manually build staging version
47+
- **`buildProduction`** → Manually build production version
48+
6. Click **Run**.
49+
50+
# 🔄 Environment Variables in Bitbucket Pipelines
51+
52+
Bitbucket Pipelines relies on **environment variables** to securely manage sensitive data like API keys, App IDs, and credentials. This guide explains how to update and manage these variables effectively.
53+
54+
---
55+
## 📌 Environment Variables Used in Bitbucket Pipelines
56+
57+
| Variable Name | Description | Example Value |
58+
|-------------------------|--------------------------------------------------|---------------------------|
59+
| `BITBUCKET_BUILD_NUMBER` | Auto-generated build number for tracking. | `123` |
60+
| `PROJECT_NAME` | The name of your React Native project. | `MyApp` |
61+
| `APP_ID` | The application identifier (package name). | `com.example.myapp` |
62+
| `KEYCHAIN_PASSWORD` | **macOS Keychain password** for signing iOS apps. | `"my-secure-password"` |
63+
64+
---
65+
66+
## 🚀 Updating Variables in Fastlane for Bitbucket
67+
68+
If you update any **environment variables**, make sure **Fastlane** picks up the changes by modifying your `.env` files.
69+
70+
### 🔹 Updating `.env` File
71+
1. Navigate to the project root.
72+
2. Open or create `.env.development`, `.env.staging`, `.env.production`.
73+
3. Update the variables as needed:
74+
```sh
75+
APP_ID=com.example.myapp
76+
PROJECT_NAME=MyApp

template/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ You've successfully run and modified your React Native App. :partying_face:
6464
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
6565
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
6666

67+
# Project Documentation
68+
69+
📄 **[Read Bitbucket Pipelines Guide](/docs/bitbucket-pipelines.md)**
70+
6771
# Troubleshooting
6872

6973
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.

0 commit comments

Comments
 (0)