@invarn/cibuild 2.9.4 → 2.9.7
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.
- package/dist/chunk-35SI42CD.mjs +1 -0
- package/dist/chunk-IC45KVLJ.mjs +1 -0
- package/dist/chunk-XDY4V23V.mjs +1 -0
- package/dist/cli.cjs +14 -14
- package/dist/commands.mjs +1 -0
- package/dist/lib.mjs +3934 -0
- package/package.json +6 -10
- package/dist/src/cli.d.ts +0 -3
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js +0 -399
- package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.d.ts +0 -38
- package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.d.ts.map +0 -1
- package/dist/src/commands/a-credential-target-follows-the-flavor-source-set.test.js +0 -222
- package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.d.ts +0 -41
- package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.d.ts.map +0 -1
- package/dist/src/commands/a-credential-two-workflows-cannot-share-is-declared-per-workflow.test.js +0 -324
- package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.d.ts +0 -2
- package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.d.ts.map +0 -1
- package/dist/src/commands/a-properties-stand-in-declares-the-keys-the-build-reads.test.js +0 -382
- package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.d.ts +0 -29
- package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.d.ts.map +0 -1
- package/dist/src/commands/an-already-stored-value-does-not-answer-the-target-question.test.js +0 -160
- package/dist/src/commands/android-gms-guard.test.d.ts +0 -9
- package/dist/src/commands/android-gms-guard.test.d.ts.map +0 -1
- package/dist/src/commands/android-gms-guard.test.js +0 -78
- package/dist/src/commands/android-java-version.test.d.ts +0 -12
- package/dist/src/commands/android-java-version.test.d.ts.map +0 -1
- package/dist/src/commands/android-java-version.test.js +0 -209
- package/dist/src/commands/android-scanner-java.test.d.ts +0 -2
- package/dist/src/commands/android-scanner-java.test.d.ts.map +0 -1
- package/dist/src/commands/android-scanner-java.test.js +0 -130
- package/dist/src/commands/android-scanner.d.ts +0 -250
- package/dist/src/commands/android-scanner.d.ts.map +0 -1
- package/dist/src/commands/android-scanner.js +0 -1639
- package/dist/src/commands/build.d.ts +0 -215
- package/dist/src/commands/build.d.ts.map +0 -1
- package/dist/src/commands/build.js +0 -1433
- package/dist/src/commands/build.test.d.ts +0 -13
- package/dist/src/commands/build.test.d.ts.map +0 -1
- package/dist/src/commands/build.test.js +0 -121
- package/dist/src/commands/detect-platform.d.ts +0 -13
- package/dist/src/commands/detect-platform.d.ts.map +0 -1
- package/dist/src/commands/detect-platform.js +0 -51
- package/dist/src/commands/detect-project.d.ts +0 -7
- package/dist/src/commands/detect-project.d.ts.map +0 -1
- package/dist/src/commands/detect-project.js +0 -12
- package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.d.ts +0 -26
- package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.d.ts.map +0 -1
- package/dist/src/commands/each-flavor-is-asked-for-its-own-properties-file.test.js +0 -196
- package/dist/src/commands/edit.d.ts +0 -12
- package/dist/src/commands/edit.d.ts.map +0 -1
- package/dist/src/commands/edit.js +0 -652
- package/dist/src/commands/edit.test.d.ts +0 -6
- package/dist/src/commands/edit.test.d.ts.map +0 -1
- package/dist/src/commands/edit.test.js +0 -45
- package/dist/src/commands/fidelity-trim.d.ts +0 -13
- package/dist/src/commands/fidelity-trim.d.ts.map +0 -1
- package/dist/src/commands/fidelity-trim.js +0 -21
- package/dist/src/commands/fidelity-trim.test.d.ts +0 -8
- package/dist/src/commands/fidelity-trim.test.d.ts.map +0 -1
- package/dist/src/commands/fidelity-trim.test.js +0 -79
- package/dist/src/commands/file-secret-collector.d.ts +0 -50
- package/dist/src/commands/file-secret-collector.d.ts.map +0 -1
- package/dist/src/commands/file-secret-collector.js +0 -217
- package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.d.ts +0 -38
- package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.d.ts.map +0 -1
- package/dist/src/commands/flavors-a-convention-plugin-creates-are-still-found.test.js +0 -300
- package/dist/src/commands/github-workflow.d.ts +0 -5
- package/dist/src/commands/github-workflow.d.ts.map +0 -1
- package/dist/src/commands/github-workflow.js +0 -45
- package/dist/src/commands/index.d.ts +0 -33
- package/dist/src/commands/index.d.ts.map +0 -1
- package/dist/src/commands/index.js +0 -33
- package/dist/src/commands/init.d.ts +0 -20
- package/dist/src/commands/init.d.ts.map +0 -1
- package/dist/src/commands/init.js +0 -264
- package/dist/src/commands/ios-scanner.d.ts +0 -104
- package/dist/src/commands/ios-scanner.d.ts.map +0 -1
- package/dist/src/commands/ios-scanner.js +0 -492
- package/dist/src/commands/ios-scheme-ranking.test.d.ts +0 -2
- package/dist/src/commands/ios-scheme-ranking.test.d.ts.map +0 -1
- package/dist/src/commands/ios-scheme-ranking.test.js +0 -264
- package/dist/src/commands/local-properties-reaches-every-workflow.test.d.ts +0 -30
- package/dist/src/commands/local-properties-reaches-every-workflow.test.d.ts.map +0 -1
- package/dist/src/commands/local-properties-reaches-every-workflow.test.js +0 -146
- package/dist/src/commands/reset.d.ts +0 -7
- package/dist/src/commands/reset.d.ts.map +0 -1
- package/dist/src/commands/reset.js +0 -81
- package/dist/src/commands/run.d.ts +0 -22
- package/dist/src/commands/run.d.ts.map +0 -1
- package/dist/src/commands/run.js +0 -141
- package/dist/src/commands/secrets-sync-workflow.d.ts +0 -15
- package/dist/src/commands/secrets-sync-workflow.d.ts.map +0 -1
- package/dist/src/commands/secrets-sync-workflow.js +0 -255
- package/dist/src/commands/secrets-upload.d.ts +0 -21
- package/dist/src/commands/secrets-upload.d.ts.map +0 -1
- package/dist/src/commands/secrets-upload.js +0 -177
- package/dist/src/commands/secrets-upload.test.d.ts +0 -5
- package/dist/src/commands/secrets-upload.test.d.ts.map +0 -1
- package/dist/src/commands/secrets-upload.test.js +0 -60
- package/dist/src/commands/validate.d.ts +0 -10
- package/dist/src/commands/validate.d.ts.map +0 -1
- package/dist/src/commands/validate.js +0 -46
- package/dist/src/config.d.ts +0 -3
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/config.js +0 -47
- package/dist/src/envman/cli.d.ts +0 -21
- package/dist/src/envman/cli.d.ts.map +0 -1
- package/dist/src/envman/cli.js +0 -240
- package/dist/src/envman/envman.d.ts +0 -83
- package/dist/src/envman/envman.d.ts.map +0 -1
- package/dist/src/envman/envman.js +0 -361
- package/dist/src/envman/envman.test.d.ts +0 -5
- package/dist/src/envman/envman.test.d.ts.map +0 -1
- package/dist/src/envman/envman.test.js +0 -236
- package/dist/src/envman/envstore-round-trip.test.d.ts +0 -27
- package/dist/src/envman/envstore-round-trip.test.d.ts.map +0 -1
- package/dist/src/envman/envstore-round-trip.test.js +0 -130
- package/dist/src/envman/index.d.ts +0 -23
- package/dist/src/envman/index.d.ts.map +0 -1
- package/dist/src/envman/index.js +0 -23
- package/dist/src/envman/shim.d.ts +0 -16
- package/dist/src/envman/shim.d.ts.map +0 -1
- package/dist/src/envman/shim.js +0 -66
- package/dist/src/envman/types.d.ts +0 -55
- package/dist/src/envman/types.d.ts.map +0 -1
- package/dist/src/envman/types.js +0 -12
- package/dist/src/lib.d.ts +0 -33
- package/dist/src/lib.d.ts.map +0 -1
- package/dist/src/lib.js +0 -37
- package/dist/src/pipeline.d.ts +0 -3
- package/dist/src/pipeline.d.ts.map +0 -1
- package/dist/src/pipeline.js +0 -57
- package/dist/src/runner-node-step.test.d.ts +0 -12
- package/dist/src/runner-node-step.test.d.ts.map +0 -1
- package/dist/src/runner-node-step.test.js +0 -61
- package/dist/src/runner.d.ts +0 -31
- package/dist/src/runner.d.ts.map +0 -1
- package/dist/src/runner.js +0 -240
- package/dist/src/shared/detect-project.d.ts +0 -57
- package/dist/src/shared/detect-project.d.ts.map +0 -1
- package/dist/src/shared/detect-project.js +0 -219
- package/dist/src/shared/detect-project.test.d.ts +0 -2
- package/dist/src/shared/detect-project.test.d.ts.map +0 -1
- package/dist/src/shared/detect-project.test.js +0 -161
- package/dist/src/shared/git.d.ts +0 -25
- package/dist/src/shared/git.d.ts.map +0 -1
- package/dist/src/shared/git.js +0 -53
- package/dist/src/shared/git.test.d.ts +0 -9
- package/dist/src/shared/git.test.d.ts.map +0 -1
- package/dist/src/shared/git.test.js +0 -66
- package/dist/src/shared/gitignore.d.ts +0 -6
- package/dist/src/shared/gitignore.d.ts.map +0 -1
- package/dist/src/shared/gitignore.js +0 -26
- package/dist/src/shared/gradle-settings.d.ts +0 -49
- package/dist/src/shared/gradle-settings.d.ts.map +0 -1
- package/dist/src/shared/gradle-settings.js +0 -138
- package/dist/src/shared/gradle-settings.test.d.ts +0 -2
- package/dist/src/shared/gradle-settings.test.d.ts.map +0 -1
- package/dist/src/shared/gradle-settings.test.js +0 -65
- package/dist/src/shared/prompts.d.ts +0 -30
- package/dist/src/shared/prompts.d.ts.map +0 -1
- package/dist/src/shared/prompts.js +0 -121
- package/dist/src/shared/xcode-container.test.d.ts +0 -2
- package/dist/src/shared/xcode-container.test.d.ts.map +0 -1
- package/dist/src/shared/xcode-container.test.js +0 -123
- package/dist/src/step-marker.d.ts +0 -12
- package/dist/src/step-marker.d.ts.map +0 -1
- package/dist/src/step-marker.js +0 -29
- package/dist/src/step-marker.test.d.ts +0 -11
- package/dist/src/step-marker.test.d.ts.map +0 -1
- package/dist/src/step-marker.test.js +0 -45
- package/dist/src/types.d.ts +0 -58
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -2
- package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.d.ts +0 -28
- package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.d.ts.map +0 -1
- package/dist/src/yaml/a-cache-path-must-not-swallow-a-credential.test.js +0 -223
- package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.d.ts +0 -20
- package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.d.ts.map +0 -1
- package/dist/src/yaml/a-declared-secret-reaches-the-file-step.test.js +0 -201
- package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.d.ts +0 -37
- package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.d.ts.map +0 -1
- package/dist/src/yaml/a-declared-slot-may-name-the-workflow-it-belongs-to.test.js +0 -255
- package/dist/src/yaml/a-missing-credential-is-loud.test.d.ts +0 -32
- package/dist/src/yaml/a-missing-credential-is-loud.test.d.ts.map +0 -1
- package/dist/src/yaml/a-missing-credential-is-loud.test.js +0 -301
- package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.d.ts +0 -18
- package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.d.ts.map +0 -1
- package/dist/src/yaml/a-runtime-requirement-names-a-real-provider.test.js +0 -66
- package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.d.ts +0 -34
- package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.d.ts.map +0 -1
- package/dist/src/yaml/a-scoped-slot-must-name-a-workflow-the-pipeline-has.test.js +0 -218
- package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.d.ts +0 -27
- package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.d.ts.map +0 -1
- package/dist/src/yaml/a-value-this-instance-stored-is-a-value-it-has.test.js +0 -126
- package/dist/src/yaml/bitrise-compat.d.ts +0 -65
- package/dist/src/yaml/bitrise-compat.d.ts.map +0 -1
- package/dist/src/yaml/bitrise-compat.js +0 -206
- package/dist/src/yaml/bitrise-compat.test.d.ts +0 -5
- package/dist/src/yaml/bitrise-compat.test.d.ts.map +0 -1
- package/dist/src/yaml/bitrise-compat.test.js +0 -347
- package/dist/src/yaml/cache-key-missing-file.test.d.ts +0 -12
- package/dist/src/yaml/cache-key-missing-file.test.d.ts.map +0 -1
- package/dist/src/yaml/cache-key-missing-file.test.js +0 -116
- package/dist/src/yaml/converter.d.ts +0 -103
- package/dist/src/yaml/converter.d.ts.map +0 -1
- package/dist/src/yaml/converter.js +0 -420
- package/dist/src/yaml/converter.test.d.ts +0 -5
- package/dist/src/yaml/converter.test.d.ts.map +0 -1
- package/dist/src/yaml/converter.test.js +0 -548
- package/dist/src/yaml/e2e.test.d.ts +0 -6
- package/dist/src/yaml/e2e.test.d.ts.map +0 -1
- package/dist/src/yaml/e2e.test.js +0 -446
- package/dist/src/yaml/env-resolver.d.ts +0 -218
- package/dist/src/yaml/env-resolver.d.ts.map +0 -1
- package/dist/src/yaml/env-resolver.js +0 -591
- package/dist/src/yaml/env-resolver.test.d.ts +0 -5
- package/dist/src/yaml/env-resolver.test.d.ts.map +0 -1
- package/dist/src/yaml/env-resolver.test.js +0 -502
- package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.d.ts +0 -16
- package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.d.ts.map +0 -1
- package/dist/src/yaml/every-build-log-witnesses-the-commit-on-disk.test.js +0 -126
- package/dist/src/yaml/fidelity-input-digest.d.ts +0 -37
- package/dist/src/yaml/fidelity-input-digest.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-input-digest.js +0 -208
- package/dist/src/yaml/fidelity-input-digest.test.d.ts +0 -2
- package/dist/src/yaml/fidelity-input-digest.test.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-input-digest.test.js +0 -167
- package/dist/src/yaml/fidelity-manifest.d.ts +0 -126
- package/dist/src/yaml/fidelity-manifest.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-manifest.js +0 -134
- package/dist/src/yaml/fidelity-manifest.test.d.ts +0 -12
- package/dist/src/yaml/fidelity-manifest.test.d.ts.map +0 -1
- package/dist/src/yaml/fidelity-manifest.test.js +0 -251
- package/dist/src/yaml/interactive-prompts.d.ts +0 -71
- package/dist/src/yaml/interactive-prompts.d.ts.map +0 -1
- package/dist/src/yaml/interactive-prompts.js +0 -260
- package/dist/src/yaml/meta-helpers.d.ts +0 -28
- package/dist/src/yaml/meta-helpers.d.ts.map +0 -1
- package/dist/src/yaml/meta-helpers.js +0 -46
- package/dist/src/yaml/missing-env-handler.d.ts +0 -45
- package/dist/src/yaml/missing-env-handler.d.ts.map +0 -1
- package/dist/src/yaml/missing-env-handler.js +0 -64
- package/dist/src/yaml/parser.d.ts +0 -33
- package/dist/src/yaml/parser.d.ts.map +0 -1
- package/dist/src/yaml/parser.js +0 -148
- package/dist/src/yaml/parser.test.d.ts +0 -5
- package/dist/src/yaml/parser.test.d.ts.map +0 -1
- package/dist/src/yaml/parser.test.js +0 -83
- package/dist/src/yaml/pipeline-with-secrets.d.ts +0 -25
- package/dist/src/yaml/pipeline-with-secrets.d.ts.map +0 -1
- package/dist/src/yaml/pipeline-with-secrets.js +0 -76
- package/dist/src/yaml/platform-detector.d.ts +0 -83
- package/dist/src/yaml/platform-detector.d.ts.map +0 -1
- package/dist/src/yaml/platform-detector.js +0 -189
- package/dist/src/yaml/platform-detector.test.d.ts +0 -5
- package/dist/src/yaml/platform-detector.test.d.ts.map +0 -1
- package/dist/src/yaml/platform-detector.test.js +0 -525
- package/dist/src/yaml/preflight-validation.d.ts +0 -29
- package/dist/src/yaml/preflight-validation.d.ts.map +0 -1
- package/dist/src/yaml/preflight-validation.js +0 -21
- package/dist/src/yaml/secrets-manager.d.ts +0 -87
- package/dist/src/yaml/secrets-manager.d.ts.map +0 -1
- package/dist/src/yaml/secrets-manager.js +0 -230
- package/dist/src/yaml/shell-assignments.d.ts +0 -40
- package/dist/src/yaml/shell-assignments.d.ts.map +0 -1
- package/dist/src/yaml/shell-assignments.js +0 -77
- package/dist/src/yaml/step-validator-check-failure.test.d.ts +0 -24
- package/dist/src/yaml/step-validator-check-failure.test.d.ts.map +0 -1
- package/dist/src/yaml/step-validator-check-failure.test.js +0 -130
- package/dist/src/yaml/step-validator-self-assigned.test.d.ts +0 -23
- package/dist/src/yaml/step-validator-self-assigned.test.d.ts.map +0 -1
- package/dist/src/yaml/step-validator-self-assigned.test.js +0 -191
- package/dist/src/yaml/step-validator.d.ts +0 -67
- package/dist/src/yaml/step-validator.d.ts.map +0 -1
- package/dist/src/yaml/step-validator.js +0 -466
- package/dist/src/yaml/step-validator.test.d.ts +0 -18
- package/dist/src/yaml/step-validator.test.d.ts.map +0 -1
- package/dist/src/yaml/step-validator.test.js +0 -140
- package/dist/src/yaml/steps/android-sign.d.ts +0 -35
- package/dist/src/yaml/steps/android-sign.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-sign.js +0 -147
- package/dist/src/yaml/steps/android-variant-resolution.test.d.ts +0 -2
- package/dist/src/yaml/steps/android-variant-resolution.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-variant-resolution.test.js +0 -260
- package/dist/src/yaml/steps/android-version.d.ts +0 -26
- package/dist/src/yaml/steps/android-version.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-version.js +0 -128
- package/dist/src/yaml/steps/android-version.test.d.ts +0 -5
- package/dist/src/yaml/steps/android-version.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/android-version.test.js +0 -196
- package/dist/src/yaml/steps/android.d.ts +0 -156
- package/dist/src/yaml/steps/android.d.ts.map +0 -1
- package/dist/src/yaml/steps/android.js +0 -1084
- package/dist/src/yaml/steps/app-store-deploy.d.ts +0 -48
- package/dist/src/yaml/steps/app-store-deploy.d.ts.map +0 -1
- package/dist/src/yaml/steps/app-store-deploy.js +0 -167
- package/dist/src/yaml/steps/base.d.ts +0 -263
- package/dist/src/yaml/steps/base.d.ts.map +0 -1
- package/dist/src/yaml/steps/base.js +0 -380
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts +0 -26
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-android-tools.js +0 -200
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-android-tools.test.js +0 -280
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts +0 -22
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-apk-info.js +0 -144
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-apk-info.test.js +0 -331
- package/dist/src/yaml/steps/bitrise-slack.d.ts +0 -49
- package/dist/src/yaml/steps/bitrise-slack.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-slack.js +0 -280
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-slack.test.js +0 -484
- package/dist/src/yaml/steps/bitrise-ssh.d.ts +0 -27
- package/dist/src/yaml/steps/bitrise-ssh.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-ssh.js +0 -134
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts +0 -5
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/bitrise-ssh.test.js +0 -205
- package/dist/src/yaml/steps/cache-pull-daemon.test.d.ts +0 -27
- package/dist/src/yaml/steps/cache-pull-daemon.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache-pull-daemon.test.js +0 -212
- package/dist/src/yaml/steps/cache-pull-restore-roots.test.d.ts +0 -42
- package/dist/src/yaml/steps/cache-pull-restore-roots.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache-pull-restore-roots.test.js +0 -209
- package/dist/src/yaml/steps/cache-push-daemon.test.d.ts +0 -27
- package/dist/src/yaml/steps/cache-push-daemon.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache-push-daemon.test.js +0 -171
- package/dist/src/yaml/steps/cache.d.ts +0 -59
- package/dist/src/yaml/steps/cache.d.ts.map +0 -1
- package/dist/src/yaml/steps/cache.js +0 -1027
- package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts +0 -42
- package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-deployment-floor.js +0 -140
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts +0 -11
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.js +0 -176
- package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.d.ts +0 -22
- package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-install-emits-valid-bash.test.js +0 -97
- package/dist/src/yaml/steps/cocoapods-locked-bundler.test.d.ts +0 -17
- package/dist/src/yaml/steps/cocoapods-locked-bundler.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-locked-bundler.test.js +0 -282
- package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.d.ts +0 -17
- package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/cocoapods-skip-if-absent.test.js +0 -132
- package/dist/src/yaml/steps/envstore-loader.test.d.ts +0 -15
- package/dist/src/yaml/steps/envstore-loader.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/envstore-loader.test.js +0 -143
- package/dist/src/yaml/steps/fastlane.d.ts +0 -27
- package/dist/src/yaml/steps/fastlane.d.ts.map +0 -1
- package/dist/src/yaml/steps/fastlane.js +0 -79
- package/dist/src/yaml/steps/fidelity-aspect-guard.d.ts +0 -53
- package/dist/src/yaml/steps/fidelity-aspect-guard.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-aspect-guard.js +0 -72
- package/dist/src/yaml/steps/fidelity-aspect-guard.test.d.ts +0 -11
- package/dist/src/yaml/steps/fidelity-aspect-guard.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-aspect-guard.test.js +0 -50
- package/dist/src/yaml/steps/fidelity-reference-provenance.d.ts +0 -87
- package/dist/src/yaml/steps/fidelity-reference-provenance.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-reference-provenance.js +0 -111
- package/dist/src/yaml/steps/fidelity-reference-provenance.test.d.ts +0 -22
- package/dist/src/yaml/steps/fidelity-reference-provenance.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/fidelity-reference-provenance.test.js +0 -118
- package/dist/src/yaml/steps/file.d.ts +0 -52
- package/dist/src/yaml/steps/file.d.ts.map +0 -1
- package/dist/src/yaml/steps/file.js +0 -108
- package/dist/src/yaml/steps/flutter.d.ts +0 -63
- package/dist/src/yaml/steps/flutter.d.ts.map +0 -1
- package/dist/src/yaml/steps/flutter.js +0 -215
- package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.d.ts +0 -16
- package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-clone-names-the-inputs-it-ignores.test.js +0 -127
- package/dist/src/yaml/steps/git-clone.d.ts +0 -32
- package/dist/src/yaml/steps/git-clone.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-clone.js +0 -171
- package/dist/src/yaml/steps/git-fetch-retry-exec.test.d.ts +0 -10
- package/dist/src/yaml/steps/git-fetch-retry-exec.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-fetch-retry-exec.test.js +0 -162
- package/dist/src/yaml/steps/git-fetch-retry.d.ts +0 -62
- package/dist/src/yaml/steps/git-fetch-retry.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-fetch-retry.js +0 -155
- package/dist/src/yaml/steps/git-fetch-retry.test.d.ts +0 -5
- package/dist/src/yaml/steps/git-fetch-retry.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/git-fetch-retry.test.js +0 -86
- package/dist/src/yaml/steps/google-play-deploy.d.ts +0 -37
- package/dist/src/yaml/steps/google-play-deploy.d.ts.map +0 -1
- package/dist/src/yaml/steps/google-play-deploy.js +0 -193
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts +0 -5
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/google-play-deploy.test.js +0 -310
- package/dist/src/yaml/steps/gradle-memory.d.ts +0 -61
- package/dist/src/yaml/steps/gradle-memory.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-memory.js +0 -311
- package/dist/src/yaml/steps/gradle-memory.test.d.ts +0 -2
- package/dist/src/yaml/steps/gradle-memory.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-memory.test.js +0 -297
- package/dist/src/yaml/steps/gradle-sdk-cmake.d.ts +0 -28
- package/dist/src/yaml/steps/gradle-sdk-cmake.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-sdk-cmake.js +0 -107
- package/dist/src/yaml/steps/gradle-sdk-cmake.test.d.ts +0 -2
- package/dist/src/yaml/steps/gradle-sdk-cmake.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/gradle-sdk-cmake.test.js +0 -183
- package/dist/src/yaml/steps/index.d.ts +0 -10
- package/dist/src/yaml/steps/index.d.ts.map +0 -1
- package/dist/src/yaml/steps/index.js +0 -1461
- package/dist/src/yaml/steps/ios-deps.d.ts +0 -78
- package/dist/src/yaml/steps/ios-deps.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-deps.js +0 -279
- package/dist/src/yaml/steps/ios-deps.test.d.ts +0 -5
- package/dist/src/yaml/steps/ios-deps.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-deps.test.js +0 -90
- package/dist/src/yaml/steps/ios-signing.d.ts +0 -31
- package/dist/src/yaml/steps/ios-signing.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-signing.js +0 -144
- package/dist/src/yaml/steps/ios-version.d.ts +0 -47
- package/dist/src/yaml/steps/ios-version.d.ts.map +0 -1
- package/dist/src/yaml/steps/ios-version.js +0 -151
- package/dist/src/yaml/steps/java-home-version-spec.test.d.ts +0 -10
- package/dist/src/yaml/steps/java-home-version-spec.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/java-home-version-spec.test.js +0 -58
- package/dist/src/yaml/steps/linting.d.ts +0 -47
- package/dist/src/yaml/steps/linting.d.ts.map +0 -1
- package/dist/src/yaml/steps/linting.js +0 -148
- package/dist/src/yaml/steps/phase2.test.d.ts +0 -6
- package/dist/src/yaml/steps/phase2.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase2.test.js +0 -197
- package/dist/src/yaml/steps/phase3.test.d.ts +0 -5
- package/dist/src/yaml/steps/phase3.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase3.test.js +0 -144
- package/dist/src/yaml/steps/phase4.test.d.ts +0 -5
- package/dist/src/yaml/steps/phase4.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase4.test.js +0 -166
- package/dist/src/yaml/steps/phase5.test.d.ts +0 -6
- package/dist/src/yaml/steps/phase5.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/phase5.test.js +0 -263
- package/dist/src/yaml/steps/registry.d.ts +0 -88
- package/dist/src/yaml/steps/registry.d.ts.map +0 -1
- package/dist/src/yaml/steps/registry.js +0 -125
- package/dist/src/yaml/steps/registry.test.d.ts +0 -5
- package/dist/src/yaml/steps/registry.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/registry.test.js +0 -235
- package/dist/src/yaml/steps/release.d.ts +0 -50
- package/dist/src/yaml/steps/release.d.ts.map +0 -1
- package/dist/src/yaml/steps/release.js +0 -154
- package/dist/src/yaml/steps/render-post-processor.d.ts +0 -100
- package/dist/src/yaml/steps/render-post-processor.d.ts.map +0 -1
- package/dist/src/yaml/steps/render-post-processor.js +0 -270
- package/dist/src/yaml/steps/render-post-processor.test.d.ts +0 -13
- package/dist/src/yaml/steps/render-post-processor.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/render-post-processor.test.js +0 -220
- package/dist/src/yaml/steps/script.d.ts +0 -23
- package/dist/src/yaml/steps/script.d.ts.map +0 -1
- package/dist/src/yaml/steps/script.js +0 -63
- package/dist/src/yaml/steps/spec-validation.test.d.ts +0 -6
- package/dist/src/yaml/steps/spec-validation.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/spec-validation.test.js +0 -130
- package/dist/src/yaml/steps/steps.test.d.ts +0 -6
- package/dist/src/yaml/steps/steps.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/steps.test.js +0 -881
- package/dist/src/yaml/steps/structural-facts.d.ts +0 -992
- package/dist/src/yaml/steps/structural-facts.d.ts.map +0 -1
- package/dist/src/yaml/steps/structural-facts.js +0 -3276
- package/dist/src/yaml/steps/structural-facts.test.d.ts +0 -12
- package/dist/src/yaml/steps/structural-facts.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/structural-facts.test.js +0 -3039
- package/dist/src/yaml/steps/test-config.d.ts +0 -5
- package/dist/src/yaml/steps/test-config.d.ts.map +0 -1
- package/dist/src/yaml/steps/test-config.js +0 -25
- package/dist/src/yaml/steps/trim-align-corpus.test.d.ts +0 -28
- package/dist/src/yaml/steps/trim-align-corpus.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/trim-align-corpus.test.js +0 -383
- package/dist/src/yaml/steps/trim-align.d.ts +0 -87
- package/dist/src/yaml/steps/trim-align.d.ts.map +0 -1
- package/dist/src/yaml/steps/trim-align.js +0 -367
- package/dist/src/yaml/steps/trim-align.test.d.ts +0 -11
- package/dist/src/yaml/steps/trim-align.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/trim-align.test.js +0 -261
- package/dist/src/yaml/steps/ui-fidelity-preview-android.d.ts +0 -66
- package/dist/src/yaml/steps/ui-fidelity-preview-android.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview-android.js +0 -251
- package/dist/src/yaml/steps/ui-fidelity-preview-android.test.d.ts +0 -13
- package/dist/src/yaml/steps/ui-fidelity-preview-android.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview-android.test.js +0 -302
- package/dist/src/yaml/steps/ui-fidelity-preview.d.ts +0 -134
- package/dist/src/yaml/steps/ui-fidelity-preview.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview.js +0 -173
- package/dist/src/yaml/steps/ui-fidelity-preview.test.d.ts +0 -11
- package/dist/src/yaml/steps/ui-fidelity-preview.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-preview.test.js +0 -210
- package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts +0 -155
- package/dist/src/yaml/steps/ui-fidelity-render-android.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render-android.js +0 -1389
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.d.ts +0 -2
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render-android.test.js +0 -1106
- package/dist/src/yaml/steps/ui-fidelity-render.d.ts +0 -230
- package/dist/src/yaml/steps/ui-fidelity-render.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render.js +0 -1597
- package/dist/src/yaml/steps/ui-fidelity-render.test.d.ts +0 -18
- package/dist/src/yaml/steps/ui-fidelity-render.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/ui-fidelity-render.test.js +0 -1871
- package/dist/src/yaml/steps/xcode-app-product.d.ts +0 -90
- package/dist/src/yaml/steps/xcode-app-product.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-app-product.js +0 -247
- package/dist/src/yaml/steps/xcode-app-product.test.d.ts +0 -2
- package/dist/src/yaml/steps/xcode-app-product.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-app-product.test.js +0 -202
- package/dist/src/yaml/steps/xcode-derived-data.test.d.ts +0 -30
- package/dist/src/yaml/steps/xcode-derived-data.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-derived-data.test.js +0 -253
- package/dist/src/yaml/steps/xcode-destination.d.ts +0 -47
- package/dist/src/yaml/steps/xcode-destination.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-destination.js +0 -202
- package/dist/src/yaml/steps/xcode-destination.test.d.ts +0 -9
- package/dist/src/yaml/steps/xcode-destination.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-destination.test.js +0 -227
- package/dist/src/yaml/steps/xcode-new.test.d.ts +0 -5
- package/dist/src/yaml/steps/xcode-new.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-new.test.js +0 -211
- package/dist/src/yaml/steps/xcode-resolve-retry.test.d.ts +0 -9
- package/dist/src/yaml/steps/xcode-resolve-retry.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-resolve-retry.test.js +0 -146
- package/dist/src/yaml/steps/xcode-simulator-archs.d.ts +0 -53
- package/dist/src/yaml/steps/xcode-simulator-archs.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-simulator-archs.js +0 -98
- package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts +0 -21
- package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode-simulator-archs.test.js +0 -155
- package/dist/src/yaml/steps/xcode.d.ts +0 -230
- package/dist/src/yaml/steps/xcode.d.ts.map +0 -1
- package/dist/src/yaml/steps/xcode.js +0 -1340
- package/dist/src/yaml/types.d.ts +0 -76
- package/dist/src/yaml/types.d.ts.map +0 -1
- package/dist/src/yaml/types.js +0 -5
- package/dist/src/yaml/validation-types.d.ts +0 -102
- package/dist/src/yaml/validation-types.d.ts.map +0 -1
- package/dist/src/yaml/validation-types.js +0 -8
- package/dist/src/yaml/yaml-updater.d.ts +0 -24
- package/dist/src/yaml/yaml-updater.d.ts.map +0 -1
- package/dist/src/yaml/yaml-updater.js +0 -128
|
@@ -1,591 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Environment variable resolution and interpolation
|
|
3
|
-
* Merges global and workflow-level environment variables
|
|
4
|
-
* Supports variable interpolation in multiple formats
|
|
5
|
-
*/
|
|
6
|
-
import * as crypto from 'crypto';
|
|
7
|
-
import * as fs from 'fs';
|
|
8
|
-
import * as path from 'path';
|
|
9
|
-
import { execSync } from 'child_process';
|
|
10
|
-
import { SecretsManager } from './secrets-manager.js';
|
|
11
|
-
import { decodeSecretName } from '../commands/secrets-upload.js';
|
|
12
|
-
import { shellAssignedNamesIn } from './shell-assignments.js';
|
|
13
|
-
/**
|
|
14
|
-
* Hints for common variables that require user configuration
|
|
15
|
-
*/
|
|
16
|
-
const CIBUILD_VARIABLE_HINTS = {
|
|
17
|
-
CIBUILD_PUBLIC_INSTALL_PAGE_URL: 'Public URL where users can download/install the built app.\n\n' +
|
|
18
|
-
'Purpose:\n' +
|
|
19
|
-
' • Used in Slack notifications and other build artifacts\n' +
|
|
20
|
-
' • Provides a download link for QA, stakeholders, or beta testers\n' +
|
|
21
|
-
' • Commonly points to artifact hosting (Firebase App Distribution, TestFlight, etc.)\n\n' +
|
|
22
|
-
'Expected format:\n' +
|
|
23
|
-
' ┌────────────────────────────────────────────────────────┐\n' +
|
|
24
|
-
' │ https://example.com/downloads/myapp-v1.0.0.apk │\n' +
|
|
25
|
-
' │ https://appdistribution.firebase.dev/i/abc123 │\n' +
|
|
26
|
-
' │ https://testflight.apple.com/join/xyz456 │\n' +
|
|
27
|
-
' └────────────────────────────────────────────────────────┘\n\n' +
|
|
28
|
-
'How to set:\n' +
|
|
29
|
-
' • Add to your YAML under app.envs or workflows.[name].envs:\n' +
|
|
30
|
-
' envs:\n' +
|
|
31
|
-
' - CIBUILD_PUBLIC_INSTALL_PAGE_URL: "https://your-url-here"\n' +
|
|
32
|
-
' • Or set dynamically in a previous step that uploads the build\n' +
|
|
33
|
-
' • Or leave it as a placeholder if not using artifact distribution',
|
|
34
|
-
CIBUILD_PUBLIC_INSTALL_PAGE_QR_CODE_IMAGE_URL: 'URL to a QR code image for easy mobile download/install.\n\n' +
|
|
35
|
-
'Purpose:\n' +
|
|
36
|
-
' • Used in Slack notifications for quick mobile access\n' +
|
|
37
|
-
' • QR code typically points to CIBUILD_PUBLIC_INSTALL_PAGE_URL\n\n' +
|
|
38
|
-
'Expected format:\n' +
|
|
39
|
-
' ┌────────────────────────────────────────────────────────┐\n' +
|
|
40
|
-
' │ https://example.com/qr-codes/myapp-v1.0.0.png │\n' +
|
|
41
|
-
' │ https://api.qrserver.com/v1/create-qr-code/?data=... │\n' +
|
|
42
|
-
' └────────────────────────────────────────────────────────┘\n\n' +
|
|
43
|
-
'How to set:\n' +
|
|
44
|
-
' • Add to your YAML under app.envs or workflows.[name].envs\n' +
|
|
45
|
-
' • Or generate dynamically in a previous step\n' +
|
|
46
|
-
' • Or use a QR code generation service with the install URL',
|
|
47
|
-
CIBUILD_PULL_REQUEST: 'Pull request number or ID for PR builds.\n\n' +
|
|
48
|
-
'Expected format:\n' +
|
|
49
|
-
' ┌────────────────────────────────────────────────────────┐\n' +
|
|
50
|
-
' │ 123 │\n' +
|
|
51
|
-
' │ pr-456 │\n' +
|
|
52
|
-
' └────────────────────────────────────────────────────────┘\n\n' +
|
|
53
|
-
'How to set:\n' +
|
|
54
|
-
' • Typically provided by CI system for PR builds\n' +
|
|
55
|
-
' • Or set manually: export CIBUILD_PULL_REQUEST="123"',
|
|
56
|
-
CIBUILD_GIT_TAG: 'Git tag name for tag-triggered builds.\n\n' +
|
|
57
|
-
'Expected format:\n' +
|
|
58
|
-
' ┌────────────────────────────────────────────────────────┐\n' +
|
|
59
|
-
' │ v1.0.0 │\n' +
|
|
60
|
-
' │ release-2024-01-15 │\n' +
|
|
61
|
-
' └────────────────────────────────────────────────────────┘\n\n' +
|
|
62
|
-
'How to set:\n' +
|
|
63
|
-
' • Typically provided by CI system for tag builds\n' +
|
|
64
|
-
' • Or set manually: export CIBUILD_GIT_TAG="v1.0.0"',
|
|
65
|
-
};
|
|
66
|
-
export class MissingEnvironmentVariableError extends Error {
|
|
67
|
-
variableName;
|
|
68
|
-
stepName;
|
|
69
|
-
hint;
|
|
70
|
-
constructor(variableName, stepName, hint) {
|
|
71
|
-
const stepInfo = stepName ? ` required by step: '${stepName}'` : '';
|
|
72
|
-
const hintInfo = hint ? `\n\n${hint}` : '';
|
|
73
|
-
super(`Missing environment variable: '${variableName}'${stepInfo}\n` +
|
|
74
|
-
`Check your YAML file's 'app.envs' or 'workflows.[name].envs' sections.${hintInfo}`);
|
|
75
|
-
this.variableName = variableName;
|
|
76
|
-
this.stepName = stepName;
|
|
77
|
-
this.hint = hint;
|
|
78
|
-
this.name = 'MissingEnvironmentVariableError';
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* A `{{checksum "path"}}` naming a file this checkout does not have.
|
|
83
|
-
*
|
|
84
|
-
* Distinct from a generic read failure because a caller can reasonably
|
|
85
|
-
* decide it does not matter. A cache key is the usual case: the file is
|
|
86
|
-
* absent, so there is nothing to key a cache on, so there is no cache — which
|
|
87
|
-
* is a slower build, not a broken one.
|
|
88
|
-
*/
|
|
89
|
-
export class ChecksumFileMissingError extends Error {
|
|
90
|
-
filePath;
|
|
91
|
-
stepName;
|
|
92
|
-
constructor(filePath, stepName) {
|
|
93
|
-
super(`Failed to compute checksum for "${filePath}": File not found: ${filePath}`);
|
|
94
|
-
this.filePath = filePath;
|
|
95
|
-
this.stepName = stepName;
|
|
96
|
-
this.name = 'ChecksumFileMissingError';
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* A credential slot scoped to a workflow the pipeline does not have.
|
|
101
|
-
*
|
|
102
|
-
* Thrown at generation time, before any step converts, because every way of
|
|
103
|
-
* getting the name wrong is otherwise silent. A slot naming a workflow nobody
|
|
104
|
-
* runs declares the credential for nobody: `file@1.0.0` finds no key in its
|
|
105
|
-
* map, calls the credential optional and skips it with a warning, and
|
|
106
|
-
* `ci secrets upload` cheerfully pushes a value under the same wrong name.
|
|
107
|
-
* Two green halves and a build that dies later inside the project's own build
|
|
108
|
-
* tool.
|
|
109
|
-
*
|
|
110
|
-
* The underscore case gets its own sentence because the workflow is right
|
|
111
|
-
* there in the pipeline. `encodeSecretName` upper-cases the workflow and turns
|
|
112
|
-
* dashes into underscores, so decoding turns every underscore back into a
|
|
113
|
-
* dash: a workflow genuinely called `my_wf` can only ever be addressed as
|
|
114
|
-
* `my-wf`, and "no such workflow" about a workflow that plainly exists reads
|
|
115
|
-
* as a defect in us rather than a name that cannot survive the round trip.
|
|
116
|
-
*/
|
|
117
|
-
export class UnknownWorkflowSlotError extends Error {
|
|
118
|
-
slot;
|
|
119
|
-
varName;
|
|
120
|
-
workflow;
|
|
121
|
-
constructor(slot, varName, workflow, declared) {
|
|
122
|
-
// A workflow the pipeline has that differs only in its underscores is the
|
|
123
|
-
// reason the round trip failed, and naming it is the whole fix.
|
|
124
|
-
const collapsed = declared.find((name) => name.replace(/_/g, '-') === workflow);
|
|
125
|
-
const because = collapsed
|
|
126
|
-
? `This pipeline has a workflow called "${collapsed}". The name a slot ` +
|
|
127
|
-
`carries cannot hold an underscore: it is upper-cased and its dashes ` +
|
|
128
|
-
`become underscores, so decoding turns every underscore back into a ` +
|
|
129
|
-
`dash and "${collapsed}" can only be addressed as "${workflow}".\n` +
|
|
130
|
-
`\n` +
|
|
131
|
-
`Rename the workflow to "${workflow}", or give ${varName} one value ` +
|
|
132
|
-
`for every workflow by declaring it as "${varName}".`
|
|
133
|
-
: `This pipeline declares: ${declared.join(', ')}.\n` +
|
|
134
|
-
`\n` +
|
|
135
|
-
`Fix the workflow name in the slot, or give ${varName} one value for ` +
|
|
136
|
-
`every workflow by declaring it as "${varName}".`;
|
|
137
|
-
super(`${slot} is declared for a workflow this pipeline does not have.\n` +
|
|
138
|
-
`\n` +
|
|
139
|
-
`The slot asks for ${varName}, for a workflow called "${workflow}". ` +
|
|
140
|
-
`Nothing runs under that name, so nothing would ever read the value: ` +
|
|
141
|
-
`the step that writes ${varName} would find no value and skip, and the ` +
|
|
142
|
-
`build would fail later for a reason that names your project.\n` +
|
|
143
|
-
`\n` +
|
|
144
|
-
`${because}`);
|
|
145
|
-
this.name = 'UnknownWorkflowSlotError';
|
|
146
|
-
this.slot = slot;
|
|
147
|
-
this.varName = varName;
|
|
148
|
-
this.workflow = workflow;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* EnvResolver handles environment variable merging and interpolation
|
|
153
|
-
*/
|
|
154
|
-
export class EnvResolver {
|
|
155
|
-
envVars;
|
|
156
|
-
referencedVars = new Set();
|
|
157
|
-
secretsManager;
|
|
158
|
-
/**
|
|
159
|
-
* Every key the pipeline names in `app.envs` or `workflow.envs`, whether or
|
|
160
|
-
* not it gave one a value. Read by `importDeclaredFromProcessEnv`.
|
|
161
|
-
*/
|
|
162
|
-
declaredVars = new Set();
|
|
163
|
-
/** The workflow being resolved. Decides which scoped slots apply — `slotKeyFor`. */
|
|
164
|
-
workflowName;
|
|
165
|
-
/** Every workflow this pipeline declares. A scoped slot has to name one of them. */
|
|
166
|
-
declaredWorkflows;
|
|
167
|
-
constructor(pipeline, workflow, workflowName, platform, stack, yamlFilePath) {
|
|
168
|
-
this.envVars = new Map();
|
|
169
|
-
this.secretsManager = new SecretsManager();
|
|
170
|
-
this.workflowName = workflowName;
|
|
171
|
-
this.declaredWorkflows = Object.keys(pipeline.workflows ?? {});
|
|
172
|
-
// Step 1: Add built-in environment variables (auto-detected defaults)
|
|
173
|
-
this.addBuiltInVars(workflowName, platform, stack, yamlFilePath);
|
|
174
|
-
// Step 2: Load secrets — overrides auto-detected built-ins with user-stored values
|
|
175
|
-
// Workflow-specific secrets take precedence over global secrets
|
|
176
|
-
const allSecrets = this.secretsManager.getAll(workflowName);
|
|
177
|
-
for (const [key, value] of Object.entries(allSecrets)) {
|
|
178
|
-
this.envVars.set(key, value);
|
|
179
|
-
}
|
|
180
|
-
// Step 3: Add global environment variables (app.envs) — overrides secrets,
|
|
181
|
-
// except with an empty placeholder: `mergeEnvVars` refuses to write `""`
|
|
182
|
-
// over a value that is already there, so `- KEYSTORE_BASE64: ""` declares
|
|
183
|
-
// the key without erasing a loaded secret of the same name.
|
|
184
|
-
if (pipeline.app?.envs) {
|
|
185
|
-
this.mergeEnvVars(pipeline.app.envs);
|
|
186
|
-
}
|
|
187
|
-
// Step 4: Add workflow-level environment variables — highest priority over
|
|
188
|
-
// steps 1-3, with the same empty-placeholder exception as step 3
|
|
189
|
-
if (workflow.envs) {
|
|
190
|
-
this.mergeEnvVars(workflow.envs);
|
|
191
|
-
}
|
|
192
|
-
// Step 5: Last resort for a declared key that is still empty — the
|
|
193
|
-
// process environment. See importDeclaredFromProcessEnv.
|
|
194
|
-
this.importDeclaredFromProcessEnv();
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Gets the value of an environment variable
|
|
198
|
-
* @param name Variable name
|
|
199
|
-
* @returns Variable value or undefined if not found
|
|
200
|
-
*/
|
|
201
|
-
get(name) {
|
|
202
|
-
this.referencedVars.add(name);
|
|
203
|
-
return this.envVars.get(name);
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Checks if an environment variable is defined
|
|
207
|
-
* @param name Variable name
|
|
208
|
-
* @returns True if variable exists
|
|
209
|
-
*/
|
|
210
|
-
has(name) {
|
|
211
|
-
return this.envVars.has(name);
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Registers a variable as a step output passthrough.
|
|
215
|
-
* When this variable appears in a later step's inputs it will be kept as
|
|
216
|
-
* the literal shell reference "$NAME" so the shell resolves it at runtime.
|
|
217
|
-
*/
|
|
218
|
-
registerStepOutput(name) {
|
|
219
|
-
if (!this.envVars.has(name)) {
|
|
220
|
-
this.envVars.set(name, `$${name}`);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Gets all environment variables as a plain object
|
|
225
|
-
* @returns Object with all environment variables
|
|
226
|
-
*/
|
|
227
|
-
getAll() {
|
|
228
|
-
const result = {};
|
|
229
|
-
for (const [key, value] of this.envVars.entries()) {
|
|
230
|
-
result[key] = value;
|
|
231
|
-
}
|
|
232
|
-
return result;
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Interpolates environment variables in a string
|
|
236
|
-
* Supports four formats:
|
|
237
|
-
* - $VAR
|
|
238
|
-
* - ${VAR}
|
|
239
|
-
* - {{getenv "VAR"}}
|
|
240
|
-
* - {{checksum "path/to/file"}}
|
|
241
|
-
*
|
|
242
|
-
* @param str String to interpolate
|
|
243
|
-
* @param stepName Optional step name for error messages
|
|
244
|
-
* @returns Interpolated string
|
|
245
|
-
* @throws MissingEnvironmentVariableError if referenced variable not found
|
|
246
|
-
*/
|
|
247
|
-
interpolate(str, stepName) {
|
|
248
|
-
let result = str;
|
|
249
|
-
// A name this very string assigns is the shell's own, and substituting it
|
|
250
|
-
// is worse than demanding it: `IOS_DIR=$(dirname "$IOS_PROJECT_PATH")`
|
|
251
|
-
// followed by `"$IOS_DIR"` would get a pipeline value pasted in instead of
|
|
252
|
-
// the one `dirname` had just computed, so a defined variable would corrupt
|
|
253
|
-
// the script and an undefined one would refuse the build. Left for the
|
|
254
|
-
// shell, which is the only thing that can evaluate it. Only the assignment
|
|
255
|
-
// target is spared — the right-hand side is still resolved here.
|
|
256
|
-
const selfAssigned = shellAssignedNamesIn(str);
|
|
257
|
-
// Format 1: {{checksum "file"}}
|
|
258
|
-
result = result.replace(/\{\{checksum "([^"]+)"\}\}/g, (match, filePath) => {
|
|
259
|
-
return this.computeChecksum(filePath, stepName);
|
|
260
|
-
});
|
|
261
|
-
// Format 2: {{getenv "VAR"}} — an explicit request, so it is honoured even
|
|
262
|
-
// where the snippet also assigns that name. Asking by name is not the same
|
|
263
|
-
// as a bare `$VAR` the shell was always going to expand itself.
|
|
264
|
-
result = result.replace(/\{\{getenv "([^"]+)"\}\}/g, (match, varName) => {
|
|
265
|
-
return this.resolveVar(varName, stepName);
|
|
266
|
-
});
|
|
267
|
-
// Format 3: ${VAR}
|
|
268
|
-
result = result.replace(/\$\{([A-Z_][A-Z0-9_]*)\}/g, (match, varName) => {
|
|
269
|
-
return selfAssigned.has(varName) ? match : this.resolveVar(varName, stepName);
|
|
270
|
-
});
|
|
271
|
-
// Format 4: $VAR (must not be followed by alphanumeric or underscore)
|
|
272
|
-
result = result.replace(/\$([A-Z_][A-Z0-9_]*)(?![A-Z0-9_])/g, (match, varName) => {
|
|
273
|
-
return selfAssigned.has(varName) ? match : this.resolveVar(varName, stepName);
|
|
274
|
-
});
|
|
275
|
-
return result;
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Interpolates environment variables in an object recursively
|
|
279
|
-
* @param obj Object to interpolate
|
|
280
|
-
* @param stepName Optional step name for error messages
|
|
281
|
-
* @returns Interpolated object
|
|
282
|
-
*/
|
|
283
|
-
interpolateObject(obj, stepName) {
|
|
284
|
-
if (typeof obj === 'string') {
|
|
285
|
-
return this.interpolate(obj, stepName);
|
|
286
|
-
}
|
|
287
|
-
if (Array.isArray(obj)) {
|
|
288
|
-
return obj.map((item) => this.interpolateObject(item, stepName));
|
|
289
|
-
}
|
|
290
|
-
if (obj && typeof obj === 'object') {
|
|
291
|
-
const result = {};
|
|
292
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
293
|
-
result[key] = this.interpolateObject(value, stepName);
|
|
294
|
-
}
|
|
295
|
-
return result;
|
|
296
|
-
}
|
|
297
|
-
return obj;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Validates that all referenced variables are defined
|
|
301
|
-
* @throws MissingEnvironmentVariableError if any referenced variable is missing
|
|
302
|
-
*/
|
|
303
|
-
validateReferencedVars() {
|
|
304
|
-
for (const varName of this.referencedVars) {
|
|
305
|
-
if (!this.envVars.has(varName)) {
|
|
306
|
-
throw new MissingEnvironmentVariableError(varName);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Resolves a single variable reference
|
|
312
|
-
* @param varName Variable name
|
|
313
|
-
* @param stepName Optional step name for error messages
|
|
314
|
-
* @returns Variable value
|
|
315
|
-
* @throws MissingEnvironmentVariableError if variable not found
|
|
316
|
-
*/
|
|
317
|
-
resolveVar(varName, stepName) {
|
|
318
|
-
this.referencedVars.add(varName);
|
|
319
|
-
const value = this.envVars.get(varName);
|
|
320
|
-
if (value === undefined) {
|
|
321
|
-
// Check if we have a hint for this variable
|
|
322
|
-
const hint = CIBUILD_VARIABLE_HINTS[varName];
|
|
323
|
-
throw new MissingEnvironmentVariableError(varName, stepName, hint);
|
|
324
|
-
}
|
|
325
|
-
return value;
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Computes MD5 checksum of a file
|
|
329
|
-
* @param filePath Path to file (relative to current working directory)
|
|
330
|
-
* @returns MD5 hash of file contents
|
|
331
|
-
* @throws Error if file does not exist or cannot be read
|
|
332
|
-
*/
|
|
333
|
-
computeChecksum(filePath, stepName) {
|
|
334
|
-
// Resolve relative path to absolute path
|
|
335
|
-
const absolutePath = path.resolve(process.cwd(), filePath);
|
|
336
|
-
// A file this checkout does not have gets its own error type, so a
|
|
337
|
-
// caller that can carry on without it — a cache key — can tell it apart
|
|
338
|
-
// from a file that exists and could not be read.
|
|
339
|
-
if (!fs.existsSync(absolutePath)) {
|
|
340
|
-
throw new ChecksumFileMissingError(filePath, stepName);
|
|
341
|
-
}
|
|
342
|
-
try {
|
|
343
|
-
// Read file and compute MD5 hash
|
|
344
|
-
const fileBuffer = fs.readFileSync(absolutePath);
|
|
345
|
-
const hash = crypto.createHash('md5');
|
|
346
|
-
hash.update(fileBuffer);
|
|
347
|
-
return hash.digest('hex');
|
|
348
|
-
}
|
|
349
|
-
catch (error) {
|
|
350
|
-
if (error instanceof Error) {
|
|
351
|
-
throw new Error(`Failed to compute checksum for "${filePath}": ${error.message}`);
|
|
352
|
-
}
|
|
353
|
-
throw error;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Adds built-in environment variables
|
|
358
|
-
* @param workflowName Name of the current workflow
|
|
359
|
-
* @param platform Detected platform
|
|
360
|
-
* @param stack Optional stack identifier
|
|
361
|
-
*/
|
|
362
|
-
addBuiltInVars(workflowName, platform, stack, yamlFilePath) {
|
|
363
|
-
// CI Build native variables (FR-9.2)
|
|
364
|
-
const buildNumber = process.env.BUILD_NUMBER || '1';
|
|
365
|
-
const buildUrl = process.env.BUILD_URL || 'https://cibuild.io/builds/1';
|
|
366
|
-
const appTitle = process.env.APP_TITLE || 'CI Build Build';
|
|
367
|
-
// Extract YAML filename (without extension) for use in naming resources like SSH keys
|
|
368
|
-
if (yamlFilePath) {
|
|
369
|
-
const yamlFilename = path.basename(yamlFilePath, path.extname(yamlFilePath));
|
|
370
|
-
this.envVars.set('CIBUILD_YAML_FILENAME', yamlFilename);
|
|
371
|
-
}
|
|
372
|
-
this.envVars.set('CIBUILD_BUILD_NUMBER', buildNumber);
|
|
373
|
-
this.envVars.set('CIBUILD_BUILD_URL', buildUrl);
|
|
374
|
-
this.envVars.set('CIBUILD_APP_TITLE', appTitle);
|
|
375
|
-
// Writable scratch path on local APFS disk. The sandbox runner sets this
|
|
376
|
-
// in the guest shell; outside a sandbox we fall back to TMPDIR so
|
|
377
|
-
// pipelines that reference $CIBUILD_SCRATCH still interpolate to
|
|
378
|
-
// something writable.
|
|
379
|
-
this.envVars.set('CIBUILD_SCRATCH', process.env.CIBUILD_SCRATCH || process.env.TMPDIR || '/tmp');
|
|
380
|
-
// Real user home directory. The sandbox runner overrides $HOME to a
|
|
381
|
-
// scratch path; CIBUILD_USER_HOME points to the actual /Users/<user>
|
|
382
|
-
// so tools like Gradle/Konan that ignore $HOME can be found. Outside
|
|
383
|
-
// a sandbox it falls back to $HOME.
|
|
384
|
-
this.envVars.set('CIBUILD_USER_HOME', process.env.CIBUILD_USER_HOME || process.env.HOME || '/tmp');
|
|
385
|
-
// Auto-detect git metadata from local repo
|
|
386
|
-
const git = (cmd, fallback) => {
|
|
387
|
-
try {
|
|
388
|
-
return execSync(`git ${cmd}`, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim() || fallback;
|
|
389
|
-
}
|
|
390
|
-
catch {
|
|
391
|
-
return fallback;
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
// Common built-in variables
|
|
395
|
-
const gitBranch = process.env.GIT_BRANCH || git('rev-parse --abbrev-ref HEAD', 'main');
|
|
396
|
-
const gitCommit = git('rev-parse HEAD', process.env.GIT_COMMIT || 'HEAD');
|
|
397
|
-
const gitRepoUrl = process.env.CIBUILD_GIT_REPOSITORY_URL || process.env.GIT_REPOSITORY_URL || git('remote get-url origin', '');
|
|
398
|
-
// Source directory
|
|
399
|
-
this.envVars.set('CIBUILD_SOURCE_DIR', process.cwd());
|
|
400
|
-
// Git variables
|
|
401
|
-
this.envVars.set('CIBUILD_GIT_BRANCH', gitBranch);
|
|
402
|
-
this.envVars.set('CIBUILD_GIT_COMMIT', gitCommit);
|
|
403
|
-
this.envVars.set('CIBUILD_GIT_REPOSITORY_URL', gitRepoUrl);
|
|
404
|
-
this.envVars.set('CIBUILD_TRIGGERED_WORKFLOW_ID', workflowName);
|
|
405
|
-
// Git metadata (auto-detected from local repo)
|
|
406
|
-
this.envVars.set('GIT_CLONE_COMMIT_HASH', gitCommit);
|
|
407
|
-
this.envVars.set('GIT_CLONE_COMMIT_AUTHOR_NAME', git('log -1 --format=%an', process.env.GIT_AUTHOR_NAME || ''));
|
|
408
|
-
this.envVars.set('GIT_CLONE_COMMIT_AUTHOR_EMAIL', git('log -1 --format=%ae', process.env.GIT_AUTHOR_EMAIL || ''));
|
|
409
|
-
this.envVars.set('GIT_CLONE_COMMIT_COMMITER_NAME', git('log -1 --format=%cn', process.env.GIT_COMMITTER_NAME || ''));
|
|
410
|
-
this.envVars.set('GIT_CLONE_COMMIT_COMMITER_EMAIL', git('log -1 --format=%ce', process.env.GIT_COMMITTER_EMAIL || ''));
|
|
411
|
-
this.envVars.set('GIT_CLONE_COMMIT_MESSAGE_SUBJECT', git('log -1 --format=%s', process.env.GIT_COMMIT_MESSAGE || ''));
|
|
412
|
-
this.envVars.set('GIT_CLONE_COMMIT_MESSAGE_BODY', git('log -1 --format=%b', ''));
|
|
413
|
-
// Platform-specific built-in variables
|
|
414
|
-
if (stack) {
|
|
415
|
-
this.envVars.set('CIBUILD_STACK', stack);
|
|
416
|
-
}
|
|
417
|
-
if (platform === 'macos') {
|
|
418
|
-
// Extract Xcode version from stack if available
|
|
419
|
-
if (stack) {
|
|
420
|
-
const xcodeMatch = stack.match(/xcode-(\d+\.\d+)/);
|
|
421
|
-
if (xcodeMatch) {
|
|
422
|
-
this.envVars.set('CIBUILD_XCODE_VERSION', xcodeMatch[1]);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
// Default Xcode scheme (can be overridden by user)
|
|
426
|
-
if (!this.envVars.has('CIBUILD_SCHEME')) {
|
|
427
|
-
this.envVars.set('CIBUILD_SCHEME', process.env.XCODE_SCHEME || 'Release');
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
if (platform === 'linux') {
|
|
431
|
-
// JAVA_HOME (can be overridden by user)
|
|
432
|
-
this.envVars.set('JAVA_HOME', process.env.JAVA_HOME || '/usr/lib/jvm/java-17-openjdk');
|
|
433
|
-
this.envVars.set('CIBUILD_GRADLE_VERSION', process.env.GRADLE_VERSION || '8.0');
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
/**
|
|
437
|
-
* Merges environment variables from YAML array format
|
|
438
|
-
* @param envArray Array of environment variable objects
|
|
439
|
-
*/
|
|
440
|
-
/**
|
|
441
|
-
* The variable a declared `envs` key stands for, or null when the
|
|
442
|
-
* declaration belongs to a different workflow.
|
|
443
|
-
*
|
|
444
|
-
* A credential two workflows cannot share is declared once per workflow,
|
|
445
|
-
* under the same name a workflow-scoped secret carries — the pipeline says
|
|
446
|
-
* `CIBUILD_SW__RELEASE__LOCAL_PROPERTIES: ""` where it used to say
|
|
447
|
-
* `LOCAL_PROPERTIES: ""`. The build still reads the credential under its
|
|
448
|
-
* plain name, so the declaration has to mean the plain name: it is what puts
|
|
449
|
-
* an unsupplied key in the map for `file@1.0.0` to refuse over, and what
|
|
450
|
-
* lets `importDeclaredFromProcessEnv` accept a value delivered flat.
|
|
451
|
-
*
|
|
452
|
-
* A slot naming another workflow is dropped rather than declared. Declaring
|
|
453
|
-
* it would make this workflow demand a value only that one was ever going to
|
|
454
|
-
* be given. The decoding lives here, beside the decoding of the secret
|
|
455
|
-
* itself, so the steps keep reading their plain `var_name` and never learn
|
|
456
|
-
* the convention exists.
|
|
457
|
-
*
|
|
458
|
-
* A slot naming a workflow the pipeline does not have is refused rather than
|
|
459
|
-
* dropped — see `UnknownWorkflowSlotError`. Dropping it silently is the same
|
|
460
|
-
* outcome as never declaring the credential, which is the green skip issue 03
|
|
461
|
-
* exists to end.
|
|
462
|
-
*/
|
|
463
|
-
slotKeyFor(key) {
|
|
464
|
-
const decoded = decodeSecretName(key);
|
|
465
|
-
if (!decoded)
|
|
466
|
-
return key;
|
|
467
|
-
if (decoded.workflow) {
|
|
468
|
-
if (!this.declaredWorkflows.includes(decoded.workflow)) {
|
|
469
|
-
throw new UnknownWorkflowSlotError(key, decoded.varName, decoded.workflow, this.declaredWorkflows);
|
|
470
|
-
}
|
|
471
|
-
if (decoded.workflow !== this.workflowName)
|
|
472
|
-
return null;
|
|
473
|
-
}
|
|
474
|
-
return decoded.varName;
|
|
475
|
-
}
|
|
476
|
-
mergeEnvVars(envArray) {
|
|
477
|
-
for (const envObj of envArray) {
|
|
478
|
-
for (const [declaredKey, value] of Object.entries(envObj)) {
|
|
479
|
-
const key = this.slotKeyFor(declaredKey);
|
|
480
|
-
if (key === null)
|
|
481
|
-
continue;
|
|
482
|
-
// Naming the key is the declaration, whatever value follows it
|
|
483
|
-
this.declaredVars.add(key);
|
|
484
|
-
// First resolve any secret references
|
|
485
|
-
const secretResolved = this.resolveSecretReference(value);
|
|
486
|
-
// Then interpolate in case it references other env vars
|
|
487
|
-
const interpolated = this.interpolateEnvValue(secretResolved);
|
|
488
|
-
// Don't overwrite a non-empty value (e.g. a loaded secret) with an empty
|
|
489
|
-
// YAML placeholder string — secrets are loaded before YAML envs and should
|
|
490
|
-
// survive empty placeholder declarations like `KEYSTORE_BASE64: ""`
|
|
491
|
-
if (interpolated === '' && this.envVars.get(key)) {
|
|
492
|
-
continue;
|
|
493
|
-
}
|
|
494
|
-
this.envVars.set(key, interpolated);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
/**
|
|
499
|
-
* Fills a declared-but-still-empty variable from the process environment.
|
|
500
|
-
*
|
|
501
|
-
* This is how a credential dispatched by a build service arrives. The
|
|
502
|
-
* dispatch hands the value to the runner, the runner merges it into the
|
|
503
|
-
* environment of the `ci` invocation, and nothing else copies it anywhere —
|
|
504
|
-
* it writes no `.cibuild-secrets.json`, and that file is gitignored so the
|
|
505
|
-
* clone has none either. Without this step the value sits in the shell and
|
|
506
|
-
* is invisible to the steps that read this map: `file@1.0.0` reads
|
|
507
|
-
* `env[var_name]`, finds nothing, prints "not set — skipping" and reports
|
|
508
|
-
* success. Every credential a pipeline declared as an empty slot was
|
|
509
|
-
* dropped that way, on every dispatched build, with a green step.
|
|
510
|
-
*
|
|
511
|
-
* Scoped to keys the pipeline declares, deliberately. Copying `process.env`
|
|
512
|
-
* wholesale would turn arbitrary host environment into pipeline values and
|
|
513
|
-
* would change what every existing pipeline resolves. The declaration is
|
|
514
|
-
* the opt-in: `- GOOGLE_SERVICES_JSON: ""` is the pipeline saying "I read
|
|
515
|
-
* this key and I have no value for it", which is exactly the invitation the
|
|
516
|
-
* dispatched environment needs. A key nothing declares stays out, so `HOME`
|
|
517
|
-
* and the rest of the host's environment are not pipeline variables.
|
|
518
|
-
*
|
|
519
|
-
* Last, so anything an earlier source did supply wins — a developer's
|
|
520
|
-
* `.cibuild-secrets.json` still beats an inherited environment. The value
|
|
521
|
-
* is taken verbatim, with no interpolation, for the same reason step 2
|
|
522
|
-
* takes secrets verbatim: a credential is bytes, and a `$` inside one is
|
|
523
|
-
* not a variable reference.
|
|
524
|
-
*/
|
|
525
|
-
importDeclaredFromProcessEnv() {
|
|
526
|
-
for (const key of this.declaredVars) {
|
|
527
|
-
// Any non-empty value from an earlier source stays. Only empty is open.
|
|
528
|
-
if (this.envVars.get(key))
|
|
529
|
-
continue;
|
|
530
|
-
const fromProcess = process.env[key];
|
|
531
|
-
if (!fromProcess)
|
|
532
|
-
continue;
|
|
533
|
-
this.envVars.set(key, fromProcess);
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
/**
|
|
537
|
-
* Resolves $SECRET{secret_id} references to actual secret values
|
|
538
|
-
* @param value Value that may contain a secret reference
|
|
539
|
-
* @returns Resolved value with secret content, or empty string if secret not found
|
|
540
|
-
*/
|
|
541
|
-
resolveSecretReference(value) {
|
|
542
|
-
// Convert non-strings to strings first
|
|
543
|
-
if (typeof value !== 'string') {
|
|
544
|
-
return String(value);
|
|
545
|
-
}
|
|
546
|
-
// Check for $SECRET{secret_id} pattern
|
|
547
|
-
const secretMatch = value.match(/^\$SECRET\{([^}]+)\}$/);
|
|
548
|
-
if (!secretMatch) {
|
|
549
|
-
return value;
|
|
550
|
-
}
|
|
551
|
-
const secretId = secretMatch[1];
|
|
552
|
-
const secretValue = this.secretsManager.getSecret(secretId);
|
|
553
|
-
if (!secretValue) {
|
|
554
|
-
// Return empty string silently — the validation step will report this
|
|
555
|
-
return '';
|
|
556
|
-
}
|
|
557
|
-
return secretValue;
|
|
558
|
-
}
|
|
559
|
-
/**
|
|
560
|
-
* Interpolates environment variable value during initial setup
|
|
561
|
-
* This allows env vars to reference other env vars
|
|
562
|
-
* @param value Raw value
|
|
563
|
-
* @returns Interpolated value or original if interpolation fails
|
|
564
|
-
*/
|
|
565
|
-
interpolateEnvValue(value) {
|
|
566
|
-
try {
|
|
567
|
-
return this.interpolate(value);
|
|
568
|
-
}
|
|
569
|
-
catch (err) {
|
|
570
|
-
// If interpolation fails during setup, return the raw value
|
|
571
|
-
// It will be interpolated later when all vars are available
|
|
572
|
-
return value;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
/**
|
|
577
|
-
* Helper function to create an EnvResolver for a workflow
|
|
578
|
-
* @param pipeline Parsed YAML pipeline
|
|
579
|
-
* @param workflowName Name of the workflow
|
|
580
|
-
* @param platform Detected platform
|
|
581
|
-
* @param stack Optional stack identifier
|
|
582
|
-
* @returns EnvResolver instance
|
|
583
|
-
*/
|
|
584
|
-
export function createEnvResolver(pipeline, workflowName, platform, stack) {
|
|
585
|
-
const workflow = pipeline.workflows[workflowName];
|
|
586
|
-
if (!workflow) {
|
|
587
|
-
throw new Error(`Workflow '${workflowName}' not found`);
|
|
588
|
-
}
|
|
589
|
-
return new EnvResolver(pipeline, workflow, workflowName, platform, stack);
|
|
590
|
-
}
|
|
591
|
-
//# sourceMappingURL=env-resolver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-resolver.test.d.ts","sourceRoot":"","sources":["../../../src/yaml/env-resolver.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|