indraq_cli 1.3.0 → 1.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +1082 -657
  2. package/dist/cli/create-program.d.ts.map +1 -1
  3. package/dist/cli/create-program.js +24 -6
  4. package/dist/cli/create-program.js.map +1 -1
  5. package/dist/cli/doctor.command.d.ts.map +1 -1
  6. package/dist/cli/doctor.command.js +23 -0
  7. package/dist/cli/doctor.command.js.map +1 -1
  8. package/dist/modules/configure/configure.command.d.ts.map +1 -0
  9. package/dist/modules/configure/configure.command.js +116 -0
  10. package/dist/modules/configure/configure.command.js.map +1 -0
  11. package/dist/modules/deploy/commands/build.command.d.ts +2 -2
  12. package/dist/modules/deploy/commands/build.command.d.ts.map +1 -1
  13. package/dist/modules/deploy/commands/build.command.js +45 -16
  14. package/dist/modules/deploy/commands/build.command.js.map +1 -1
  15. package/dist/modules/deploy/commands/configure-docker.command.d.ts +2 -0
  16. package/dist/modules/deploy/commands/configure-docker.command.d.ts.map +1 -0
  17. package/dist/modules/deploy/commands/configure-docker.command.js +169 -0
  18. package/dist/modules/deploy/commands/configure-docker.command.js.map +1 -0
  19. package/dist/modules/deploy/config/docker-config.d.ts +21 -0
  20. package/dist/modules/deploy/config/docker-config.d.ts.map +1 -0
  21. package/dist/modules/deploy/config/docker-config.js +187 -0
  22. package/dist/modules/deploy/config/docker-config.js.map +1 -0
  23. package/dist/modules/deploy/index.d.ts.map +1 -1
  24. package/dist/modules/deploy/index.js +9 -26
  25. package/dist/modules/deploy/index.js.map +1 -1
  26. package/dist/modules/mobile/commands/build-mobile.command.d.ts +11 -0
  27. package/dist/modules/mobile/commands/build-mobile.command.d.ts.map +1 -0
  28. package/dist/modules/mobile/commands/build-mobile.command.js +189 -0
  29. package/dist/modules/mobile/commands/build-mobile.command.js.map +1 -0
  30. package/dist/modules/mobile/commands/configure-mobile.command.d.ts +8 -0
  31. package/dist/modules/mobile/commands/configure-mobile.command.d.ts.map +1 -0
  32. package/dist/modules/mobile/commands/configure-mobile.command.js +353 -0
  33. package/dist/modules/mobile/commands/configure-mobile.command.js.map +1 -0
  34. package/dist/modules/mobile/config/mobile-config.d.ts +43 -0
  35. package/dist/modules/mobile/config/mobile-config.d.ts.map +1 -0
  36. package/dist/modules/mobile/config/mobile-config.js +211 -0
  37. package/dist/modules/mobile/config/mobile-config.js.map +1 -0
  38. package/dist/modules/mobile/index.d.ts +3 -0
  39. package/dist/modules/mobile/index.d.ts.map +1 -0
  40. package/dist/modules/mobile/index.js +50 -0
  41. package/dist/modules/mobile/index.js.map +1 -0
  42. package/dist/modules/mobile/services/jenkins-mobile.service.d.ts +31 -0
  43. package/dist/modules/mobile/services/jenkins-mobile.service.d.ts.map +1 -0
  44. package/dist/modules/mobile/services/jenkins-mobile.service.js +344 -0
  45. package/dist/modules/mobile/services/jenkins-mobile.service.js.map +1 -0
  46. package/dist/modules/mobile/services/project.service.d.ts +11 -0
  47. package/dist/modules/mobile/services/project.service.d.ts.map +1 -0
  48. package/dist/modules/mobile/services/project.service.js +73 -0
  49. package/dist/modules/mobile/services/project.service.js.map +1 -0
  50. package/dist/modules/mobile/services/source-bundle.service.d.ts +9 -0
  51. package/dist/modules/mobile/services/source-bundle.service.d.ts.map +1 -0
  52. package/dist/modules/mobile/services/source-bundle.service.js +114 -0
  53. package/dist/modules/mobile/services/source-bundle.service.js.map +1 -0
  54. package/dist/modules/mobile/services/version-sync.service.d.ts +7 -0
  55. package/dist/modules/mobile/services/version-sync.service.d.ts.map +1 -0
  56. package/dist/modules/mobile/services/version-sync.service.js +88 -0
  57. package/dist/modules/mobile/services/version-sync.service.js.map +1 -0
  58. package/dist/shared/config/config-files.d.ts +5 -0
  59. package/dist/shared/config/config-files.d.ts.map +1 -0
  60. package/dist/shared/config/config-files.js +88 -0
  61. package/dist/shared/config/config-files.js.map +1 -0
  62. package/dist/shared/config/jenkins-config.d.ts +36 -0
  63. package/dist/shared/config/jenkins-config.d.ts.map +1 -0
  64. package/dist/shared/config/jenkins-config.js +164 -0
  65. package/dist/shared/config/jenkins-config.js.map +1 -0
  66. package/dist/shared/jenkins/configure-jenkins.d.ts +7 -0
  67. package/dist/shared/jenkins/configure-jenkins.d.ts.map +1 -0
  68. package/dist/shared/jenkins/configure-jenkins.js +84 -0
  69. package/dist/shared/jenkins/configure-jenkins.js.map +1 -0
  70. package/dist/{modules/deploy/services → shared/jenkins}/jenkins.service.d.ts +5 -4
  71. package/dist/shared/jenkins/jenkins.service.d.ts.map +1 -0
  72. package/dist/{modules/deploy/services → shared/jenkins}/jenkins.service.js +43 -89
  73. package/dist/shared/jenkins/jenkins.service.js.map +1 -0
  74. package/dist/shared/runtime/runtime-doctor.js.map +1 -1
  75. package/package.json +10 -5
  76. package/templates/jenkins/Jenkinsfile-Mobile-App +759 -0
  77. package/dist/modules/deploy/commands/configure.command.d.ts.map +0 -1
  78. package/dist/modules/deploy/commands/configure.command.js +0 -404
  79. package/dist/modules/deploy/commands/configure.command.js.map +0 -1
  80. package/dist/modules/deploy/config/deployment-config.d.ts +0 -29
  81. package/dist/modules/deploy/config/deployment-config.d.ts.map +0 -1
  82. package/dist/modules/deploy/config/deployment-config.js +0 -164
  83. package/dist/modules/deploy/config/deployment-config.js.map +0 -1
  84. package/dist/modules/deploy/services/jenkins.service.d.ts.map +0 -1
  85. package/dist/modules/deploy/services/jenkins.service.js.map +0 -1
  86. /package/dist/modules/{deploy/commands → configure}/configure.command.d.ts +0 -0
package/README.md CHANGED
@@ -9,413 +9,446 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- Build Docker images · Push to GHCR · Run Jenkins pipelines · Stream deployment logs
12
+ Docker & GHCR deployments · Jenkins automation · Expo / React Native Android builds · Live terminal logs
13
13
  </p>
14
14
 
15
15
  <p align="center">
16
- <img alt="Node 24" src="https://img.shields.io/badge/Node.js-24.x-339933?logo=node.js&logoColor=white" />
17
- <img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white" />
18
16
  <img alt="npm" src="https://img.shields.io/npm/v/indraq_cli?logo=npm&label=npm" />
17
+ <img alt="Node 22+" src="https://img.shields.io/badge/Node.js-22%2B-339933?logo=node.js&logoColor=white" />
18
+ <img alt="Java 21" src="https://img.shields.io/badge/Java-21%20recommended-ED8B00?logo=openjdk&logoColor=white" />
19
+ <img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white" />
19
20
  <img alt="License" src="https://img.shields.io/npm/l/indraq_cli" />
20
- <img alt="Version" src="https://img.shields.io/badge/version-1.3.0-264B63" />
21
+ <img alt="Version" src="https://img.shields.io/badge/version-1.5.5-264B63" />
21
22
  </p>
22
23
 
23
24
  > [!IMPORTANT]
24
- > **IndraQ CLI is built for IndraQ Innovations engineering operations and is publicly distributed on npm.** Anyone can install and use it with compatible Docker, GitHub/GHCR, and Jenkins infrastructure. The deployment module is the first module; more tools can be added without turning the project into one giant script.
25
+ > **IndraQ CLI is an engineering operations CLI created by IndraQ Innovations.** It is publicly installable from npm. The tool is designed so new internal capabilities can be added as separate modules instead of growing into one giant script.
25
26
 
26
27
  ---
27
28
 
28
29
  ## Index
29
30
 
30
- 1. [What are we building?](#what-are-we-building)
31
+ 1. [What is IndraQ CLI?](#what-is-indraq-cli)
31
32
  2. [Explain it like I am new](#explain-it-like-i-am-new)
32
- 3. [What happens during deployment?](#what-happens-during-deployment)
33
+ 3. [What changed in v1.5.5?](#what-changed-in-v155)
33
34
  4. [Requirements](#requirements)
34
35
  5. [Install Java 21](#install-java-21)
35
- 6. [Install the CLI](#install-the-cli)
36
- 7. [First-time configuration](#first-time-configuration)
37
- 8. [Change configuration later](#change-configuration-later)
38
- 9. [Deploy development](#deploy-development)
39
- 10. [Deploy production](#deploy-production)
40
- 11. [Jenkins setup and rules](#jenkins-setup-and-rules)
41
- 12. [GitHub and GHCR](#github-and-ghcr)
42
- 13. [Where configuration and secrets live](#where-configuration-and-secrets-live)
43
- 14. [Command reference](#command-reference)
44
- 15. [Project architecture](#project-architecture)
45
- 16. [Common errors](#common-errors)
46
- 17. [Frequently asked questions](#frequently-asked-questions)
47
- 18. [Final checklist](#final-checklist)
48
- 19. [Future modules](#future-modules)
49
- 20. [Publishing and npm organization management](#publishing-and-npm-organization-management)
50
- 21. [License](#license)
36
+ 6. [Install IndraQ CLI](#install-indraq-cli)
37
+ 7. [Run the doctor](#run-the-doctor)
38
+ 8. [Configuration home](#configuration-home)
39
+ 9. [Configure Jenkins](#configure-jenkins)
40
+ 10. [Configure Docker / GHCR](#configure-docker--ghcr)
41
+ 11. [Configure Mobile App](#configure-mobile-app)
42
+ 12. [Docker deployment](#docker-deployment)
43
+ 13. [Mobile build overview](#mobile-build-overview)
44
+ 14. [Mobile build matrix](#mobile-build-matrix)
45
+ 15. [Mobile build commands](#mobile-build-commands)
46
+ 16. [Mobile build flags](#mobile-build-flags)
47
+ 17. [Android versioning and artifact names](#android-versioning-and-artifact-names)
48
+ 18. [How local source reaches Jenkins](#how-local-source-reaches-jenkins)
49
+ 19. [Root .env behavior](#root-env-behavior)
50
+ 20. [Mobile Jenkins setup](#mobile-jenkins-setup)
51
+ 21. [Configuration and secret storage](#configuration-and-secret-storage)
52
+ 22. [Upgrade from v1.4 / v1.5](#upgrade-from-v14--v15)
53
+ 23. [Command reference](#command-reference)
54
+ 24. [Troubleshooting](#troubleshooting)
55
+ 25. [Frequently asked questions](#frequently-asked-questions)
56
+ 26. [Project architecture](#project-architecture)
57
+ 27. [Final checklist](#final-checklist)
58
+ 28. [License](#license)
51
59
 
52
60
  ---
53
61
 
54
- ## What are we building?
62
+ ## What is IndraQ CLI?
55
63
 
56
- IndraQ CLI is a small program that runs inside your terminal. Instead of remembering many Docker, GitHub, GHCR, and Jenkins commands, you tell **IndraQ CLI what you want**, and it performs the boring steps for you.
64
+ IndraQ CLI is a program you install once on a developer computer and then use from **any project folder**.
57
65
 
58
- Today it handles deployment:
66
+ Instead of remembering many Docker, GitHub, Jenkins, Android, and build commands, you run a small IndraQ command such as:
59
67
 
60
- ```text
61
- Your project
62
-
63
- ├── Dockerfile
64
-
65
- └── indraq deploy:dev
66
-
67
- ├── check Docker / GitHub / Java / Jenkins
68
- ├── build Docker image
69
- ├── push image to GHCR
70
- ├── find matching Jenkins job
71
- ├── start Jenkins build
72
- └── show Jenkins logs in this terminal
68
+ ```bash
69
+ indraq deploy:dev
73
70
  ```
74
71
 
75
- The goal is not to make one huge deployment script. The goal is to build a **modular engineering CLI platform** where future commands can live beside deployment cleanly.
76
-
77
- ---
72
+ or:
78
73
 
79
- ## Explain it like I am new
74
+ ```bash
75
+ indraq build mobile:staging
76
+ ```
80
77
 
81
- Imagine you made a school project and want to put the new version on a server.
78
+ The CLI validates the request, uses the saved configuration for the current project, performs the work, and shows failures directly in the same VS Code terminal.
82
79
 
83
- Without IndraQ CLI, you may need to remember a long list of commands: build an image, log in to GitHub's registry, push the image, open Jenkins, find the correct pipeline, start it, and then watch the logs.
80
+ ### One installation, many projects
84
81
 
85
- With IndraQ CLI, after one-time setup you type:
82
+ Install globally once:
86
83
 
87
84
  ```bash
88
- indraq deploy:dev
85
+ npm install -g indraq_cli
89
86
  ```
90
87
 
91
- The CLI does the sequence for you. If something is wrong, it stops and tells you what is wrong instead of silently continuing.
88
+ Then use it anywhere:
92
89
 
93
- ### The three names you should remember
90
+ ```text
91
+ C:\Projects\accounting-service> indraq deploy:dev
92
+ C:\Projects\mobile-app> indraq build mobile:dev
93
+ C:\Projects\another-app> indraq configure
94
+ ```
94
95
 
95
- | Thing | Simple meaning |
96
- |---|---|
97
- | **Docker image** | A packaged copy of your application |
98
- | **GHCR** | GitHub's place for storing Docker images |
99
- | **Jenkins pipeline/job** | The automation that deploys or processes your image |
96
+ Each project keeps its own `.indraq/` configuration. The CLI itself is not installed separately in every project.
100
97
 
101
98
  ---
102
99
 
103
- ## What happens during deployment?
100
+ ## Explain it like I am new
104
101
 
105
- ```mermaid
106
- flowchart TD
107
- A[indraq deploy:dev / deploy:prod] --> B{Configuration exists?}
108
- B -- No --> C[Stop: run indraq configure]
109
- B -- Yes --> D[Check Docker, GitHub, Java and Jenkins]
110
- D --> E{Jenkins job exists?}
111
- E -- No --> F[Stop with clear error]
112
- E -- Yes --> G[Ask for Docker tag]
113
- G --> H[Build Docker image]
114
- H --> I[Authenticate to GHCR]
115
- I --> J[Push image to GHCR]
116
- J --> K[Run Jenkins CLI build]
117
- K --> L[Stream Jenkins console output]
118
- L --> M{Pipeline result}
119
- M -- Failed --> N[Return failure and keep logs visible]
120
- M -- Success --> O[Deployment complete]
121
- ```
122
-
123
- The Jenkins job name is intentionally simple:
124
-
125
- > **Jenkins job name = configured image name**
102
+ Imagine you built a school project.
126
103
 
127
- Example:
104
+ You have the project files on your computer. You want another computer called **Jenkins** to build or deploy them for you.
128
105
 
129
- ```text
130
- Image name: immortality-accounting-service
131
- Expected Jenkins job: immortality-accounting-service
132
- GHCR image: ghcr.io/indraq-innovations/immortality-accounting-service
133
- ```
106
+ Without IndraQ CLI, you may need to:
134
107
 
135
- If Jenkins does not contain that job, deployment stops before building the Docker image.
108
+ 1. remember many commands;
109
+ 2. open Jenkins in the browser;
110
+ 3. choose the correct job;
111
+ 4. fill many parameters;
112
+ 5. copy environment variables;
113
+ 6. wait for the build;
114
+ 7. keep refreshing logs.
136
115
 
137
- ---
116
+ With IndraQ CLI, you configure the project once and later type one command.
138
117
 
139
- ## Requirements
118
+ For a mobile app:
140
119
 
141
- Install these before using the deployment module.
120
+ ```text
121
+ Your VS Code project
122
+
123
+ │ indraq build mobile:prod
124
+
125
+ IndraQ CLI
126
+
127
+ ├── checks you are at the project root
128
+ ├── validates Expo / React Native
129
+ ├── reads the saved Production settings
130
+ ├── reads root .env automatically
131
+ ├── creates a clean source snapshot
132
+ ├── sends it to Production Jenkins
133
+ └── shows Jenkins logs here
134
+
135
+
136
+ Production Jenkins
137
+
138
+ ├── installs dependencies
139
+ ├── prepares Android
140
+ ├── builds APK/AAB
141
+ └── publishes the artifact
142
+ ```
143
+
144
+ You do **not** need to give Jenkins a Git URL, Git branch, app subdirectory, or pasted `.env` content for this mobile workflow.
142
145
 
143
- | Requirement | Why it is needed | Quick check |
144
- |---|---|---|
145
- | **Node.js 24** | Runs IndraQ CLI | `node --version` |
146
- | **npm** | Installs the CLI | `npm --version` |
147
- | **Git** | Detects your GitHub authentication | `git --version` |
148
- | **Docker** | Builds and pushes images | `docker --version` |
149
- | **Java** | Runs `jenkins-cli.jar` | `java -version` |
150
- | **Jenkins account** | Starts your pipeline | Jenkins username + API token/password |
146
+ ---
151
147
 
152
- > [!TIP]
153
- > Jenkins accepts passwords for the CLI in many configurations, but an **API token is strongly preferred**. Treat the prompt `API token or password` as "paste your Jenkins API token here" whenever possible.
148
+ ## What changed in v1.5.5?
154
149
 
155
- ### Java is not optional
150
+ v1.5.5 keeps the Android versioning and Jenkins/Git workflow from v1.5.x and hardens Android builds created from Windows source snapshots.
156
151
 
157
- Jenkins provides its CLI as a Java `.jar` file. IndraQ CLI downloads that file from your Jenkins server, so your computer must be able to run:
152
+ This patch fixes the mobile Jenkinsfile Groovy escaping error, makes the mobile Jenkins job name deterministic, makes project configuration Git-shareable, keeps Jenkins login credentials machine-local, and makes Docker deployments send the exact manual deployment parameters expected by the Jenkins pipeline.
158
153
 
159
- ```bash
160
- java -version
161
- ```
162
154
 
163
- If that command is not found, **do not continue to `indraq configure` yet**. Install Java first using the next section.
155
+ ### Jenkins-console-quality logs and server Gradle reuse in v1.5.5
164
156
 
165
- > [!IMPORTANT]
166
- > **IndraQ standard: Java 21 LTS.** Jenkins applies its Java support policy to CLI clients as well as controllers and agents. Standardizing every IndraQ developer machine on Java 21 avoids different developers running different Java versions.
157
+ - The terminal log streamer now reads Jenkins **`logText/progressiveHtml`**, the same progressive endpoint used by the classic Jenkins web console. Jenkins therefore removes/renders hidden `ConsoleNote` annotations before the CLI displays the text, so internal `ha:////...` payloads no longer pollute VS Code output.
158
+ - HTML markup is converted back to plain terminal text while preserving usernames, timestamps, Pipeline lines, errors, and normal line spacing. `progressiveText` remains only as a compatibility fallback with explicit ConsoleNote filtering.
159
+ - Failed mobile builds now end with a short **Key Jenkins error lines** summary plus the direct Jenkins build URL.
160
+ - The mobile Jenkinsfile still normalizes Windows CRLF in `android/gradlew`, but v1.5.5 also restores the Jenkins server's shared Gradle cache at `$HOME/.gradle` instead of creating an empty per-project Gradle cache.
161
+ - Gradle execution prefers the exact cached project-wrapper distribution. If no exact wrapper distribution is cached, an installed Jenkins-server Gradle from the same major version can be reused. The project wrapper remains the final fallback.
162
+ - If a wrapper download is genuinely necessary, the temporary Jenkins copy of `gradle-wrapper.properties` gets `networkTimeout=120000` (120 seconds) instead of failing at Gradle's short default timeout.
163
+ - `FULL_RESET` no longer deletes Jenkins' shared Gradle cache. It clears project-local npm/Expo caches and generated Android state only.
164
+ - Jenkins queue updates are printed as normal lines instead of carriage-return cursor updates.
167
165
 
168
- ---
166
+ ### Jenkins/Git behavior hardened in v1.5.x
169
167
 
170
- ## Install Java 21
168
+ - Mobile always targets the Jenkins job **`Mobile app Cli build`**. The job name is no longer configurable per project.
169
+ - The mobile Jenkinsfile no longer contains the Groovy-invalid escaped-dot expression that caused `unexpected char: '\'` during pipeline compilation.
170
+ - Mobile Jenkins HTTP uploads now preserve the Jenkins web-session cookie together with the CSRF crumb, fixing HTTP 403 responses when Jenkins is configured with username/password authentication. API-token authentication remains supported.
171
+ - Mobile build output now says explicitly that `.env` is excluded only from the source archive and is uploaded separately to Jenkins.
172
+ - `.indraq/mobile.json`, `.indraq/docker.json`, and `.indraq/jenkins.json` are intended to be committed to Git.
173
+ - `.indraq/jenkins.local.json`, Jenkins username/token/password, `.env`, and `jenkins-cli.jar` are machine-local and never meant to be committed.
174
+ - Docker CLI deployments now start Jenkins with `ACTION=DEPLOY`, `IMAGE_TAG`, optional `IMAGE_DIGEST`, and `DEPLOYMENT_SOURCE=INDRAQ_CLI`.
175
+ - Expo versions are synchronized to `app.json` when possible. React Native CLI versions are synchronized to `android/app/build.gradle` / `build.gradle.kts` when those values are simple literals. Jenkins still enforces the requested version during the actual Android build.
171
176
 
172
- You only need to do this once on each developer machine.
177
+ ### App name is now part of Mobile configuration
173
178
 
174
- ### Windows recommended method
179
+ Every mobile project stores an app name. IndraQ uses this name when it creates the final APK/AAB filename.
175
180
 
176
- Open **PowerShell** or **Windows Terminal** and install Eclipse Temurin 21:
181
+ ### Android Version and versionCode
177
182
 
178
- ```powershell
179
- winget install EclipseAdoptium.Temurin.21.JDK
183
+ New projects start with:
184
+
185
+ ```text
186
+ Version: 0.1
187
+ versionCode: 1
180
188
  ```
181
189
 
182
- When installation finishes, **close VS Code and all terminal windows, then reopen them**. This is important because an already-open terminal may still have the old `PATH`.
190
+ Both counters auto-increment **after a successful Jenkins build** by default. Failed or cancelled builds do not consume a version.
183
191
 
184
- Verify Java:
192
+ The version rule is simple: the final numeric part increases by one.
185
193
 
186
- ```powershell
187
- java -version
194
+ ```text
195
+ 0.1 → 0.2
196
+ 0.9 → 0.10
197
+ 1.2.3 → 1.2.4
188
198
  ```
189
199
 
190
- A successful result should begin with Java 21, for example:
200
+ `versionCode` increments by one:
191
201
 
192
202
  ```text
193
- openjdk version "21..."
203
+ 1 2 → 3 → 4
194
204
  ```
195
205
 
196
- Also verify where Windows found Java:
206
+ You can change either value or turn either auto-increment switch off from:
197
207
 
198
- ```powershell
199
- where.exe java
208
+ ```text
209
+ indraq configure
210
+ → Mobile App
211
+ → Version & versionCode
200
212
  ```
201
213
 
202
- You should see a Java installation path instead of an error.
203
-
204
- #### If `winget` is unavailable
214
+ When auto-increment is disabled, IndraQ does not block the build. It prints a soft warning reminding you that the same value will be reused.
205
215
 
206
- Download a **Java 21 JDK** installer from Eclipse Adoptium / Temurin and install it. During setup, enable the options that add Java to `PATH` and set `JAVA_HOME` when available.
216
+ ### Predictable Android artifact names
207
217
 
208
- Official installation documentation:
218
+ APK/AAB files produced by the IndraQ mobile Jenkinsfile now follow:
209
219
 
210
- - https://adoptium.net/installation/windows
211
- - https://learn.microsoft.com/windows/dev-environment/java
212
-
213
- #### If Java is installed but `java -version` still fails
220
+ ```text
221
+ <AppName>_<Version>_<versionCode>_<YYYY-MM-DD>_<HHmm>.<apk|aab>
222
+ ```
214
223
 
215
- First restart VS Code / your terminal. If it still fails, check:
224
+ Example:
216
225
 
217
- ```powershell
218
- $env:JAVA_HOME
219
- $env:Path
220
- where.exe java
226
+ ```text
227
+ Nefazo_0.1_1_2026-08-30_2051.apk
221
228
  ```
222
229
 
223
- If needed, set `JAVA_HOME` to your Java 21 installation folder and add `%JAVA_HOME%\bin` to the Windows system `Path`.
230
+ The date/time is always generated in **Asia/Kolkata (IST)**. Time contains hours and minutes only.
231
+
232
+ ### Mobile still always uses Production Jenkins
224
233
 
225
- Example installation location:
234
+ The Jenkins rule remains intentionally simple:
226
235
 
227
236
  ```text
228
- C:\Program Files\Eclipse Adoptium\jdk-21...
237
+ indraq build mobile:dev → Production Jenkins
238
+ indraq build mobile:staging → Production Jenkins
239
+ indraq build mobile:prod → Production Jenkins
229
240
  ```
230
241
 
231
- Then reopen the terminal and verify again:
242
+ Docker continues to support both Development and Production Jenkins:
232
243
 
233
- ```powershell
234
- java -version
235
- javac -version
244
+ ```text
245
+ indraq deploy:dev → Development Jenkins
246
+ indraq deploy:prod → Production Jenkins
236
247
  ```
237
248
 
238
- ### Ubuntu / Debian
249
+ ### Existing v1.4 mobile projects migrate automatically
239
250
 
240
- Install OpenJDK 21:
251
+ Existing `.indraq/mobile.json` files are upgraded automatically. Project type, app name, version/versionCode, auto-increment settings, and environment defaults are preserved when present. Older configurable mobile Jenkins job names are removed because mobile now always targets **`Mobile app Cli build`**.
241
252
 
242
- ```bash
243
- sudo apt update
244
- sudo apt install -y openjdk-21-jdk
245
- ```
253
+ ---
246
254
 
247
- Verify:
255
+ ## Requirements
248
256
 
249
- ```bash
250
- java -version
251
- javac -version
252
- ```
257
+ ### Developer computer
253
258
 
254
- If more than one Java version is installed, check/select the active version with:
259
+ | Requirement | Why | Check |
260
+ |---|---|---|
261
+ | **Node.js 22+** | Runs IndraQ CLI | `node --version` |
262
+ | **npm** | Installs / updates the CLI | `npm --version` |
263
+ | **Git** | Docker/GHCR authentication and optional source revision metadata | `git --version` |
264
+ | **Docker** | Docker deployment module | `docker --version` |
265
+ | **Java** | Runs Jenkins CLI | `java -version` |
266
+ | **tar** | Packages the local mobile source snapshot | `tar --version` |
267
+ | **Jenkins account** | Starts Jenkins jobs | Jenkins username + API token |
255
268
 
256
- ```bash
257
- sudo update-alternatives --config java
258
- ```
269
+ > [!TIP]
270
+ > Node.js **24** is recommended for IndraQ developer machines, but v1.5.5 supports Node.js **22 and newer**.
259
271
 
260
- ### macOS
272
+ ### Jenkins mobile build machine
261
273
 
262
- If Homebrew is installed:
274
+ The provided mobile Jenkinsfile expects the Jenkins agent to have:
263
275
 
264
- ```bash
265
- brew install --cask temurin@21
276
+ - Java;
277
+ - Node.js and npm;
278
+ - Android SDK;
279
+ - `sdkmanager`;
280
+ - Bash;
281
+ - `tar` / `sha256sum`;
282
+ - Jenkins **File Parameter** plugin;
283
+ - writable `/opt/mobile-builder`;
284
+ - Android SDK at `/opt/android-sdk` unless you edit the Jenkinsfile;
285
+ - the Jenkins account should have a writable `$HOME/.gradle` cache (normally `/var/jenkins_home/.gradle`);
286
+ - optionally, a system `gradle` executable may be installed. IndraQ uses it only when its major version matches the project wrapper.
287
+
288
+ ---
289
+
290
+ ## Install Java 21
291
+
292
+ Java is required because Jenkins distributes its CLI as `jenkins-cli.jar`.
293
+
294
+ ### Windows
295
+
296
+ Open PowerShell:
297
+
298
+ ```powershell
299
+ winget install EclipseAdoptium.Temurin.21.JDK
266
300
  ```
267
301
 
268
- Then reopen the terminal and verify:
302
+ Then **fully close and reopen VS Code**.
269
303
 
270
- ```bash
304
+ Verify:
305
+
306
+ ```powershell
271
307
  java -version
308
+ where.exe java
272
309
  ```
273
310
 
274
- ### Final Java check
275
-
276
- Do not continue until this works:
311
+ ### Ubuntu / Debian
277
312
 
278
313
  ```bash
314
+ sudo apt update
315
+ sudo apt install -y openjdk-21-jdk
279
316
  java -version
280
317
  ```
281
318
 
282
- Then run:
319
+ ### macOS
320
+
321
+ Using Homebrew:
283
322
 
284
323
  ```bash
285
- indraq configure
324
+ brew install --cask temurin@21
325
+ java -version
286
326
  ```
287
327
 
288
- IndraQ CLI will perform the Java check again before downloading and starting `jenkins-cli.jar`.
328
+ > [!IMPORTANT]
329
+ > If `java -version` fails, fix Java before running Jenkins configuration.
289
330
 
290
331
  ---
291
332
 
292
- ## Install the CLI
333
+ ## Install IndraQ CLI
293
334
 
294
- IndraQ CLI is published as the public npm package **`indraq_cli`**. Install it globally once:
335
+ Install globally:
295
336
 
296
337
  ```bash
297
338
  npm install -g indraq_cli
298
339
  ```
299
340
 
300
- Then verify the command:
341
+ Verify:
301
342
 
302
343
  ```bash
303
344
  indraq --version
304
- indraq --help
305
- ```
306
-
307
- You should now be able to use `indraq` from any project folder:
308
-
309
- ```bash
310
- indraq configure
311
- indraq deploy:dev
312
- indraq deploy:prod
313
345
  ```
314
346
 
315
- ### Update to the newest version
347
+ Expected for this release:
316
348
 
317
- ```bash
318
- npm update -g indraq_cli
349
+ ```text
350
+ 1.5.3
319
351
  ```
320
352
 
321
- Then confirm the installed version:
353
+ Update later:
322
354
 
323
355
  ```bash
324
- indraq --version
356
+ npm install -g indraq_cli@latest
325
357
  ```
326
358
 
327
- ### Uninstall
359
+ Uninstall:
328
360
 
329
361
  ```bash
330
362
  npm uninstall -g indraq_cli
331
363
  ```
332
364
 
333
- ### If `indraq` is not found after installation
365
+ ---
366
+
367
+ ## Run the doctor
334
368
 
335
- First check where npm installs global commands:
369
+ Before debugging a mysterious machine problem, run:
336
370
 
337
371
  ```bash
338
- npm prefix -g
372
+ indraq doctor
339
373
  ```
340
374
 
341
- On Windows, also run:
375
+ It checks:
342
376
 
343
- ```powershell
344
- where.exe indraq
345
- ```
377
+ - Node.js version;
378
+ - Java;
379
+ - Git;
380
+ - `tar`;
381
+ - how the `indraq` command resolves on your machine.
346
382
 
347
- On macOS/Linux:
383
+ This is especially useful on Windows if another file named `IndraQ` is shadowing the npm executable.
348
384
 
349
- ```bash
350
- which indraq
351
- ```
352
-
353
- If another file or program is found before the npm launcher, run `indraq doctor` if the CLI is reachable by another terminal/session, or fix the conflicting PATH entry.
385
+ ---
354
386
 
355
- ### Developing the CLI itself
387
+ ## Configuration home
356
388
 
357
- Contributors working on the IndraQ CLI source can still use:
389
+ Run from the project you want to configure:
358
390
 
359
391
  ```bash
360
- npm ci
361
- npm run build
362
- npm link
392
+ indraq configure
363
393
  ```
364
394
 
365
- `npm link` is for CLI development only. Normal users should install the published package with `npm install -g indraq_cli`.
395
+ You will see:
366
396
 
367
- ---
397
+ ```text
398
+ IndraQ CLI Configuration
368
399
 
369
- ## First-time configuration
400
+ ? What do you want to configure?
401
+ > Jenkins
402
+ Docker / GHCR
403
+ Mobile App
404
+ ------------------------------
405
+ Review current project configuration
406
+ Exit
407
+ ```
370
408
 
371
- Go to the **application repository you want to deploy**, not the IndraQ CLI source repository.
409
+ The rule is simple:
372
410
 
373
- Example:
411
+ > **Persistent settings are changed with `indraq configure`. One-time build changes are supplied as flags.**
374
412
 
375
- ```bash
376
- cd C:\Projects\my-service
377
- indraq configure
378
- ```
413
+ ---
414
+
415
+ ## Configure Jenkins
379
416
 
380
- On the **first run only**, IndraQ CLI does a complete setup because the project does not have a finished deployment configuration yet.
417
+ Choose:
381
418
 
382
419
  ```text
383
- indraq configure
384
-
385
- ├── choose environment
386
- ├── configure image name
387
- ├── connect and verify Jenkins
388
- ├── choose GitHub / GHCR destination
389
- ├── choose Dockerfile
390
- └── save configuration
420
+ Configure
421
+ └── Jenkins
391
422
  ```
392
423
 
393
- After this first successful setup, `indraq configure` changes behavior. It does **not** make you enter everything again. See [Change configuration later](#change-configuration-later).
394
-
395
- ### Step 1 - Choose environment
424
+ The Jenkins menu is:
396
425
 
397
426
  ```text
398
- ? Select the environment you want to configure:
399
427
  > Development
400
- Production
428
+ Production — used by all mobile builds
429
+ ------------------
430
+ Review Jenkins connections
431
+ Back
401
432
  ```
402
433
 
403
- Development is stored as `dev`; production is stored as `prod`.
434
+ There are only **two Jenkins infrastructure environments** in a project.
404
435
 
405
- ### Step 2 - Enter image name
436
+ | Jenkins connection | Used by |
437
+ |---|---|
438
+ | **Development** | `indraq deploy:dev` |
439
+ | **Production** | `indraq deploy:prod` **and every mobile build** |
406
440
 
407
- Example:
441
+ This means:
408
442
 
409
443
  ```text
410
- ? Enter image name for DEV environment:
411
- immortality-accounting-service
444
+ Mobile Development ┐
445
+ Mobile Staging ├──→ Production Jenkins
446
+ Mobile Production ┘
412
447
  ```
413
448
 
414
- This name is important because the CLI also looks for a Jenkins job with **the same name**.
449
+ A command such as `indraq build mobile:dev` means **build the app using its Development mobile settings on Production Jenkins**. It does not mean “use Development Jenkins.”
415
450
 
416
- ### Step 3 - Connect Jenkins
417
-
418
- You enter:
451
+ For each Jenkins connection, IndraQ asks for:
419
452
 
420
453
  ```text
421
454
  Jenkins URL/domain
@@ -423,769 +456,1161 @@ Jenkins username
423
456
  Jenkins API token or password
424
457
  ```
425
458
 
426
- Example Jenkins URL:
427
-
428
- ```text
429
- https://jenkins.example.com
430
- ```
459
+ It then:
431
460
 
432
- IndraQ CLI then performs these checks automatically:
461
+ 1. downloads `<jenkins>/jnlpJars/jenkins-cli.jar`;
462
+ 2. stores the secret outside the project;
463
+ 3. runs Jenkins `who-am-i`;
464
+ 4. rejects wrong credentials immediately;
465
+ 5. saves the verified non-secret connection metadata in `.indraq/jenkins.json`.
433
466
 
434
- ```text
435
- 1. Is Java available?
436
- 2. Can the CLI download /jnlpJars/jenkins-cli.jar?
437
- 3. Can these credentials authenticate?
438
- 4. Does Jenkins CLI `who-am-i` identify a real user?
439
- 5. Does WebSocket mode work? If not, can HTTP CLI mode work?
440
- ```
467
+ Configure Jenkins once per project. Normal Docker/mobile build commands reuse the saved connection and credentials.
441
468
 
442
- If the credentials are wrong, configuration **fails immediately**. Bad Jenkins credentials are not silently saved.
469
+ Use a Jenkins API token instead of an account password whenever possible.
443
470
 
444
- > [!NOTE]
445
- > The Jenkins connection is currently **project-level**. Development and Production share the same Jenkins controller/account, while each environment can have its own image/job name.
471
+ ---
446
472
 
447
- ### Step 4 - Choose GitHub destination
473
+ ## Configure Docker / GHCR
448
474
 
449
- You choose:
475
+ Choose:
450
476
 
451
477
  ```text
452
- Personal GitHub account
453
- or
454
- GitHub organization
478
+ Configure
479
+ └── Docker / GHCR
455
480
  ```
456
481
 
457
- If you select an organization, the CLI shows the organizations available to your authenticated GitHub account.
458
-
459
- Example:
482
+ The menu lets you independently change:
460
483
 
461
484
  ```text
462
- ? Where do you want to push the GHCR image? Organization
463
- ? Select a GitHub organization: IndraQ-Innovations
485
+ Development
486
+ Production
487
+ GitHub / GHCR destination
488
+ Review
489
+ Back
464
490
  ```
465
491
 
466
- > [!NOTE]
467
- > The GitHub/GHCR destination is currently **project-level** and is shared by Development and Production.
492
+ Development and Production each store:
493
+
494
+ - image name;
495
+ - Dockerfile path.
496
+
497
+ GitHub/GHCR stores:
468
498
 
469
- ### Step 5 - Choose Dockerfile
499
+ - personal account or organization;
500
+ - selected GHCR owner.
470
501
 
471
- Usually choose the normal file:
502
+ The Docker deployment Jenkins connection is configured separately under **Jenkins**.
503
+
504
+ When `indraq deploy:dev` or `indraq deploy:prod` has built and pushed the image, the CLI starts the Jenkins job whose name matches the image repository name (for example `ghcr.io/indraq-innovations/immortality-accounting-service` maps to Jenkins job `immortality-accounting-service`) and supplies exactly:
472
505
 
473
506
  ```text
474
- Dockerfile
507
+ ACTION=DEPLOY
508
+ IMAGE_TAG=<primary pushed tag>
509
+ IMAGE_DIGEST=<sha256 digest, when available>
510
+ DEPLOYMENT_SOURCE=INDRAQ_CLI
475
511
  ```
476
512
 
477
- If your Dockerfile has another path, select the custom-path option.
478
-
479
- The Dockerfile path is stored separately for Development and Production.
513
+ This is the CLI path; the Jenkinsfile may still keep its Generic Webhook Trigger for other deployment sources if you want it.
480
514
 
481
515
  ---
482
516
 
483
- ## Change configuration later
484
-
485
- This is the normal behavior after the project has already been configured once.
517
+ ## Configure Mobile App
486
518
 
487
- Run:
519
+ Choose:
488
520
 
489
- ```bash
490
- indraq configure
521
+ ```text
522
+ Configure
523
+ └── Mobile App
491
524
  ```
492
525
 
493
- First choose the environment you want to work on:
526
+ The menu is:
494
527
 
495
528
  ```text
496
- ? Select the environment you want to configure:
497
- > Development
529
+ > Project settings
530
+ Version & versionCode
531
+ Development
532
+ Staging
498
533
  Production
534
+ ------------------
535
+ Review Mobile App configuration
536
+ Back
499
537
  ```
500
538
 
501
- Then IndraQ CLI shows a **settings menu** instead of replaying the whole setup wizard:
539
+ ### Project settings
540
+
541
+ IndraQ asks for:
502
542
 
503
543
  ```text
504
- ? What do you want to configure for Development?
505
- > Image name (immortality-accounting-service)
506
- Jenkins connection (https://jenkins.example.com (harry)) [shared]
507
- GitHub / GHCR destination (organization: indraq-innovations) [shared]
508
- Dockerfile path (Dockerfile)
509
- ─────────────────────────────────────────────────────────────
510
- Review current configuration
511
- Exit configuration
544
+ Mobile app name
545
+ Project type
546
+ - Expo
547
+ - React Native CLI
512
548
  ```
513
549
 
514
- Choose **only the setting you actually want to change**.
550
+ The app name is saved per project and is used in the final APK/AAB filename.
515
551
 
516
- For example, if you only want to change the Dockerfile:
552
+ The mobile Jenkins job is **not configurable**. Every mobile build targets exactly:
517
553
 
518
554
  ```text
519
- Dockerfile path
520
-
521
- change Dockerfile
522
-
523
- save only that change
524
-
525
- return to the settings menu
555
+ Mobile app Cli build
526
556
  ```
527
557
 
528
- The other settings are left untouched.
558
+ All mobile Development, Staging, and Production builds use the project's **Production Jenkins** connection. The CLI verifies that `Mobile app Cli build` exists before uploading source.
529
559
 
530
- ### The menu stays open until you exit
560
+ ### Version & versionCode settings
531
561
 
532
- After every successful change, IndraQ CLI saves it and returns you to the same menu:
562
+ Choose:
533
563
 
534
564
  ```text
535
- Change image name
536
-
537
- Saved
538
-
539
- Settings menu
540
-
541
- Change GitHub destination
542
-
543
- Saved
544
-
545
- Settings menu
546
-
547
- Exit configuration
565
+ Mobile App
566
+ → Version & versionCode
548
567
  ```
549
568
 
550
- This lets you update several settings in one session without running `indraq configure` again and again.
551
-
552
- If you are finished, choose:
569
+ You can configure these independently:
553
570
 
554
571
  ```text
555
- Exit configuration
572
+ Version
573
+ versionCode
574
+ Auto-increment Version
575
+ Auto-increment versionCode
556
576
  ```
557
577
 
558
- ### Review without changing anything
559
-
560
- Choose:
578
+ Defaults:
561
579
 
562
580
  ```text
563
- Review current configuration
581
+ Version: 0.1
582
+ versionCode: 1
583
+ Auto-increment Version: ON
584
+ Auto-increment versionCode: ON
564
585
  ```
565
586
 
566
- The CLI shows the selected environment's non-secret settings, including:
587
+ Auto-increment happens only after Jenkins reports `SUCCESS`. A failed build leaves both saved values unchanged.
588
+
589
+ If you manually change Version/versionCode while a Jenkins build is still running, IndraQ will not overwrite your newer values when that build finishes.
590
+
591
+ ### Version values survive Git clones
592
+
593
+ `.indraq/mobile.json` is project configuration and should be committed. That means another developer who clones/pulls the repository receives the same next Version/versionCode.
594
+
595
+ IndraQ also synchronizes the configured values into the Android-facing project file when it can do so safely:
567
596
 
568
597
  ```text
569
- Environment
570
- Image name
571
- Dockerfile path
572
- GHCR destination
573
- Jenkins URL
574
- Jenkins username
575
- Expected Jenkins job name
598
+ Expo → app.json → expo.version + expo.android.versionCode
599
+ React Native CLI → android/app/build.gradle(.kts) → versionName + versionCode
576
600
  ```
577
601
 
578
- The Jenkins API token/password is **never printed**.
602
+ Before a remote build, Jenkins applies the requested values again after Expo prebuild / before Gradle, so the artifact uses the values shown in the CLI build plan.
603
+
604
+ After a successful build with auto-increment enabled, commit the changed `.indraq/mobile.json` and synced app-version file(s). Failed builds do not increment the shared values.
605
+
606
+ ### Environment settings
607
+
608
+ Each mobile environment stores:
579
609
 
580
- ### What is environment-specific and what is shared?
610
+ - default build output;
611
+ - default build profile.
581
612
 
582
- | Setting | Development / Production separate? |
613
+ Profiles:
614
+
615
+ | Profile | Meaning |
583
616
  |---|---|
584
- | Image name | **Yes** |
585
- | Dockerfile path | **Yes** |
586
- | Jenkins connection | No shared by the project |
587
- | GitHub / GHCR destination | No — shared by the project |
588
- | Jenkins API token/password | No — tied to the saved Jenkins account and kept outside the project config |
617
+ | **FAST** | Fresh source snapshot; reuse project npm cache plus the Jenkins server shared Gradle cache |
618
+ | **CLEAN** | Clean generated project build state before building |
619
+ | **FULL_RESET** | Clear project npm/Expo/generated Android state while preserving the Jenkins server shared Gradle cache |
589
620
 
590
- If you change a setting marked **`[shared]`**, that change affects deployments for both Development and Production.
621
+ After saving one environment you return to the Mobile App menu, so you can configure another environment without rerunning the command.
591
622
 
592
623
  ---
593
624
 
594
- ## Deploy development
625
+ ## Docker deployment
595
626
 
596
- Use either command:
627
+ Development:
597
628
 
598
629
  ```bash
599
630
  indraq deploy:dev
600
631
  ```
601
632
 
602
- or the long alias:
633
+ Alias:
603
634
 
604
635
  ```bash
605
636
  indraq deploy:development
606
637
  ```
607
638
 
608
- The CLI checks the **development** configuration, builds the configured image, pushes it to GHCR, and starts the Jenkins job with the same image name.
639
+ Production:
609
640
 
610
- You will be asked for one or more Docker tags:
641
+ ```bash
642
+ indraq deploy:prod
643
+ ```
644
+
645
+ Alias:
646
+
647
+ ```bash
648
+ indraq deploy:production
649
+ ```
650
+
651
+ Docker deployment still follows this flow:
611
652
 
612
653
  ```text
613
- ? Enter image tags: latest
654
+ validate Docker / GitHub / Java / Jenkins
655
+
656
+ build Docker image
657
+
658
+ push image to GHCR
659
+
660
+ find Jenkins job with same name as image
661
+
662
+ run Jenkins pipeline
663
+
664
+ stream logs into terminal
614
665
  ```
615
666
 
616
- Multiple tags are supported:
667
+ ---
668
+
669
+ ## Mobile build overview
670
+
671
+ > [!IMPORTANT]
672
+ > **Every mobile build runs on the saved Production Jenkins connection.** `mobile:dev`, `mobile:staging`, and `mobile:prod` are mobile application environments, not Jenkins environments.
673
+
674
+
675
+ The mobile module deliberately does **not** ask for:
676
+
677
+ - Git repository URL;
678
+ - Git branch;
679
+ - app subdirectory;
680
+ - pasted env text;
681
+ - "save env" checkbox.
682
+
683
+ Why? Because the CLI is already running inside the developer's project.
684
+
685
+ ### Root directory rule
686
+
687
+ Run mobile builds from the directory containing the mobile app's `package.json`.
688
+
689
+ Correct:
690
+
691
+ ```text
692
+ my-mobile-app/
693
+ ├── package.json ← run command here
694
+ ├── .env
695
+ ├── src/
696
+ ├── android/ ← React Native CLI
697
+ └── ...
698
+ ```
699
+
700
+ Wrong:
701
+
702
+ ```text
703
+ my-mobile-app/android/ ← do not run it here
704
+ ```
705
+
706
+ IndraQ does not silently search parent folders. If `package.json` is not in the current directory, the build stops.
707
+
708
+ ---
709
+
710
+ ## Mobile build matrix
711
+
712
+ Invalid combinations are blocked both by the CLI **and** by the Jenkinsfile.
713
+
714
+ | Project type | Environment | Allowed output |
715
+ |---|---|---|
716
+ | Expo | Development | **Development Client only** |
717
+ | Expo | Staging | **Release APK** or **Release AAB** |
718
+ | Expo | Production | **Release APK** or **Release AAB** |
719
+ | React Native CLI | Development | **Debug APK only** |
720
+ | React Native CLI | Staging | **Release APK** or **Release AAB** |
721
+ | React Native CLI | Production | **Release APK** or **Release AAB** |
722
+
723
+ The CLI does not show impossible choices during configuration.
724
+
725
+ For example, Expo Development automatically becomes:
617
726
 
618
727
  ```text
619
- latest,dev-2026-08-30
728
+ Build output: Development Client
620
729
  ```
621
730
 
731
+ There is no pointless APK/AAB menu for that combination.
732
+
622
733
  ---
623
734
 
624
- ## Deploy production
735
+ ## Mobile build commands
625
736
 
626
- Use either:
737
+ Development:
627
738
 
628
739
  ```bash
629
- indraq deploy:prod
740
+ indraq build mobile:dev
630
741
  ```
631
742
 
632
- or:
743
+ Alias:
633
744
 
634
745
  ```bash
635
- indraq deploy:production
746
+ indraq build mobile:development
636
747
  ```
637
748
 
638
- A production deployment follows the same protected flow but uses the production environment configuration.
749
+ Staging:
639
750
 
640
- Example:
751
+ ```bash
752
+ indraq build mobile:staging
753
+ ```
641
754
 
642
- ```text
643
- Environment: PROD
644
- Image: ghcr.io/indraq-innovations/my-service
645
- Tag: 1.8.0
646
- Jenkins job: my-service
755
+ Production:
756
+
757
+ ```bash
758
+ indraq build mobile:prod
759
+ ```
760
+
761
+ Alias:
762
+
763
+ ```bash
764
+ indraq build mobile:production
765
+ ```
766
+
767
+ ### First build
768
+
769
+ If required mobile configuration is missing, the CLI asks only for the missing settings and saves them.
770
+
771
+ ### Later builds
772
+
773
+ Once configured:
774
+
775
+ ```bash
776
+ indraq build mobile:staging
647
777
  ```
648
778
 
779
+ uses the saved Staging output/profile without asking the same questions again.
780
+
781
+ Before uploading anything, IndraQ prints a build plan and asks for confirmation.
782
+
649
783
  ---
650
784
 
651
- ## Jenkins setup and rules
785
+ ## Mobile build flags
652
786
 
653
- ### How Jenkins CLI is obtained
787
+ Flags override saved defaults **for one build only**.
654
788
 
655
- You do **not** manually download a generic Jenkins CLI file.
789
+ They do not permanently change `mobile.json`.
790
+
791
+ ### Output override
792
+
793
+ ```bash
794
+ indraq build mobile:staging --output aab
795
+ ```
656
796
 
657
- During `indraq configure`, the CLI downloads the JAR directly from the Jenkins controller you entered:
797
+ Accepted output aliases:
658
798
 
659
799
  ```text
660
- https://YOUR-JENKINS/jnlpJars/jenkins-cli.jar
800
+ dev-client / development-client
801
+ debug / debug-apk
802
+ apk / release-apk
803
+ aab / release-aab
661
804
  ```
662
805
 
663
- This keeps the client aligned with that Jenkins controller.
806
+ The matrix is still enforced. For example, this is rejected:
664
807
 
665
- ### How credentials are checked
808
+ ```bash
809
+ indraq build mobile:dev --output aab
810
+ ```
666
811
 
667
- IndraQ CLI uses Jenkins CLI's `who-am-i` command. If Jenkins authenticates the user, setup continues. If authentication fails or Jenkins sees the request as anonymous, configuration stops.
812
+ for an Expo Development project.
668
813
 
669
- ### How a deployment is triggered
814
+ ### Profile override
670
815
 
671
- After the Docker image is successfully pushed, IndraQ CLI runs the equivalent of:
816
+ ```bash
817
+ indraq build mobile:prod --profile clean
818
+ ```
819
+
820
+ Available profiles:
672
821
 
673
822
  ```text
674
- jenkins-cli.jar build <IMAGE_NAME> -s -v
823
+ fast
824
+ clean
825
+ full-reset
826
+ ```
827
+
828
+ ### Verbose Gradle logs
829
+
830
+ ```bash
831
+ indraq build mobile:prod --verbose
675
832
  ```
676
833
 
677
- `-s` waits for Jenkins to finish and returns Jenkins' success/failure result. `-v` prints the build console output.
834
+ ### Dry run
678
835
 
679
- That means the VS Code terminal becomes your Jenkins log window:
836
+ Validate everything and print the plan without uploading source or starting Jenkins:
680
837
 
681
- ```text
682
- Started my-service #142
683
- [Pipeline] Start of Pipeline
684
- [Pipeline] stage
685
- [Pipeline] { (Deploy)
686
- ...
687
- Finished: SUCCESS
688
- Completed my-service #142 : SUCCESS
838
+ ```bash
839
+ indraq build mobile:staging --dry-run
840
+ ```
841
+
842
+ ### Skip final confirmation
843
+
844
+ Useful for a developer who already knows exactly what will run:
845
+
846
+ ```bash
847
+ indraq build mobile:prod --yes
689
848
  ```
690
849
 
691
- If Jenkins fails, the CLI also fails and leaves the Jenkins error output visible above it.
850
+ Example combination:
851
+
852
+ ```bash
853
+ indraq build mobile:prod --output aab --profile clean --verbose --yes
854
+ ```
692
855
 
693
- ### Required Jenkins permissions
856
+ ---
694
857
 
695
- The Jenkins user must be allowed to:
858
+ ## Android versioning and artifact names
696
859
 
697
- - authenticate to Jenkins CLI;
698
- - read the target job;
699
- - trigger/build the target job;
700
- - view the build output needed by the CLI.
860
+ IndraQ v1.5.5 currently manages **Android** versioning only. iOS version/build-number management is intentionally out of scope for now.
701
861
 
702
- If Jenkins returns `403`, ask the Jenkins administrator to check permissions for that account.
862
+ ### What value does a build use?
703
863
 
704
- ### Job naming rule
864
+ A build uses the values currently stored in `.indraq/mobile.json`.
705
865
 
706
- For now, IndraQ CLI deliberately uses a zero-mapping rule:
866
+ Example before the build:
707
867
 
708
868
  ```text
709
- Docker image name == Jenkins job name
869
+ Version: 0.1
870
+ versionCode: 1
710
871
  ```
711
872
 
712
- This avoids hidden routing tables and webhook payload rules.
873
+ The Jenkins build receives exactly `0.1` and `1`, applies them to the generated/native Android Gradle project, and produces the APK/AAB with those values.
713
874
 
714
- ---
875
+ Only after Jenkins finishes successfully are enabled counters advanced for the next build.
715
876
 
716
- ## GitHub and GHCR
877
+ ### Auto-increment examples
717
878
 
718
- IndraQ CLI accepts normal Git/Git Bash authentication and does **not** require GitHub CLI (`gh`).
879
+ With both switches ON:
719
880
 
720
- It can use:
881
+ ```text
882
+ Build 1 uses: 0.1 / 1
883
+ Success
884
+ Next saved: 0.2 / 2
721
885
 
722
- - Git Credential Manager / HTTPS credentials;
723
- - GitHub CLI credentials when available;
724
- - GitHub SSH authentication for Git operations.
886
+ Build 2 uses: 0.2 / 2
887
+ Success
888
+ Next saved: 0.3 / 3
889
+ ```
725
890
 
726
- GHCR does not accept SSH keys as registry credentials. If your GitHub session is SSH-only, Docker may still require a one-time registry login:
891
+ If `Auto-increment Version` is OFF:
727
892
 
728
- ```bash
729
- docker login ghcr.io
893
+ ```text
894
+ Version stays 0.1
895
+ versionCode may still move 1 → 2 → 3
730
896
  ```
731
897
 
732
- Your final image looks like:
898
+ If `Auto-increment versionCode` is OFF, IndraQ prints a warning before every mobile build because Android release stores normally expect a higher versionCode for upgrades.
899
+
900
+ ### Artifact filename
901
+
902
+ The Jenkins mobile pipeline renames the primary APK/AAB to:
733
903
 
734
904
  ```text
735
- ghcr.io/<owner>/<image>:<tag>
905
+ <AppName>_<Version>_<versionCode>_<YYYY-MM-DD>_<HHmm>.<extension>
736
906
  ```
737
907
 
738
908
  Example:
739
909
 
740
910
  ```text
741
- ghcr.io/indraq-innovations/immortality-accounting-service:latest
911
+ Nefazo_User_1.4_27_2026-08-30_2051.aab
742
912
  ```
743
913
 
914
+ Rules:
915
+
916
+ - timezone: `Asia/Kolkata` (IST);
917
+ - date: `YYYY-MM-DD`;
918
+ - time: 24-hour `HHmm`;
919
+ - seconds are intentionally omitted;
920
+ - unsafe filename characters in the configured app name are replaced with `_`.
921
+
744
922
  ---
745
923
 
746
- ## Where configuration and secrets live
924
+ ## How local source reaches Jenkins
747
925
 
748
- ### Project configuration
926
+ This is the mobile source-upload design.
749
927
 
750
- Each application gets:
928
+ The old mobile Jenkins pipeline cloned a Git URL. The new flow builds the files that are **actually on the developer's computer right now**.
751
929
 
752
- ```text
753
- <your-project>/.indraq/deploy.json
930
+ ```mermaid
931
+ flowchart TD
932
+ A[Developer runs indraq build mobile:prod] --> B[Verify current directory is project root]
933
+ B --> C[Validate Expo / React Native project]
934
+ C --> D[Create clean temporary source snapshot]
935
+ D --> E[Calculate SHA-256]
936
+ E --> F[Upload snapshot to Jenkins]
937
+ F --> G[Jenkins verifies SHA-256]
938
+ G --> H[Extract source]
939
+ H --> I[Build Android]
940
+ I --> J[Archive APK / AAB]
941
+ J --> K[Stream logs + artifact URL to terminal]
754
942
  ```
755
943
 
756
- Example:
944
+ ### What is excluded from the source snapshot?
757
945
 
758
- ```json
759
- {
760
- "schemaVersion": 2,
761
- "github": {
762
- "ownerType": "organization",
763
- "owner": "IndraQ-Innovations"
764
- },
765
- "jenkins": {
766
- "url": "https://jenkins.example.com",
767
- "username": "developer",
768
- "serverId": "8be77a9980d4c19a",
769
- "connectionMode": "webSocket"
770
- },
771
- "environments": {
772
- "dev": {
773
- "name": "Development",
774
- "imageName": "my-service-dev",
775
- "dockerfilePath": "Dockerfile"
776
- },
777
- "prod": {
778
- "name": "Production",
779
- "imageName": "my-service",
780
- "dockerfilePath": "Dockerfile"
781
- }
782
- }
783
- }
946
+ IndraQ excludes common generated/sensitive files such as:
947
+
948
+ ```text
949
+ .git/
950
+ .indraq/
951
+ node_modules/
952
+ coverage/
953
+ dist/
954
+ build/
955
+ .vscode/
956
+ .idea/
957
+ .env
958
+ .env.*
959
+ *.apk
960
+ *.aab
961
+ android/.gradle/
962
+ android/app/build/
963
+ ios/Pods/
784
964
  ```
785
965
 
786
- Notice what is **not** there: your Jenkins API token/password.
966
+ The source archive is created in the system temporary directory, uploaded, then deleted locally.
787
967
 
788
- ### Jenkins CLI cache and secret
968
+ ### Why SHA-256?
789
969
 
790
- Jenkins runtime files are kept under the user's home directory:
970
+ The CLI calculates a SHA-256 hash before upload. Jenkins calculates it again before extraction.
971
+
972
+ If they do not match, the build stops.
973
+
974
+ ---
975
+
976
+ ## Root .env behavior
977
+
978
+ You no longer paste `.env` into Jenkins.
979
+
980
+ For build outputs that need an environment file, IndraQ automatically uses:
791
981
 
792
982
  ```text
793
- ~/.indraq/jenkins/<server-id>/
794
- ├── jenkins-cli.jar
795
- └── auth
983
+ <mobile-project-root>/.env
796
984
  ```
797
985
 
798
- The `auth` file is passed to Jenkins CLI using its credential-file mechanism instead of putting the secret directly into the Java command line.
986
+ The `.env` file is:
987
+
988
+ 1. **not included** inside the source archive;
989
+ 2. uploaded separately as a Jenkins file parameter;
990
+ 3. copied into the temporary build source;
991
+ 4. never printed in logs;
992
+ 5. removed from the Jenkins workspace in `post { always { ... } }`.
799
993
 
800
994
  > [!CAUTION]
801
- > This is still a local secret. Never copy the `auth` file into a repository, chat message, ticket, or documentation. On shared computers, use a dedicated OS account and prefer Jenkins API tokens with limited permissions.
995
+ > Jenkins file parameters can remain in Jenkins build data according to your controller/plugin retention behavior. The workspace copy is deleted, but highly sensitive production secrets should still follow your normal Jenkins retention and secret-management policy.
802
996
 
803
- The project-local `.indraq` folder also gets a `.gitignore` so its local state is not accidentally committed.
997
+ If a required `.env` is missing, the build stops before source upload.
998
+
999
+ Expo Development Client does not require `.env`, but if a root `.env` exists IndraQ still supplies it automatically.
804
1000
 
805
1001
  ---
806
1002
 
807
- ## Command reference
1003
+ ## Mobile Jenkins setup
808
1004
 
809
- ### Normal commands
1005
+ The mobile source-upload workflow requires the Jenkins **File Parameter** plugin.
810
1006
 
811
- | Command | What it does |
812
- |---|---|
813
- | `indraq --version` | Show installed CLI version |
814
- | `indraq --help` | Show available commands |
815
- | `indraq configure` | First run: complete setup. Later runs: open the environment settings menu |
816
- | `indraq deploy:dev` | Deploy development |
817
- | `indraq deploy:development` | Same as `deploy:dev` |
818
- | `indraq deploy:prod` | Deploy production |
819
- | `indraq deploy:production` | Same as `deploy:prod` |
1007
+ ### Step 1 install the plugin
820
1008
 
821
- ### Structured commands
1009
+ In Jenkins:
822
1010
 
823
- These are kept for automation and discoverability:
824
-
825
- ```bash
826
- indraq deploy configure
827
- indraq deploy build --env dev
828
- indraq deploy build --env development
829
- indraq deploy build --env prod
830
- indraq deploy build --env production
1011
+ ```text
1012
+ Manage Jenkins
1013
+ → Plugins
1014
+ Available plugins
1015
+ search: File Parameter
1016
+ install "File Parameter"
831
1017
  ```
832
1018
 
833
- ---
1019
+ Plugin ID:
834
1020
 
835
- ## Project architecture
1021
+ ```text
1022
+ file-parameters
1023
+ ```
836
1024
 
837
- IndraQ CLI is module-based from day one:
1025
+ ### Step 2 use the IndraQ v1.5 mobile Jenkinsfile
1026
+
1027
+ This repository includes:
838
1028
 
839
1029
  ```text
840
- src/
841
- ├── index.ts
842
- ├── cli/
843
- │ └── create-program.ts
844
- ├── modules/
845
- │ └── deploy/
846
- │ ├── commands/
847
- │ │ ├── configure.command.ts
848
- │ │ └── build.command.ts
849
- │ ├── config/
850
- │ │ └── deployment-config.ts
851
- │ └── services/
852
- │ ├── docker.service.ts
853
- │ └── jenkins.service.ts
854
- └── shared/
855
- ├── git/
856
- └── github/
1030
+ templates/jenkins/Jenkinsfile-Mobile-App
857
1031
  ```
858
1032
 
859
- The rule is simple:
860
-
861
- > A future feature should become a module, not another giant block inside deployment.
1033
+ Use that pipeline for the Jenkins mobile build job.
862
1034
 
863
- For example:
1035
+ It declares two large file parameters:
864
1036
 
865
1037
  ```text
866
- src/modules/database/
867
- src/modules/backup/
868
- src/modules/server/
869
- src/modules/secrets/
870
- src/modules/diagnostics/
1038
+ SOURCE_BUNDLE
1039
+ ENV_FILE
871
1040
  ```
872
1041
 
873
- ---
1042
+ plus normal metadata/build parameters supplied automatically by the CLI.
874
1043
 
875
- ## Common errors
1044
+ > [!IMPORTANT]
1045
+ > If you replace an existing Pipeline Jenkinsfile with this one, run/save the job once if Jenkins needs an initial run to register the new parameter definitions. After that the CLI uses `buildWithParameters` automatically.
876
1046
 
877
- ### `Java is required for Jenkins CLI but was not found`
1047
+ ### Step 3 Jenkins agent paths
878
1048
 
879
- IndraQ CLI cannot run `jenkins-cli.jar` without Java.
1049
+ Default paths in the template:
880
1050
 
881
- Check:
1051
+ ```text
1052
+ ANDROID_HOME=/opt/android-sdk
1053
+ ANDROID_SDK_ROOT=/opt/android-sdk
1054
+ MOBILE_BUILDER_HOME=/opt/mobile-builder
1055
+ ```
1056
+
1057
+ Change the Jenkinsfile if your Jenkins agent uses different paths.
1058
+
1059
+ ### Step 4 — configure the CLI
882
1060
 
883
1061
  ```bash
884
- java -version
1062
+ indraq configure
885
1063
  ```
886
1064
 
887
- If that command fails, install **Java 21 LTS** using the [Install Java 21](#install-java-21) section above. On Windows, the quickest supported path is:
1065
+ Configure the Jenkins connection once:
888
1066
 
889
- ```powershell
890
- winget install EclipseAdoptium.Temurin.21.JDK
1067
+ ```text
1068
+ Jenkins
1069
+ → Production
891
1070
  ```
892
1071
 
893
- After installation, completely close and reopen VS Code / the terminal and run:
1072
+ Enter the Production Jenkins URL, username, and API token. **All mobile Development, Staging, and Production builds use this Production Jenkins connection.**
894
1073
 
895
- ```powershell
896
- java -version
897
- where.exe java
1074
+ Then configure the mobile project:
1075
+
1076
+ ```text
1077
+ Mobile App
1078
+ → Project settings
1079
+ ```
1080
+
1081
+ Set the app name and project type. On Jenkins, create/rename the mobile Pipeline job to exactly:
1082
+
1083
+ ```text
1084
+ Mobile app Cli build
898
1085
  ```
899
1086
 
900
- Only retry `indraq configure` after Java is visible in the new terminal.
1087
+ The CLI checks this exact job on Production Jenkins before every mobile build.
1088
+
1089
+ ### Live logs
1090
+
1091
+ Mobile source upload is triggered through Jenkins HTTP `buildWithParameters`, then IndraQ follows the queue item, discovers the build number, and streams Jenkins **`logText/progressiveHtml`** into VS Code. This is the same progressive console endpoint used by the classic Jenkins browser console, so Jenkins' hidden `ConsoleNote` metadata is rendered/removed before IndraQ converts the remaining HTML to readable terminal text.
901
1092
 
902
- ### `Jenkins authentication failed`
1093
+ If Jenkins fails, the CLI exits with failure, prints a short **Key Jenkins error lines** summary, and prints the direct Jenkins build URL. The complete live output remains above it.
903
1094
 
904
- Check all three values:
1095
+ ---
1096
+
1097
+ ## Configuration and secret storage
1098
+
1099
+ Project-local configuration:
905
1100
 
906
1101
  ```text
907
- Jenkins URL
908
- Jenkins username
909
- Jenkins API token/password
1102
+ <project>/.indraq/
1103
+ ├── jenkins.json # shared — commit
1104
+ ├── docker.json # shared — commit
1105
+ ├── mobile.json # shared — commit
1106
+ ├── jenkins.local.json # machine-local — ignored
1107
+ └── .gitignore
910
1108
  ```
911
1109
 
912
- Prefer creating a fresh Jenkins API token and running:
1110
+ The generated `.indraq/.gitignore` ignores **only machine-local files** such as `jenkins.local.json`. Shared project configuration is intentionally visible to Git.
913
1111
 
914
- ```bash
915
- indraq configure
916
- ```
1112
+ > [!IMPORTANT]
1113
+ > Older IndraQ setups often ignored the whole `.indraq/` directory. v1.5.5 automatically appends safe re-include rules to the project root `.gitignore` so `jenkins.json`, `docker.json`, and `mobile.json` can be committed while `jenkins.local.json` remains ignored. Run `git status` after configuration and commit the three shared JSON files.
917
1114
 
918
- Choose the environment, select **Jenkins connection**, and enter the new credentials.
1115
+ ### `jenkins.json`
919
1116
 
920
- ### `No Jenkins pipeline/job named "my-service" was found`
1117
+ Stores non-secret Jenkins metadata:
921
1118
 
922
- Your configured image name and Jenkins job name do not match.
1119
+ ```text
1120
+ Development Jenkins connection
1121
+ Production Jenkins connection
1122
+ ```
923
1123
 
924
- If configuration says:
1124
+ Usage is fixed and easy to remember:
925
1125
 
926
1126
  ```text
927
- imageName = my-service
1127
+ Docker DEV → Development Jenkins
1128
+ Docker PROD → Production Jenkins
1129
+ Mobile DEV / STAGING / PROD → Production Jenkins
928
1130
  ```
929
1131
 
930
- Jenkins must contain:
1132
+ It stores Jenkins URL/transport only. It does **not** store Jenkins username, token, or password.
1133
+
1134
+ The local `jenkins.local.json` contains only the machine's credential binding ID and is ignored by Git. The actual username + API token/password remain under the user's home directory.
1135
+
1136
+ ### `docker.json`
1137
+
1138
+ Stores:
931
1139
 
932
1140
  ```text
933
- my-service
1141
+ GitHub / GHCR owner
1142
+ Development image + Dockerfile
1143
+ Production image + Dockerfile
934
1144
  ```
935
1145
 
936
- Either rename/create the Jenkins job or run `indraq configure`, choose the environment, and change **Image name** to the correct Jenkins job name.
1146
+ ### `mobile.json`
937
1147
 
938
- ### `Jenkins denied access`
1148
+ Stores:
1149
+
1150
+ ```text
1151
+ stable project ID
1152
+ app name
1153
+ project type
1154
+ Android Version + versionCode
1155
+ auto-increment switches for Version + versionCode
1156
+ Development output/profile
1157
+ Staging output/profile
1158
+ Production output/profile
1159
+ ```
939
1160
 
940
- The user authenticated successfully but does not have enough permission for that job. Ask the Jenkins administrator to check the account's read/build permissions.
1161
+ It does **not** store `.env` values.
941
1162
 
942
- ### `Docker is not installed or is not accessible`
1163
+ ### Jenkins secret location
943
1164
 
944
- Check:
1165
+ Jenkins login credentials live outside the repository and never survive a Git clone:
945
1166
 
946
- ```bash
947
- docker --version
948
- docker info
1167
+ ```text
1168
+ ~/.indraq/
1169
+ └── jenkins/
1170
+ └── <server-account-id>/
1171
+ ├── jenkins-cli.jar
1172
+ └── auth
949
1173
  ```
950
1174
 
951
- Make sure Docker Desktop / Docker Engine is running.
1175
+ Never commit this directory.
952
1176
 
953
- ### GHCR push is denied
1177
+ ---
954
1178
 
955
- Your GitHub credential may not have package write access for the selected owner/organization.
1179
+ ## Upgrade from v1.4 / v1.5
956
1180
 
957
- If you use SSH-only Git authentication, also try:
1181
+ Update the public package:
958
1182
 
959
1183
  ```bash
960
- docker login ghcr.io
1184
+ npm install -g indraq_cli@latest
961
1185
  ```
962
1186
 
963
- ### `indraq` opens the wrong Windows program
1187
+ Verify:
964
1188
 
965
- Run:
1189
+ ```bash
1190
+ indraq --version
1191
+ ```
966
1192
 
967
- ```powershell
968
- where.exe indraq
1193
+ Expected for this release:
1194
+
1195
+ ```text
1196
+ 1.5.3
969
1197
  ```
970
1198
 
971
- If another program appears before npm's launcher, Windows has a command-name collision. Remove/rename the unrelated launcher or correct PATH ordering.
1199
+ v1.5.5 automatically migrates older `.indraq/mobile.json` and Jenkins config layouts. Existing mobile environment/version settings are preserved. Older Jenkins username/server binding fields are split so only non-secret server metadata remains in tracked `jenkins.json`; the current machine binding is written to ignored `jenkins.local.json`.
972
1200
 
973
- ---
1201
+ For projects coming from pre-versioning releases, Android version settings initialize as:
974
1202
 
975
- ## Frequently asked questions
1203
+ ```text
1204
+ Version: 0.1
1205
+ versionCode: 1
1206
+ Auto Version: ON
1207
+ Auto versionCode: ON
1208
+ ```
976
1209
 
977
- ### Do I need the Generic Webhook Trigger plugin now?
1210
+ Because v1.5 did not store the configured app name, open:
978
1211
 
979
- No. The deployment flow no longer depends on a generic webhook URL. IndraQ CLI talks directly to Jenkins using Jenkins CLI.
1212
+ ```text
1213
+ indraq configure
1214
+ → Mobile App
1215
+ → Project settings
1216
+ ```
980
1217
 
981
- ### Do I need to download `jenkins-cli.jar` myself?
1218
+ and confirm the app name once.
982
1219
 
983
- No. The first-time setup or the **Jenkins connection** option inside `indraq configure` downloads the JAR from the Jenkins server you entered.
1220
+ Docker/GHCR and Jenkins configuration remain compatible.
1221
+
1222
+ ---
984
1223
 
985
- ### Do I have to install GitHub CLI (`gh`)?
1224
+ ## Command reference
1225
+
1226
+ | Command | Purpose |
1227
+ |---|---|
1228
+ | `indraq --version` | Show installed CLI version |
1229
+ | `indraq --help` | Show commands |
1230
+ | `indraq doctor` | Diagnose runtime / PATH prerequisites |
1231
+ | `indraq configure` | Open configuration home |
1232
+ | `indraq deploy:dev` | Docker Development deployment |
1233
+ | `indraq deploy:development` | Alias of `deploy:dev` |
1234
+ | `indraq deploy:prod` | Docker Production deployment |
1235
+ | `indraq deploy:production` | Alias of `deploy:prod` |
1236
+ | `indraq build mobile:dev` | Mobile Development build |
1237
+ | `indraq build mobile:development` | Alias of `mobile:dev` |
1238
+ | `indraq build mobile:staging` | Mobile Staging build |
1239
+ | `indraq build mobile:prod` | Mobile Production build |
1240
+ | `indraq build mobile:production` | Alias of `mobile:prod` |
1241
+
1242
+ Mobile flags:
986
1243
 
987
- No. Normal Git/Git Bash authentication is supported. `gh` is optional.
1244
+ ```text
1245
+ --output <dev-client|debug-apk|apk|aab>
1246
+ --profile <fast|clean|full-reset>
1247
+ --verbose
1248
+ --dry-run
1249
+ -y, --yes
1250
+ ```
988
1251
 
989
- ### Can I use a Jenkins password?
1252
+ ---
990
1253
 
991
- The CLI accepts an API token or password, subject to your Jenkins security configuration. An API token is the safer choice and is recommended.
1254
+ ## Troubleshooting
992
1255
 
993
- ### Where can I see Jenkins build logs?
1256
+ ### `Java is required for Jenkins CLI`
994
1257
 
995
- Directly in the same terminal where you ran:
1258
+ Check:
996
1259
 
997
1260
  ```bash
998
- indraq deploy:dev
1261
+ java -version
999
1262
  ```
1000
1263
 
1001
- The deployment command waits for Jenkins and streams its console output.
1264
+ Install Java 21 and reopen VS Code.
1265
+
1266
+ ---
1002
1267
 
1003
- ### What happens if Jenkins fails?
1268
+ ### `tar is required`
1004
1269
 
1005
- The command exits as failed. The Docker image may already be in GHCR because Jenkins is intentionally triggered **after** a successful image push. The Jenkins error remains visible in your terminal for debugging.
1270
+ Check:
1006
1271
 
1007
- ### What if the Jenkins job does not exist?
1272
+ ```bash
1273
+ tar --version
1274
+ ```
1008
1275
 
1009
- The CLI checks before building the Docker image and stops with a clear error.
1276
+ Modern Windows 10/11, macOS, and most Linux distributions already provide `tar`.
1010
1277
 
1011
- ### Why does Jenkins job name have to equal image name?
1278
+ Ubuntu/Debian:
1012
1279
 
1013
- It keeps the first deployment system predictable. A developer can know the expected pipeline name without searching a mapping file or webhook configuration.
1280
+ ```bash
1281
+ sudo apt install -y tar
1282
+ ```
1014
1283
 
1015
- ### Can development and production have different image names?
1284
+ ---
1016
1285
 
1017
- Yes. Image names and Dockerfile paths are environment-specific.
1286
+ ### `You are not in a mobile project root`
1018
1287
 
1019
1288
  Run:
1020
1289
 
1021
1290
  ```bash
1022
- indraq configure
1291
+ ls
1023
1292
  ```
1024
1293
 
1025
- Select Development or Production, then change only the setting you need from the configuration menu. When you are done, choose **Exit configuration**.
1294
+ or on PowerShell:
1026
1295
 
1027
- ### Can both environments use the same Jenkins server?
1296
+ ```powershell
1297
+ Get-ChildItem
1298
+ ```
1028
1299
 
1029
- Yes. Jenkins server configuration is project-level; each environment's image name decides which matching job is triggered.
1300
+ The current directory must contain:
1301
+
1302
+ ```text
1303
+ package.json
1304
+ ```
1030
1305
 
1031
- ### Are Jenkins secrets stored in `deploy.json`?
1306
+ For React Native CLI it must also contain:
1032
1307
 
1033
- No. The project config contains the Jenkins URL, username, server ID, and connection mode. The secret is stored separately in the local IndraQ cache.
1308
+ ```text
1309
+ android/
1310
+ android/gradlew
1311
+ ```
1034
1312
 
1035
1313
  ---
1036
1314
 
1037
- ## Final checklist
1315
+ ### `expo-dev-client is not installed`
1038
1316
 
1039
- Before calling a machine ready for IndraQ deployments, confirm:
1040
-
1041
- - [ ] Node.js 24 is installed.
1042
- - [ ] `indraq --version` works.
1043
- - [ ] Git authentication works.
1044
- - [ ] Docker is installed and running.
1045
- - [ ] Java is installed and `java -version` works.
1046
- - [ ] First-time `indraq configure` completes successfully.
1047
- - [ ] Running `indraq configure` again opens the selective settings menu instead of the full wizard.
1048
- - [ ] Jenkins credentials pass the `who-am-i` check.
1049
- - [ ] The correct GitHub personal account or organization is selected.
1050
- - [ ] Development image name matches its Jenkins job name.
1051
- - [ ] Production image name matches its Jenkins job name.
1052
- - [ ] The project has the expected Dockerfile.
1053
- - [ ] The Jenkins user has read/build permission.
1054
- - [ ] GHCR push permission exists for the selected owner.
1055
- - [ ] `indraq deploy:dev` can build, push, run Jenkins, and show logs.
1056
- - [ ] Production is tested deliberately before relying on it for releases.
1317
+ For Expo Development Client:
1318
+
1319
+ ```bash
1320
+ npx expo install expo-dev-client
1321
+ ```
1322
+
1323
+ Then retry.
1057
1324
 
1058
1325
  ---
1059
1326
 
1060
- ## Future modules
1327
+ ### `.env was not found`
1061
1328
 
1062
- Deployment is only the beginning. The CLI structure is intentionally ready for internal commands such as:
1329
+ Create:
1063
1330
 
1064
1331
  ```text
1065
- indraq db:backup
1066
- indraq db:migrate
1067
- indraq server:health
1068
- indraq server:deploy
1069
- indraq docker:clean
1070
- indraq secrets:check
1071
- indraq diagnostics
1332
+ <project-root>/.env
1072
1333
  ```
1073
1334
 
1074
- These names are examples, not implemented commands yet.
1335
+ Do not paste it into Jenkins.
1075
1336
 
1076
- The principle is:
1337
+ ---
1077
1338
 
1078
- ```text
1079
- One IndraQ CLI
1080
- ├── deployment operations
1081
- ├── infrastructure operations
1082
- ├── database operations
1083
- ├── diagnostics
1084
- ├── security helpers
1085
- └── future engineering automation
1086
- ```
1339
+ ### Jenkins HTTP 400 / file parameter error
1340
+
1341
+ Make sure:
1342
+
1343
+ 1. Jenkins **File Parameter** plugin is installed;
1344
+ 2. the job uses `templates/jenkins/Jenkinsfile-Mobile-App` from v1.5.5;
1345
+ 3. Jenkins has registered the parameters;
1346
+ 4. the Jenkins job is named exactly `Mobile app Cli build`.
1087
1347
 
1088
1348
  ---
1089
1349
 
1090
- <p align="center">
1091
- <img src="docs/assets/indraq-mark.png" alt="IndraQ" width="72" />
1092
- </p>
1350
+ ### Jenkins job not found
1093
1351
 
1094
- <p align="center">
1095
- <strong>Built by IndraQ Innovations for engineering operations.</strong><br/>
1096
- Make repetitive engineering work predictable, visible, and difficult to misuse.
1097
- </p>
1352
+ For mobile, the job name is fixed. In Jenkins, create or rename the Pipeline to exactly:
1098
1353
 
1099
- ---
1354
+ ```text
1355
+ Mobile app Cli build
1356
+ ```
1100
1357
 
1101
- ## Windows command popup / command-name collision
1358
+ Then make sure `indraq configure Jenkins → Production` points at that Jenkins controller and that this computer has valid Jenkins credentials.
1102
1359
 
1103
- If typing `indraq` opens **Choose an app** or produces no CLI output, Windows is resolving another file named `IndraQ` before npm's launcher. This happens before Node or this CLI starts, so application code cannot intercept it.
1360
+ For Docker, the Jenkins job name must match the configured image name.
1361
+
1362
+ ---
1363
+
1364
+ ### `indraq` opens another Windows file/application
1104
1365
 
1105
1366
  Run:
1106
1367
 
1107
1368
  ```powershell
1108
1369
  where.exe indraq
1370
+ indraq doctor
1109
1371
  ```
1110
1372
 
1111
- The npm launcher should be the first result, normally `C:\Users\<you>\AppData\Roaming\npm\indraq.cmd`.
1373
+ The npm launcher should be the first `indraq` result.
1374
+
1375
+ ---
1376
+
1377
+ ### npm shows `EEXIST` for `indraq.ps1`
1378
+
1379
+ This usually means an old `npm link` launcher is still present.
1112
1380
 
1113
- The published npm package is named `indraq_cli`, but the executable it installs is intentionally named `indraq`. Inspect any path listed before npm's `indraq` launcher. Do **not** delete an unfamiliar file blindly. If it is an old IndraQ test file, rename/remove it and open a new terminal. Then `indraq configure` and `indraq deploy:dev` should work normally.
1381
+ Remove the old global development link/package, then reinstall:
1382
+
1383
+ ```powershell
1384
+ npm unlink -g indraq_cli
1385
+ npm uninstall -g indraq_cli
1386
+ npm install -g indraq_cli
1387
+ ```
1114
1388
 
1115
1389
  ---
1116
1390
 
1117
- ## Publishing and npm organization management
1118
1391
 
1119
- This section is for IndraQ CLI maintainers. Normal users do **not** need these commands.
1392
+ ### `./gradlew: cannot execute: required file not found`
1120
1393
 
1121
- ### Package name and terminal command
1394
+ This normally means the mobile source snapshot came from Windows and `android/gradlew` contains CRLF line endings. IndraQ normalizes the wrapper automatically on Jenkins before the build and invokes it through Bash.
1122
1395
 
1123
- The npm package name is:
1396
+ The Jenkins server provides the Android toolchain:
1124
1397
 
1125
1398
  ```text
1126
- indraq_cli
1399
+ Java → Jenkins server
1400
+ ANDROID_HOME → /opt/android-sdk
1401
+ Android NDKs → /opt/android-sdk/ndk/*
1402
+ Shared Gradle cache → $HOME/.gradle (normally /var/jenkins_home/.gradle)
1403
+ Preferred Gradle → exact cached wrapper distribution
1404
+ Server fallback → installed Gradle when it is the same major version
1405
+ Final fallback → project wrapper with 120-second download timeout
1127
1406
  ```
1128
1407
 
1129
- Users install it with:
1408
+ This restores the shared Gradle-cache behavior used by the earlier Git-checkout mobile pipeline. `FULL_RESET` deliberately preserves the server's `$HOME/.gradle` cache.
1409
+
1410
+ ### Gradle wrapper tries to download and times out
1411
+
1412
+ v1.5.5 first checks the Jenkins server's shared wrapper cache. If the requested distribution is already cached, the wrapper uses it without internet access. If there is no exact cached wrapper but Jenkins has a system Gradle from the same major version, IndraQ reuses the server Gradle. Only when neither option exists does the project wrapper attempt a download, with `networkTimeout=120000` applied to the temporary Jenkins copy of `gradle-wrapper.properties`.
1413
+
1414
+ If the Jenkins machine has neither a compatible installed Gradle nor the requested wrapper cached and it has no outbound access to Gradle distributions, install/cache the required Gradle version on that Jenkins machine once.
1415
+
1416
+ ### Jenkins logs contain `ha:////...`, look diagonal, or are unreadable in VS Code
1417
+
1418
+ The `ha:////...` strings are Jenkins `ConsoleNote` annotations embedded in raw `progressiveText`. The Jenkins browser UI renders/hides those annotations. v1.5.5 now consumes Jenkins `logText/progressiveHtml`—the same progressive endpoint used by the classic web console—and converts the rendered output back to plain terminal text.
1419
+
1420
+ The CLI also normalizes line endings and strips terminal control sequences. Upgrade to v1.5.5 or newer if you see raw `ha:////...` payloads or staircase/right-shifted output.
1421
+
1422
+ ---
1423
+
1424
+ ## Frequently asked questions
1425
+
1426
+ ### Do I install IndraQ CLI in every project?
1427
+
1428
+ No. Install globally once per computer:
1130
1429
 
1131
1430
  ```bash
1132
1431
  npm install -g indraq_cli
1133
1432
  ```
1134
1433
 
1135
- The installed terminal command is still:
1434
+ Each project only gets its own `.indraq/` configuration.
1435
+
1436
+ ### Does the mobile build require me to push my latest code to Git first?
1437
+
1438
+ No. The mobile builder snapshots the files currently on disk. Uncommitted changes are included.
1439
+
1440
+ ### Does Jenkins need access to my GitHub repository for mobile builds?
1441
+
1442
+ Not for the v1.5 source-upload pipeline. The CLI sends the source snapshot directly.
1443
+
1444
+ ### Does Docker deployment still use GitHub/GHCR?
1445
+
1446
+ Yes. Docker builds continue to push images to GHCR and then run the configured Jenkins deployment job.
1447
+
1448
+ ### Can Staging and Production have different mobile outputs?
1449
+
1450
+ Yes. Example:
1451
+
1452
+ ```text
1453
+ Staging: Release APK / FAST
1454
+ Production: Release AAB / CLEAN
1455
+ ```
1456
+
1457
+ ### Can I build an APK once without changing my saved Production AAB default?
1458
+
1459
+ Yes:
1136
1460
 
1137
1461
  ```bash
1138
- indraq
1462
+ indraq build mobile:prod --output apk
1139
1463
  ```
1140
1464
 
1141
- The npm package name and the executable name do not have to be identical.
1465
+ The saved default remains unchanged.
1142
1466
 
1143
- ### Before publishing a release
1467
+ ### Does IndraQ save `.env`?
1144
1468
 
1145
- A freshly extracted source archive does not contain `node_modules`. Install the exact development dependencies first so the TypeScript compiler is available:
1469
+ No. It reads the root `.env` at build time and uploads it separately when required.
1146
1470
 
1147
- ```bash
1148
- npm ci
1149
- npm run build
1150
- npm publish --dry-run
1471
+ ### When does Version/versionCode increment?
1472
+
1473
+ After a **successful** Jenkins mobile build. The build uses the currently saved values first, then enabled counters advance for the next build. Failed/cancelled builds do not consume values.
1474
+
1475
+ ### Can I turn auto-increment off?
1476
+
1477
+ Yes:
1478
+
1479
+ ```text
1480
+ indraq configure
1481
+ → Mobile App
1482
+ → Version & versionCode
1151
1483
  ```
1152
1484
 
1153
- If `npm publish --dry-run` reports `tsc is not recognized`, `npm ci` was not run successfully in that source folder.
1485
+ Version and versionCode have separate switches. When either is OFF, the build continues but IndraQ prints a reminder warning.
1154
1486
 
1155
- Then verify the account that will publish:
1487
+ ### What timezone is used in APK/AAB filenames?
1156
1488
 
1157
- ```bash
1158
- npm whoami
1489
+ Always `Asia/Kolkata` (IST), using `YYYY-MM-DD_HHmm`.
1490
+
1491
+ ### Which Jenkins does Mobile use?
1492
+
1493
+ **Production Jenkins only.** This is intentional.
1494
+
1495
+ ```text
1496
+ mobile:dev → Production Jenkins
1497
+ mobile:staging → Production Jenkins
1498
+ mobile:prod → Production Jenkins
1159
1499
  ```
1160
1500
 
1161
- For a real release:
1501
+ The mobile Development/Staging/Production selection controls the app build environment and allowed output. It does not select a Jenkins controller.
1162
1502
 
1163
- ```bash
1164
- npm publish --access public
1503
+ ### Why can Docker use Development and Production Jenkins?
1504
+
1505
+ Docker deployments represent infrastructure environments. `indraq deploy:dev` can deploy through Development Jenkins while `indraq deploy:prod` can use Production Jenkins. Mobile builds are build jobs rather than Docker environment deployments, so they always use the single Production Jenkins path.
1506
+
1507
+ ---
1508
+
1509
+ ## Project architecture
1510
+
1511
+ ```text
1512
+ src/
1513
+ ├── cli/
1514
+ │ ├── create-program.ts
1515
+ │ └── doctor.command.ts
1516
+
1517
+ ├── modules/
1518
+ │ ├── configure/
1519
+ │ │ └── configure.command.ts
1520
+ │ │
1521
+ │ ├── deploy/
1522
+ │ │ ├── commands/
1523
+ │ │ ├── config/
1524
+ │ │ └── services/
1525
+ │ │
1526
+ │ └── mobile/
1527
+ │ ├── commands/
1528
+ │ │ ├── configure-mobile.command.ts
1529
+ │ │ └── build-mobile.command.ts
1530
+ │ ├── config/
1531
+ │ │ └── mobile-config.ts
1532
+ │ └── services/
1533
+ │ ├── project.service.ts
1534
+ │ ├── source-bundle.service.ts
1535
+ │ └── jenkins-mobile.service.ts
1536
+
1537
+ └── shared/
1538
+ ├── config/
1539
+ ├── git/
1540
+ ├── github/
1541
+ ├── jenkins/
1542
+ └── runtime/
1543
+
1544
+ templates/
1545
+ └── jenkins/
1546
+ └── Jenkinsfile-Mobile-App
1165
1547
  ```
1166
1548
 
1167
- Unscoped npm packages such as `indraq_cli` are public.
1549
+ This is intentional. Future modules can be added without dumping unrelated logic into the deployment module.
1168
1550
 
1169
- ### Let the IndraQ npm organization manage the package
1551
+ Possible future commands:
1170
1552
 
1171
- `indraq_cli` stays unscoped so users keep the simple install command `npm install -g indraq_cli`. After the first publish, an npm organization owner/package maintainer can grant an organization team access to this existing package.
1553
+ ```text
1554
+ indraq database ...
1555
+ indraq backup ...
1556
+ indraq server ...
1557
+ indraq secrets ...
1558
+ indraq diagnostics ...
1559
+ ```
1172
1560
 
1173
- In npm's website:
1561
+ ---
1174
1562
 
1175
- 1. Open the **indraq_innovations** organization.
1176
- 2. Open **Teams**.
1177
- 3. Open the team that should maintain the CLI (for example, `developers`).
1178
- 4. Open **Packages**.
1179
- 5. Choose **Add Existing Package**.
1180
- 6. Select `indraq_cli`.
1181
- 7. Give the team **read/write** access if that team should be able to publish future versions.
1563
+ ## Final checklist
1182
1564
 
1183
- This gives the organization team management access without changing the public package name or install command.
1565
+ ### Developer machine
1566
+
1567
+ - [ ] Node.js 22+ installed
1568
+ - [ ] npm installed
1569
+ - [ ] Java available with `java -version`
1570
+ - [ ] Git installed
1571
+ - [ ] `tar` available
1572
+ - [ ] Docker installed if using Docker deployment
1573
+ - [ ] `npm install -g indraq_cli` completed
1574
+ - [ ] `indraq doctor` passes
1575
+
1576
+ ### Docker deployment project
1577
+
1578
+ - [ ] `indraq configure → Jenkins → Development/Production`
1579
+ - [ ] `indraq configure → Docker / GHCR`
1580
+ - [ ] Dockerfile exists
1581
+ - [ ] GitHub/GHCR authentication works
1582
+ - [ ] Jenkins deployment job names match image names
1583
+
1584
+ ### Mobile project
1585
+
1586
+ - [ ] command is run from package.json root
1587
+ - [ ] Production Jenkins connection configured (`indraq configure → Jenkins → Production`)
1588
+ - [ ] Jenkins File Parameter plugin installed
1589
+ - [ ] Jenkins job uses the v1.5.5 mobile Jenkinsfile
1590
+ - [ ] Mobile project type configured
1591
+ - [ ] Jenkins job is named exactly `Mobile app Cli build` and exists on Production Jenkins
1592
+ - [ ] Development / Staging / Production defaults configured as needed
1593
+ - [ ] root `.env` exists for APK/AAB/debug builds
1594
+ - [ ] Expo Development Client has `expo-dev-client`
1595
+ - [ ] `.indraq/mobile.json` is not ignored and is committed so Version/versionCode survive across developers
1184
1596
 
1185
1597
  ---
1186
1598
 
1187
1599
  ## License
1188
1600
 
1189
- IndraQ CLI is released under the [MIT License](LICENSE). You may use, copy, modify, and distribute it under the terms of that license.
1601
+ MIT License. See [`LICENSE`](LICENSE).
1602
+
1603
+ <p align="center">
1604
+ <img src="docs/assets/indraq-mark.png" alt="IndraQ" width="72" />
1605
+ </p>
1606
+
1607
+ <p align="center">
1608
+ <strong>Built and maintained by IndraQ Innovations.</strong>
1609
+ </p>
1610
+
1611
+
1612
+ ### Jenkins mobile upload returns HTTP 403
1613
+
1614
+ IndraQ CLI v1.5.5 preserves the Jenkins web-session cookie together with the CSRF crumb when a Jenkins username/password is used. Jenkins ties crumbs to the session that created them, so both values must travel together. API-token authentication is exempt from the crumb requirement.
1190
1615
 
1191
- > IndraQ CLI is not affiliated with or endorsed by Jenkins, Docker, GitHub, or npm. Those names belong to their respective owners.
1616
+ If a mobile build still returns HTTP 403, v1.5.5 prints Jenkins' own response message. A permission error means the configured Jenkins user needs **Job/Read** and **Job/Build** on the `Mobile app Cli build` job. A CSRF error means the Jenkins controller or reverse proxy is rejecting the crumb/session and the printed Jenkins message should be used for diagnosis.