@vaharoni/devops 1.2.12 → 1.2.14
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-N7EX3HJH.js +139 -0
- package/dist/chunk-RZ46YYZZ.js +420 -0
- package/dist/chunk-WKP7EQNU.js +421 -0
- package/dist/devops.d.ts +0 -2
- package/dist/devops.js +3235 -91
- package/dist/index.d.ts +972 -4
- package/dist/index.js +67 -3
- package/dist/plugins.d.ts +95 -4
- package/dist/plugins.js +20 -6
- package/dist/src/target-templates/README.md +1 -0
- package/dist/src/target-templates/cluster-resource-options/README.md +2 -0
- package/dist/src/target-templates/cluster-resource-options/dns-test/dns-test.yaml +60 -0
- package/dist/src/target-templates/cluster-resource-options/milvus/production/milvus-values.yaml +2 -0
- package/dist/src/target-templates/cluster-resource-options/milvus/staging/milvus-values.yaml +2 -0
- package/dist/src/target-templates/cluster-resource-options/monitoring-ingress/monitoring-ingress.yaml +62 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/daily-operator-restart.yaml +54 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/production/cluster/PodDisruptionBudget.yaml +27 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/production/cluster/SGCluster.yaml +47 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/production/cluster/StackGres-alerts.yaml +191 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/production/configurations/06-SGDistributedLogs.yaml +11 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/production/configurations/07-SGObjectStorage.yaml +18 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/production/configurations/08-SGScript.yaml +12 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/stackgres-ui-ingress.yaml +35 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/staging/cluster/SGCluster.yaml +42 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/staging/configurations/07-SGObjectStorage.yaml +18 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/staging/configurations/08-SGScript.yaml +12 -0
- package/dist/src/target-templates/cluster-resource-options/prefect/production/prefect-values.yaml +14 -0
- package/dist/src/target-templates/cluster-resource-options/prefect/staging/prefect-values.yaml +14 -0
- package/dist/src/target-templates/cluster-resource-options/redis/production/redis-values.yaml +20 -0
- package/dist/src/target-templates/cluster-resource-options/redis/staging/redis-values.yaml +8 -0
- package/dist/src/target-templates/infra-variants/README.md +2 -0
- package/dist/src/target-templates/infra-variants/digitalocean/.devops/config/constants.yaml +18 -0
- package/dist/src/target-templates/infra-variants/digitalocean/.github/workflows/k8s-build.yaml +91 -0
- package/dist/src/target-templates/infra-variants/gcloud/.devops/config/constants.yaml +15 -0
- package/dist/src/target-templates/infra-variants/gcloud/.devops/manifests/ingress.yaml.hb +22 -0
- package/dist/src/target-templates/infra-variants/gcloud/.github/workflows/k8s-build.yaml +95 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/config/constants.yaml +18 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/abandoned/harbor-values.yaml +30 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/abandoned/hcloud-config.yaml +134 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/cert-manager.yaml +25 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/harbor-cert.yaml +13 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/harbor-values.yaml +76 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/hcloud-config.yaml +113 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/ingress-nginx-annotations.yaml +49 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/ingress-nginx-configmap.yaml +8 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/retain-storage-class.yaml +8 -0
- package/dist/src/target-templates/infra-variants/hetzner/.github/workflows/k8s-build.yaml +93 -0
- package/dist/src/target-templates/lang-variants-common/README.md +4 -0
- package/dist/src/target-templates/lang-variants-common/python/.cursor/rules/monorepo-python.mdc +56 -0
- package/dist/src/target-templates/lang-variants-common/python/.devops/config/images.yaml +89 -0
- package/dist/src/target-templates/lang-variants-common/python/.devops/docker-images/python-services/python-exec.sh +8 -0
- package/dist/src/target-templates/lang-variants-common/python/.devops/docker-images/python-services/python-run.sh +8 -0
- package/dist/src/target-templates/lang-variants-common/python/.devops/docker-images/python-services.Dockerfile +29 -0
- package/dist/src/target-templates/lang-variants-common/python/.devops/manifests/_index.yaml +21 -0
- package/dist/src/target-templates/lang-variants-common/python/.devops/manifests/prefect.yaml.hb +63 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-data-pipeline/pyproject.toml +14 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-data-pipeline/src/example_data_pipeline/main.py +38 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-python/pyproject.toml +20 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-python/src/example_python/__init__.py +0 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-python/src/example_python/main.py +13 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-python/src/example_python/scripts.py +17 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-python/tests/__init__.py +0 -0
- package/dist/src/target-templates/lang-variants-common/python/devopspy +3 -0
- package/dist/src/target-templates/lang-variants-common/python/libs/example-python-lib/pyproject.toml +11 -0
- package/dist/src/target-templates/lang-variants-common/python/libs/example-python-lib/src/example_python_lib/__init__.py +2 -0
- package/dist/src/target-templates/lang-variants-common/python/pyproject.toml +16 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.cursor/rules/monorepo-typescript.mdc +51 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/config/images.yaml +69 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/cloudrun.Dockerfile +31 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/common/docker-common.sh +23 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/node-services/node-exec.sh +8 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/node-services/node-run.sh +8 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/node-services.Dockerfile +31 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/env.example.yaml +23 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/_index.yaml +19 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/cron-jobs.yaml.hb +56 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/db-migrate-job.yaml.hb +43 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/deployment-debug.yaml.hb +42 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/deployment-process.yaml.hb +48 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/deployment-web.yaml.hb +54 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/ingress.yaml.hb +21 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/service.yaml.hb +15 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.envrc +5 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/build-image@v1/action.yaml +81 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/connect-to-digital-ocean@v1/action.yaml +29 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/connect-to-gke@v1/action.yaml +43 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/connect-to-hetzner@v1/action.yaml +31 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/db-migrate@v1/action.yaml +23 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/deploy-image-cloudrun@v1/action.yaml +71 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/deploy-image-k8s@v1/action.yaml +37 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/setup-prereq@v1/action.yaml +24 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/example-node/index.ts +30 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/example-node/package.json +26 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/example-node/tsconfig.json +3 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/jobs/README.md +68 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/jobs/index.ts +1 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/jobs/package.json +30 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/jobs/tsconfig.json +3 -0
- package/dist/src/target-templates/lang-variants-common/typescript/config/.env.development +1 -0
- package/dist/src/target-templates/lang-variants-common/typescript/config/.env.global +4 -0
- package/dist/src/target-templates/lang-variants-common/typescript/config/.env.test +1 -0
- package/dist/src/target-templates/lang-variants-common/typescript/devops +3 -0
- package/dist/src/target-templates/lang-variants-common/typescript/libs/example-node-lib/index.ts +3 -0
- package/dist/src/target-templates/lang-variants-common/typescript/libs/example-node-lib/package.json +12 -0
- package/dist/src/target-templates/lang-variants-common/typescript/libs/example-node-lib/tsconfig.json +3 -0
- package/dist/src/target-templates/lang-variants-common/typescript/tmp/.gitkeep +0 -0
- package/dist/src/target-templates/lang-variants-common/typescript/tsconfig.json +27 -0
- package/dist/src/target-templates/lang-variants-prisma/README.md +3 -0
- package/dist/src/target-templates/lang-variants-prisma/python/.cursor/rules/prisma-python.mdc +55 -0
- package/dist/src/target-templates/lang-variants-prisma/python/.cursor/rules/testing-python.mdc +89 -0
- package/dist/src/target-templates/lang-variants-prisma/python/db/db/__init__.py +0 -0
- package/dist/src/target-templates/lang-variants-prisma/python/db/db/db_client_test.py +46 -0
- package/dist/src/target-templates/lang-variants-prisma/python/db/pyproject.toml +14 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/.cursor/rules/prisma-typescript.mdc +54 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/.cursor/rules/testing-typescript.mdc +103 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/db-client-test.ts +142 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/db-client.ts +19 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/env.yaml +4 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/package.json +17 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/prisma/schema.prisma +24 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/prisma-setup-vitest.ts +27 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/tsconfig.json +3 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/dml/package.json +7 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/dml/tsconfig.json +3 -0
- package/package.json +3 -2
- package/src/cli/core/exec.ts +2 -4
- package/src/cli/core/run.ts +2 -4
- package/src/cli/extensions/prisma.ts +2 -4
- package/src/libs/init-generator.ts +2 -4
- package/src/pkg-root.ts +14 -0
- package/src/plugins.ts +2 -4
- package/src/target-templates/lang-variants-common/python/.cursor/rules/monorepo-python.mdc +56 -0
- package/src/target-templates/lang-variants-common/typescript/.cursor/rules/monorepo-typescript.mdc +51 -0
- package/src/target-templates/lang-variants-prisma/python/.cursor/rules/prisma-python.mdc +55 -0
- package/src/target-templates/lang-variants-prisma/python/.cursor/rules/testing-python.mdc +89 -0
- package/src/target-templates/lang-variants-prisma/typescript/.cursor/rules/prisma-typescript.mdc +54 -0
- package/src/target-templates/lang-variants-prisma/typescript/.cursor/rules/testing-typescript.mdc +103 -0
- package/src/target-templates/lang-variants-prisma/typescript/db/db-client-test.ts +5 -3
- package/dist/app-support/crypto/aes.d.ts +0 -15
- package/dist/app-support/crypto/aes.d.ts.map +0 -1
- package/dist/app-support/crypto/aes.js +0 -56
- package/dist/app-support/crypto/aes.spec.d.ts +0 -2
- package/dist/app-support/crypto/aes.spec.d.ts.map +0 -1
- package/dist/app-support/crypto/aes.spec.js +0 -58
- package/dist/app-support/crypto/index.d.ts +0 -16
- package/dist/app-support/crypto/index.d.ts.map +0 -1
- package/dist/app-support/crypto/index.js +0 -31
- package/dist/app-support/crypto/internal-token.d.ts +0 -20
- package/dist/app-support/crypto/internal-token.d.ts.map +0 -1
- package/dist/app-support/crypto/internal-token.js +0 -42
- package/dist/app-support/crypto/internal-token.spec.d.ts +0 -2
- package/dist/app-support/crypto/internal-token.spec.d.ts.map +0 -1
- package/dist/app-support/crypto/internal-token.spec.js +0 -45
- package/dist/app-support/crypto/secret.d.ts +0 -3
- package/dist/app-support/crypto/secret.d.ts.map +0 -1
- package/dist/app-support/crypto/secret.js +0 -12
- package/dist/app-support/crypto/secret.spec.d.ts +0 -2
- package/dist/app-support/crypto/secret.spec.d.ts.map +0 -1
- package/dist/app-support/crypto/secret.spec.js +0 -15
- package/dist/app-support/discovery/dev-discovery-loader.d.ts +0 -2
- package/dist/app-support/discovery/dev-discovery-loader.d.ts.map +0 -1
- package/dist/app-support/discovery/dev-discovery-loader.js +0 -30
- package/dist/app-support/discovery/service-endpoint.d.ts +0 -2
- package/dist/app-support/discovery/service-endpoint.d.ts.map +0 -1
- package/dist/app-support/discovery/service-endpoint.js +0 -10
- package/dist/cli/common.d.ts +0 -89
- package/dist/cli/common.d.ts.map +0 -1
- package/dist/cli/common.js +0 -246
- package/dist/cli/common.spec.d.ts +0 -2
- package/dist/cli/common.spec.d.ts.map +0 -1
- package/dist/cli/common.spec.js +0 -64
- package/dist/cli/core/affected.d.ts +0 -9
- package/dist/cli/core/affected.d.ts.map +0 -1
- package/dist/cli/core/affected.js +0 -101
- package/dist/cli/core/cloudrun.d.ts +0 -9
- package/dist/cli/core/cloudrun.d.ts.map +0 -1
- package/dist/cli/core/cloudrun.js +0 -119
- package/dist/cli/core/console.d.ts +0 -10
- package/dist/cli/core/console.d.ts.map +0 -1
- package/dist/cli/core/console.js +0 -50
- package/dist/cli/core/constant.d.ts +0 -9
- package/dist/cli/core/constant.d.ts.map +0 -1
- package/dist/cli/core/constant.js +0 -20
- package/dist/cli/core/env.d.ts +0 -9
- package/dist/cli/core/env.d.ts.map +0 -1
- package/dist/cli/core/env.js +0 -65
- package/dist/cli/core/exec.d.ts +0 -9
- package/dist/cli/core/exec.d.ts.map +0 -1
- package/dist/cli/core/exec.js +0 -48
- package/dist/cli/core/image.d.ts +0 -9
- package/dist/cli/core/image.d.ts.map +0 -1
- package/dist/cli/core/image.js +0 -153
- package/dist/cli/core/index.d.ts +0 -16
- package/dist/cli/core/index.d.ts.map +0 -1
- package/dist/cli/core/index.js +0 -15
- package/dist/cli/core/init.d.ts +0 -9
- package/dist/cli/core/init.d.ts.map +0 -1
- package/dist/cli/core/init.js +0 -219
- package/dist/cli/core/job.d.ts +0 -9
- package/dist/cli/core/job.d.ts.map +0 -1
- package/dist/cli/core/job.js +0 -65
- package/dist/cli/core/namespace.d.ts +0 -9
- package/dist/cli/core/namespace.d.ts.map +0 -1
- package/dist/cli/core/namespace.js +0 -67
- package/dist/cli/core/prep-build.d.ts +0 -10
- package/dist/cli/core/prep-build.d.ts.map +0 -1
- package/dist/cli/core/prep-build.js +0 -109
- package/dist/cli/core/registry.d.ts +0 -9
- package/dist/cli/core/registry.d.ts.map +0 -1
- package/dist/cli/core/registry.js +0 -66
- package/dist/cli/core/run-many.d.ts +0 -10
- package/dist/cli/core/run-many.d.ts.map +0 -1
- package/dist/cli/core/run-many.js +0 -48
- package/dist/cli/core/run.d.ts +0 -9
- package/dist/cli/core/run.d.ts.map +0 -1
- package/dist/cli/core/run.js +0 -35
- package/dist/cli/core/test.d.ts +0 -9
- package/dist/cli/core/test.d.ts.map +0 -1
- package/dist/cli/core/test.js +0 -26
- package/dist/cli/extensions/dml.d.ts +0 -9
- package/dist/cli/extensions/dml.d.ts.map +0 -1
- package/dist/cli/extensions/dml.js +0 -114
- package/dist/cli/extensions/index.d.ts +0 -9
- package/dist/cli/extensions/index.d.ts.map +0 -1
- package/dist/cli/extensions/index.js +0 -8
- package/dist/cli/extensions/internal-curl.d.ts +0 -10
- package/dist/cli/extensions/internal-curl.d.ts.map +0 -1
- package/dist/cli/extensions/internal-curl.js +0 -41
- package/dist/cli/extensions/jwt.d.ts +0 -9
- package/dist/cli/extensions/jwt.d.ts.map +0 -1
- package/dist/cli/extensions/jwt.js +0 -25
- package/dist/cli/extensions/prisma.d.ts +0 -9
- package/dist/cli/extensions/prisma.d.ts.map +0 -1
- package/dist/cli/extensions/prisma.js +0 -23
- package/dist/cli/extensions/redis-bitnami.d.ts +0 -11
- package/dist/cli/extensions/redis-bitnami.d.ts.map +0 -1
- package/dist/cli/extensions/redis-bitnami.js +0 -74
- package/dist/cli/extensions/redis-ha.d.ts +0 -11
- package/dist/cli/extensions/redis-ha.d.ts.map +0 -1
- package/dist/cli/extensions/redis-ha.js +0 -51
- package/dist/cli/extensions/stackgres.d.ts +0 -10
- package/dist/cli/extensions/stackgres.d.ts.map +0 -1
- package/dist/cli/extensions/stackgres.js +0 -117
- package/dist/cli/extensions/template.d.ts +0 -9
- package/dist/cli/extensions/template.d.ts.map +0 -1
- package/dist/cli/extensions/template.js +0 -121
- package/dist/devops.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/libs/affected-entities.d.ts +0 -15
- package/dist/libs/affected-entities.d.ts.map +0 -1
- package/dist/libs/affected-entities.js +0 -52
- package/dist/libs/cloudrun-helpers.d.ts +0 -16
- package/dist/libs/cloudrun-helpers.d.ts.map +0 -1
- package/dist/libs/cloudrun-helpers.js +0 -81
- package/dist/libs/config.d.ts +0 -7
- package/dist/libs/config.d.ts.map +0 -1
- package/dist/libs/config.js +0 -102
- package/dist/libs/digital-ocean/container-reg.d.ts +0 -6
- package/dist/libs/digital-ocean/container-reg.d.ts.map +0 -1
- package/dist/libs/digital-ocean/container-reg.js +0 -74
- package/dist/libs/discovery/dependencies.d.ts +0 -19
- package/dist/libs/discovery/dependencies.d.ts.map +0 -1
- package/dist/libs/discovery/dependencies.js +0 -62
- package/dist/libs/discovery/dependencies.spec.d.ts +0 -2
- package/dist/libs/discovery/dependencies.spec.d.ts.map +0 -1
- package/dist/libs/discovery/dependencies.spec.js +0 -21
- package/dist/libs/discovery/images.d.ts +0 -5
- package/dist/libs/discovery/images.d.ts.map +0 -1
- package/dist/libs/discovery/images.js +0 -45
- package/dist/libs/discovery/index.d.ts +0 -6
- package/dist/libs/discovery/index.d.ts.map +0 -1
- package/dist/libs/discovery/index.js +0 -67
- package/dist/libs/discovery/process-common.d.ts +0 -25
- package/dist/libs/discovery/process-common.d.ts.map +0 -1
- package/dist/libs/discovery/process-common.js +0 -40
- package/dist/libs/discovery/process-package-json.d.ts +0 -3
- package/dist/libs/discovery/process-package-json.d.ts.map +0 -1
- package/dist/libs/discovery/process-package-json.js +0 -40
- package/dist/libs/discovery/process-pyproject-toml.d.ts +0 -3
- package/dist/libs/discovery/process-pyproject-toml.d.ts.map +0 -1
- package/dist/libs/discovery/process-pyproject-toml.js +0 -49
- package/dist/libs/git-helpers.d.ts +0 -8
- package/dist/libs/git-helpers.d.ts.map +0 -1
- package/dist/libs/git-helpers.js +0 -20
- package/dist/libs/hetzner/reg-secret.d.ts +0 -3
- package/dist/libs/hetzner/reg-secret.d.ts.map +0 -1
- package/dist/libs/hetzner/reg-secret.js +0 -39
- package/dist/libs/init-generator.d.ts +0 -41
- package/dist/libs/init-generator.d.ts.map +0 -1
- package/dist/libs/init-generator.js +0 -123
- package/dist/libs/k8s-constants.d.ts +0 -13
- package/dist/libs/k8s-constants.d.ts.map +0 -1
- package/dist/libs/k8s-constants.js +0 -91
- package/dist/libs/k8s-db.d.ts +0 -18
- package/dist/libs/k8s-db.d.ts.map +0 -1
- package/dist/libs/k8s-db.js +0 -73
- package/dist/libs/k8s-generate.d.ts +0 -17
- package/dist/libs/k8s-generate.d.ts.map +0 -1
- package/dist/libs/k8s-generate.js +0 -193
- package/dist/libs/k8s-helpers.d.ts +0 -11
- package/dist/libs/k8s-helpers.d.ts.map +0 -1
- package/dist/libs/k8s-helpers.js +0 -42
- package/dist/libs/k8s-image-config.d.ts +0 -8
- package/dist/libs/k8s-image-config.d.ts.map +0 -1
- package/dist/libs/k8s-image-config.js +0 -113
- package/dist/libs/k8s-job-waiter.d.ts +0 -8
- package/dist/libs/k8s-job-waiter.d.ts.map +0 -1
- package/dist/libs/k8s-job-waiter.js +0 -84
- package/dist/libs/k8s-namespace.d.ts +0 -7
- package/dist/libs/k8s-namespace.d.ts.map +0 -1
- package/dist/libs/k8s-namespace.js +0 -27
- package/dist/libs/k8s-redis-bitnami.d.ts +0 -6
- package/dist/libs/k8s-redis-bitnami.d.ts.map +0 -1
- package/dist/libs/k8s-redis-bitnami.js +0 -31
- package/dist/libs/k8s-redis-ha.d.ts +0 -3
- package/dist/libs/k8s-redis-ha.d.ts.map +0 -1
- package/dist/libs/k8s-redis-ha.js +0 -15
- package/dist/libs/k8s-secrets-manager.d.ts +0 -6
- package/dist/libs/k8s-secrets-manager.d.ts.map +0 -1
- package/dist/libs/k8s-secrets-manager.js +0 -64
- package/dist/libs/validate-env.d.ts +0 -56
- package/dist/libs/validate-env.d.ts.map +0 -1
- package/dist/libs/validate-env.js +0 -214
- package/dist/libs/validate-env.spec.d.ts +0 -2
- package/dist/libs/validate-env.spec.d.ts.map +0 -1
- package/dist/libs/validate-env.spec.js +0 -168
- package/dist/plugins.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -939
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -82
package/dist/cli/common.spec.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { CLICommandParser } from './common';
|
|
3
|
-
describe('CLICommandParser', () => {
|
|
4
|
-
// Extra white space intentional
|
|
5
|
-
const subject = new CLICommandParser('run tmp/test.sh --env production --in workspace --flag arg'.split(' '));
|
|
6
|
-
it('constructor: builds object correctly', () => {
|
|
7
|
-
expect(subject.command).toEqual('run');
|
|
8
|
-
expect(subject.env).toEqual('production');
|
|
9
|
-
expect(subject.args).toEqual([
|
|
10
|
-
'tmp/test.sh',
|
|
11
|
-
'--in',
|
|
12
|
-
'workspace',
|
|
13
|
-
'--flag',
|
|
14
|
-
'arg',
|
|
15
|
-
]);
|
|
16
|
-
});
|
|
17
|
-
describe('parseOptions', () => {
|
|
18
|
-
it('detects params and booleans', () => {
|
|
19
|
-
const res = subject.parseOptions({
|
|
20
|
-
params: ['--in'],
|
|
21
|
-
booleans: ['--flag'],
|
|
22
|
-
});
|
|
23
|
-
expect(res.args).toEqual(['tmp/test.sh', 'arg']);
|
|
24
|
-
expect(res.argsStr).toEqual('tmp/test.sh arg');
|
|
25
|
-
expect(res.options).toEqual({ '--in': 'workspace', '--flag': true });
|
|
26
|
-
});
|
|
27
|
-
it('leaves intact params that are not in the list', () => {
|
|
28
|
-
const res = subject.parseOptions();
|
|
29
|
-
expect(res.args).toEqual([
|
|
30
|
-
'tmp/test.sh',
|
|
31
|
-
'--in',
|
|
32
|
-
'workspace',
|
|
33
|
-
'--flag',
|
|
34
|
-
'arg',
|
|
35
|
-
]);
|
|
36
|
-
expect(res.argsStr).toEqual('tmp/test.sh --in workspace --flag arg');
|
|
37
|
-
expect(res.options).toEqual({});
|
|
38
|
-
});
|
|
39
|
-
it('handles passthrough args when they exist', () => {
|
|
40
|
-
const altSubject = new CLICommandParser('run tmp/test.sh --env production --in workspace --flag arg -- p1 p2'.split(' '));
|
|
41
|
-
const res = altSubject.parseOptions({
|
|
42
|
-
params: ['--in'],
|
|
43
|
-
booleans: ['--flag'],
|
|
44
|
-
passthroughArgs: true,
|
|
45
|
-
});
|
|
46
|
-
expect(res.args).toEqual(['tmp/test.sh', 'arg']);
|
|
47
|
-
expect(res.argsStr).toEqual('tmp/test.sh arg');
|
|
48
|
-
expect(res.options).toEqual({ '--in': 'workspace', '--flag': true });
|
|
49
|
-
expect(res.passthrough).toEqual(['p1', 'p2']);
|
|
50
|
-
});
|
|
51
|
-
it('handles passthrough args when they do not exist', () => {
|
|
52
|
-
const altSubject = new CLICommandParser('run tmp/test.sh --env production --in workspace --flag arg'.split(' '));
|
|
53
|
-
const res = altSubject.parseOptions({
|
|
54
|
-
params: ['--in'],
|
|
55
|
-
booleans: ['--flag'],
|
|
56
|
-
passthroughArgs: true,
|
|
57
|
-
});
|
|
58
|
-
expect(res.args).toEqual(['tmp/test.sh', 'arg']);
|
|
59
|
-
expect(res.argsStr).toEqual('tmp/test.sh arg');
|
|
60
|
-
expect(res.options).toEqual({ '--in': 'workspace', '--flag': true });
|
|
61
|
-
expect(res.passthrough).toEqual([]);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CLICommandParser } from "../common";
|
|
2
|
-
declare function run(cmdObj: CLICommandParser): Promise<void>;
|
|
3
|
-
export declare const affected: {
|
|
4
|
-
oneLiner: string;
|
|
5
|
-
keyExamples: string;
|
|
6
|
-
run: typeof run;
|
|
7
|
-
};
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=affected.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"affected.d.ts","sourceRoot":"","sources":["../../../src/cli/core/affected.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,WAAW,CAAC;AAoD9E,iBAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,iBAoD1C;AAED,eAAO,MAAM,QAAQ;;;;CAAiC,CAAC"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { findImagesAffected, findImagesWithAffectedWorkspace, isImageAffected, isWorkspaceAffected, } from "../../libs/affected-entities";
|
|
2
|
-
import { getImageData } from "../../libs/config";
|
|
3
|
-
import { CLICommandParser, printUsageAndExit, StrongParams } from "../common";
|
|
4
|
-
const oneLiner = "Command to check whether an image or a workspace is affected by certain commit(s)";
|
|
5
|
-
const keyExamples = `
|
|
6
|
-
$ devops affected list-images
|
|
7
|
-
$ devops affected workspace db --base <sha1> --head <sha2>
|
|
8
|
-
$ devops affected image main-node --from-live-version
|
|
9
|
-
$ devops affected find-migrator --from-live-version
|
|
10
|
-
`;
|
|
11
|
-
const usage = `
|
|
12
|
-
${oneLiner}
|
|
13
|
-
|
|
14
|
-
GENERAL USAGE
|
|
15
|
-
List
|
|
16
|
-
devops affected list-images --base [SHA1] --head [SHA2]
|
|
17
|
-
devops affected list-images --from-live-version
|
|
18
|
-
|
|
19
|
-
These return a list of all images affected by the given commits.
|
|
20
|
-
|
|
21
|
-
Checkers
|
|
22
|
-
devops affected workspace <workspace> --base [SHA1] --head [SHA2]
|
|
23
|
-
|
|
24
|
-
devops affected image <image> --base [SHA1] --head [SHA2]
|
|
25
|
-
devops affected image <image> --from-live-version
|
|
26
|
-
|
|
27
|
-
These return "true" or "false".
|
|
28
|
-
|
|
29
|
-
Finders
|
|
30
|
-
devops affected find-migrator --base [SHA1] --head [SHA2]
|
|
31
|
-
devops affected find-migrator --from-live-version
|
|
32
|
-
|
|
33
|
-
When --base and --head are used, it checks whether the db project is affected. If it is, it returns the name of one random
|
|
34
|
-
affected image.
|
|
35
|
-
When --from-live-version is used, it iterates on the live version of each image that depends on db, and returns the first image that is
|
|
36
|
-
affected by a db project change since that commit.
|
|
37
|
-
|
|
38
|
-
If the db project is unaffected, returns an empty string.
|
|
39
|
-
|
|
40
|
-
Options
|
|
41
|
-
Which commits are regarded for the affected calculation can be changed using:
|
|
42
|
-
--base Base of the current branch (HEAD^ by default)
|
|
43
|
-
--head Latest commit of the current branch (HEAD by default)
|
|
44
|
-
--from-live-version Use the live version of the image/workspace as the base (see devops image version get)
|
|
45
|
-
|
|
46
|
-
If --from-live-version is present, --base and --head are ignored.
|
|
47
|
-
|
|
48
|
-
EXAMPLES
|
|
49
|
-
${keyExamples.trim()}
|
|
50
|
-
`;
|
|
51
|
-
async function run(cmdObj) {
|
|
52
|
-
const options = cmdObj.parseOptions({
|
|
53
|
-
params: ["--base", "--head"],
|
|
54
|
-
booleans: ["--from-live-version"],
|
|
55
|
-
});
|
|
56
|
-
if (cmdObj.help || options.args.length < 1)
|
|
57
|
-
printUsageAndExit(usage);
|
|
58
|
-
const baseSha = options.options["--base"]?.toString();
|
|
59
|
-
const headSha = options.options["--head"]?.toString();
|
|
60
|
-
const fromLiveVersion = Boolean(options.options["--from-live-version"]);
|
|
61
|
-
const commonOpts = {
|
|
62
|
-
baseSha,
|
|
63
|
-
headSha,
|
|
64
|
-
fromLiveVersion,
|
|
65
|
-
monorepoEnv: cmdObj.env,
|
|
66
|
-
};
|
|
67
|
-
const [cmd, imageOrWorkspace] = options.args;
|
|
68
|
-
const params = new StrongParams(usage, { imageOrWorkspace });
|
|
69
|
-
switch (cmd) {
|
|
70
|
-
case "list-images": {
|
|
71
|
-
console.log(findImagesAffected(commonOpts).join("\n"));
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
case "workspace": {
|
|
75
|
-
// prettier-ignore
|
|
76
|
-
const affected = isWorkspaceAffected(params.required("imageOrWorkspace"), commonOpts);
|
|
77
|
-
console.log(affected ? "true" : "false");
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
case "image": {
|
|
81
|
-
const affected = isImageAffected(params.required("imageOrWorkspace"), commonOpts);
|
|
82
|
-
console.log(affected ? "true" : "false");
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
case "find-migrator": {
|
|
86
|
-
const migrator = findImagesWithAffectedWorkspace("db", commonOpts);
|
|
87
|
-
if (!migrator.length)
|
|
88
|
-
break;
|
|
89
|
-
const firstMigrator = migrator.find(imageName => getImageData(imageName)["can-db-migrate"]);
|
|
90
|
-
if (!firstMigrator) {
|
|
91
|
-
console.error(`The db project was changed and affects the following images: ${migrator.join(", ")}. However, no image in the list has can-db-migrate=true in .devops/config/images.yaml.`);
|
|
92
|
-
process.exit(1);
|
|
93
|
-
}
|
|
94
|
-
console.log(firstMigrator);
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
default:
|
|
98
|
-
printUsageAndExit(usage);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
export const affected = { oneLiner, keyExamples, run };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CLICommandParser } from "../common";
|
|
2
|
-
declare function run(cmdObj: CLICommandParser): Promise<void>;
|
|
3
|
-
export declare const cloudrun: {
|
|
4
|
-
oneLiner: string;
|
|
5
|
-
keyExamples: string;
|
|
6
|
-
run: typeof run;
|
|
7
|
-
};
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=cloudrun.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cloudrun.d.ts","sourceRoot":"","sources":["../../../src/cli/core/cloudrun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,WAAW,CAAC;AA6E9E,iBAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,iBAmD1C;AAED,eAAO,MAAM,QAAQ;;;;CAAiC,CAAC"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { CLICommandParser, printUsageAndExit, StrongParams } from "../common";
|
|
2
|
-
import { buildDev, deploy } from "../../libs/cloudrun-helpers";
|
|
3
|
-
const oneLiner = "Supports cloudrun images";
|
|
4
|
-
const keyExamples = `
|
|
5
|
-
$ devops cloudrun deploy cloudrun-image SHA --env staging --region us-east1 [--forward-env ENV1,ENV2 --allow-unauthenticated]
|
|
6
|
-
$ devops cloudrun build-dev cloudrun-image
|
|
7
|
-
`.trim();
|
|
8
|
-
const usage = `
|
|
9
|
-
${oneLiner}
|
|
10
|
-
|
|
11
|
-
USAGE
|
|
12
|
-
Configuration prerequisites:
|
|
13
|
-
- The image should be defined in images.yaml with:
|
|
14
|
-
cloudrun: true
|
|
15
|
-
- The artifact registry URL should be set in config/constants.yaml:
|
|
16
|
-
cloudrun-artifact-registry-repo-path: REGION-docker.pkg.dev/PROJECT_ID/REPO
|
|
17
|
-
|
|
18
|
-
Deploy a cloudrun image to Cloud Run:
|
|
19
|
-
devops cloudrun deploy <image> <sha> --env <env> --region <region> [options]
|
|
20
|
-
|
|
21
|
-
Options:
|
|
22
|
-
--forward-env ENV1,ENV2 Comma-separated env var names to forward into the service
|
|
23
|
-
--allow-unauthenticated Allow unauthenticated access
|
|
24
|
-
--cpu <cpu> CPU, e.g. 0.25, 0.5, 1
|
|
25
|
-
--memory <mem> Memory, e.g. 256Mi, 512Mi, 1Gi
|
|
26
|
-
--min-instances <n> Minimum instances
|
|
27
|
-
--max-instances <n> Maximum instances
|
|
28
|
-
--timeout <time> Request timeout, e.g. 60s
|
|
29
|
-
-- Pass through additional args to gcloud (e.g. -- --ingress internal)
|
|
30
|
-
|
|
31
|
-
Notes:
|
|
32
|
-
- The image must already be pushed to the artifact registry.
|
|
33
|
-
- <env> also supports local environments (e.g. development).
|
|
34
|
-
- For remote monorepo environments, variables specified in --forward-env that
|
|
35
|
-
are not present in the current process's env are fetched from the cluster.
|
|
36
|
-
|
|
37
|
-
Build a cloudrun image locally in development environment:
|
|
38
|
-
devops cloudrun build-dev cloudrun-image
|
|
39
|
-
|
|
40
|
-
This command builds the image locally with a random SHA and pushes it to the artifact registry.
|
|
41
|
-
|
|
42
|
-
EXAMPLES
|
|
43
|
-
${keyExamples}
|
|
44
|
-
`;
|
|
45
|
-
const handlers = {
|
|
46
|
-
"build-dev": (opts) => {
|
|
47
|
-
buildDev(opts.required("image"));
|
|
48
|
-
},
|
|
49
|
-
_deploy: (opts) => {
|
|
50
|
-
const rawForwardEnv = opts.optional("forwardEnv");
|
|
51
|
-
const forwardEnv = rawForwardEnv
|
|
52
|
-
? rawForwardEnv.split(",").map(v => v.trim()).filter(Boolean)
|
|
53
|
-
: [];
|
|
54
|
-
const minInstancesStr = opts.optional("minInstances");
|
|
55
|
-
const maxInstancesStr = opts.optional("maxInstances");
|
|
56
|
-
deploy({
|
|
57
|
-
image: opts.required("image"),
|
|
58
|
-
env: opts.required("env"),
|
|
59
|
-
sha: opts.required("sha"),
|
|
60
|
-
region: opts.required("region"),
|
|
61
|
-
forwardEnv,
|
|
62
|
-
allowUnauthenticated: opts.optional("allowUnauthenticated") === "true",
|
|
63
|
-
cpu: opts.optional("cpu"),
|
|
64
|
-
memory: opts.optional("memory"),
|
|
65
|
-
minInstances: minInstancesStr ? Number(minInstancesStr) : undefined,
|
|
66
|
-
maxInstances: maxInstancesStr ? Number(maxInstancesStr) : undefined,
|
|
67
|
-
timeout: opts.optional("timeout"),
|
|
68
|
-
extraArgs: opts.optional("extraArgs"),
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
async function run(cmdObj) {
|
|
73
|
-
if (cmdObj.help || cmdObj.args.length === 0)
|
|
74
|
-
printUsageAndExit(usage);
|
|
75
|
-
const parsed = cmdObj.parseOptions({
|
|
76
|
-
params: [
|
|
77
|
-
"--keep-last",
|
|
78
|
-
"--forward-env",
|
|
79
|
-
"--region",
|
|
80
|
-
"--cpu",
|
|
81
|
-
"--memory",
|
|
82
|
-
"--min-instances",
|
|
83
|
-
"--max-instances",
|
|
84
|
-
"--timeout",
|
|
85
|
-
"--sha",
|
|
86
|
-
],
|
|
87
|
-
booleans: ["--allow-unauthenticated"],
|
|
88
|
-
passthroughArgs: true,
|
|
89
|
-
});
|
|
90
|
-
const [subcommand, image, sha] = parsed.args;
|
|
91
|
-
// Inject env variables as forwarding is needed
|
|
92
|
-
if (subcommand === "deploy") {
|
|
93
|
-
cmdObj.executorFromEnv(`devops cloudrun _deploy ${cmdObj.args.slice(1).join(" ")}`, { checkEnvYaml: false }).spawn();
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const handler = handlers[subcommand];
|
|
97
|
-
if (!handler) {
|
|
98
|
-
console.error(`Unknown subcommand: ${subcommand}`);
|
|
99
|
-
printUsageAndExit(usage);
|
|
100
|
-
}
|
|
101
|
-
const params = new StrongParams(usage, {
|
|
102
|
-
env: cmdObj.env,
|
|
103
|
-
subcommand,
|
|
104
|
-
image,
|
|
105
|
-
sha,
|
|
106
|
-
keepLast: parsed.options["--keep-last"],
|
|
107
|
-
forwardEnv: parsed.options["--forward-env"],
|
|
108
|
-
region: parsed.options["--region"],
|
|
109
|
-
allowUnauthenticated: parsed.options["--allow-unauthenticated"] ? "true" : undefined,
|
|
110
|
-
cpu: parsed.options["--cpu"],
|
|
111
|
-
memory: parsed.options["--memory"],
|
|
112
|
-
minInstances: parsed.options["--min-instances"],
|
|
113
|
-
maxInstances: parsed.options["--max-instances"],
|
|
114
|
-
timeout: parsed.options["--timeout"],
|
|
115
|
-
extraArgs: parsed.passthrough ? parsed.passthrough.join(" ") : undefined,
|
|
116
|
-
});
|
|
117
|
-
handler(params);
|
|
118
|
-
}
|
|
119
|
-
export const cloudrun = { oneLiner, keyExamples, run };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CLICommandParser } from "../common";
|
|
2
|
-
declare function run(cmdObj: CLICommandParser): void;
|
|
3
|
-
export declare const consoleCommand: {
|
|
4
|
-
command: string;
|
|
5
|
-
oneLiner: string;
|
|
6
|
-
keyExamples: string;
|
|
7
|
-
run: typeof run;
|
|
8
|
-
};
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=console.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../src/cli/core/console.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAsC,MAAM,WAAW,CAAC;AAsBjF,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QA2BpC;AAMD,eAAO,MAAM,cAAc;;;;;CAAqD,CAAC"}
|
package/dist/cli/core/console.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { generateDebugPod } from "../../libs/k8s-generate";
|
|
2
|
-
import { kubectlCommand } from "../../libs/k8s-helpers";
|
|
3
|
-
import { getImageVersion } from "../../libs/k8s-image-config";
|
|
4
|
-
import { CLICommandParser, CommandExecutor, printUsageAndExit } from "../common";
|
|
5
|
-
import yaml from "yaml";
|
|
6
|
-
const oneLiner = "Spin up a debug pod of the specified image and get a shell into it.";
|
|
7
|
-
const keyExamples = `
|
|
8
|
-
$ devops console main-node
|
|
9
|
-
`.trim();
|
|
10
|
-
const usage = `
|
|
11
|
-
${oneLiner}
|
|
12
|
-
|
|
13
|
-
USAGE
|
|
14
|
-
devops console <image> [--version <version>]
|
|
15
|
-
|
|
16
|
-
Options:
|
|
17
|
-
--version <version> The version (git SHA) of the image to use.
|
|
18
|
-
If not specified, the live version of the image (obtained using 'devops image version get <image>') is used.
|
|
19
|
-
|
|
20
|
-
EXAMPLES
|
|
21
|
-
${keyExamples}
|
|
22
|
-
`;
|
|
23
|
-
function run(cmdObj) {
|
|
24
|
-
if (cmdObj.help || cmdObj.args.length === 0)
|
|
25
|
-
printUsageAndExit(usage);
|
|
26
|
-
const parsed = cmdObj.parseOptions({ params: ["--version"] });
|
|
27
|
-
if (parsed.args.length !== 1)
|
|
28
|
-
printUsageAndExit(usage);
|
|
29
|
-
const image = parsed.args[0];
|
|
30
|
-
const version = parsed.options["--version"];
|
|
31
|
-
const gitSha = version ?? getImageVersion(cmdObj.env, image);
|
|
32
|
-
if (!gitSha) {
|
|
33
|
-
console.error(`No git SHA found for image ${image} in environment ${cmdObj.env}`);
|
|
34
|
-
process.exit(1);
|
|
35
|
-
}
|
|
36
|
-
const debugYaml = generateDebugPod(cmdObj.env, image, gitSha);
|
|
37
|
-
if (!debugYaml) {
|
|
38
|
-
console.error(`The image ${image} does not specify debug-template in images.yaml`);
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
const userName = new CommandExecutor(`kubectl auth whoami -o jsonpath='{.status.userInfo.username}'`).exec();
|
|
42
|
-
const debugManifestsJson = JSON.stringify(yaml.parse(debugYaml));
|
|
43
|
-
const randomId = Math.random().toString(36).substring(2, 10);
|
|
44
|
-
const podName = ['ephemeral-console', slugify(userName), slugify(image), randomId].filter(Boolean).join('-');
|
|
45
|
-
new CommandExecutor(kubectlCommand(`run ${podName} --restart=Never --rm -it --image=overridden --overrides='${debugManifestsJson}'`, { monorepoEnv: cmdObj.env })).spawn();
|
|
46
|
-
}
|
|
47
|
-
function slugify(str, maxLength = 20) {
|
|
48
|
-
return str.toLowerCase().trim().replace(/[^a-zA-Z0-9]/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '').slice(0, maxLength);
|
|
49
|
-
}
|
|
50
|
-
export const consoleCommand = { command: 'console', oneLiner, keyExamples, run };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CLICommandParser } from "../common";
|
|
2
|
-
declare function run(cmdObj: CLICommandParser): Promise<void>;
|
|
3
|
-
export declare const constant: {
|
|
4
|
-
oneLiner: string;
|
|
5
|
-
keyExamples: string;
|
|
6
|
-
run: typeof run;
|
|
7
|
-
};
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=constant.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../../src/cli/core/constant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,WAAW,CAAC;AAehE,iBAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,iBAI1C;AAED,eAAO,MAAM,QAAQ;;;;CAAiC,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { getConst } from "../../libs/config";
|
|
2
|
-
import { CLICommandParser, printUsageAndExit } from "../common";
|
|
3
|
-
const oneLiner = "Prints to stdout a constant from constant.yaml";
|
|
4
|
-
const keyExamples = `$ devops constant infra`;
|
|
5
|
-
const usage = `
|
|
6
|
-
${oneLiner}
|
|
7
|
-
|
|
8
|
-
GENERAL USAGE
|
|
9
|
-
devops constant <constant-name>
|
|
10
|
-
|
|
11
|
-
EXAMPLES
|
|
12
|
-
${keyExamples}
|
|
13
|
-
`;
|
|
14
|
-
async function run(cmdObj) {
|
|
15
|
-
if (cmdObj.help || cmdObj.args.length === 0)
|
|
16
|
-
printUsageAndExit(usage);
|
|
17
|
-
const [constant] = cmdObj.args;
|
|
18
|
-
console.log(getConst(constant));
|
|
19
|
-
}
|
|
20
|
-
export const constant = { oneLiner, keyExamples, run };
|
package/dist/cli/core/env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/cli/core/env.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,gBAAgB,EAGjB,MAAM,WAAW,CAAC;AAwBnB,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QA+CpC;AAED,eAAO,MAAM,GAAG;;;;CAAiC,CAAC"}
|
package/dist/cli/core/env.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { deleteMonorepoSecret, getMonorepoSecretStr, setMonorepoSecret, } from "../../libs/k8s-secrets-manager";
|
|
2
|
-
import { CombinedEnvValidator } from "../../libs/validate-env";
|
|
3
|
-
import { globEnvYamlFiles } from "../../libs/discovery";
|
|
4
|
-
import { CLICommandParser, dotEnvFilesForEnv, printUsageAndExit, } from "../common";
|
|
5
|
-
const oneLiner = "Commands to manipulate env variables";
|
|
6
|
-
const keyExamples = `
|
|
7
|
-
$ devops env get --env staging
|
|
8
|
-
$ devops env get KEY1 KEY2 --env staging
|
|
9
|
-
$ devops env set KEY1=123 KEY2=345 --env staging
|
|
10
|
-
$ devops env delete KEY1 KEY2 --env staging
|
|
11
|
-
$ devops env validate
|
|
12
|
-
`;
|
|
13
|
-
const usage = `
|
|
14
|
-
${oneLiner}
|
|
15
|
-
|
|
16
|
-
COMMANDS
|
|
17
|
-
get Fetches secrets for the chosen environment and printes them to console
|
|
18
|
-
set Sets specific secrets for the chosen environment
|
|
19
|
-
delete Deletes specific secrets for the chosen environment
|
|
20
|
-
validate Validate locally, verifying the existence and type of environment variables against all env.yaml files
|
|
21
|
-
|
|
22
|
-
EXAMPLES
|
|
23
|
-
${keyExamples}
|
|
24
|
-
`;
|
|
25
|
-
function run(cmdObj) {
|
|
26
|
-
if (cmdObj.help || cmdObj.args.length === 0)
|
|
27
|
-
printUsageAndExit(usage);
|
|
28
|
-
const [command, ...rest] = cmdObj.args;
|
|
29
|
-
switch (command) {
|
|
30
|
-
case "validate": {
|
|
31
|
-
const envYamlFiles = globEnvYamlFiles();
|
|
32
|
-
// We have to have a _validate so that we go through a CommandExecutor which injects env variables into the process
|
|
33
|
-
cmdObj
|
|
34
|
-
.executorFromEnv(`devops env _validate ${envYamlFiles.join(" ")}`, { quiet: false })
|
|
35
|
-
.exec();
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
case "_validate": {
|
|
39
|
-
const options = cmdObj.parseOptions({ booleans: ["--skip-dotenv"] });
|
|
40
|
-
const [_subcmd, ...envYamlFiles] = options.args;
|
|
41
|
-
const envFiles = options.options["--skip-dotenv"]
|
|
42
|
-
? []
|
|
43
|
-
: dotEnvFilesForEnv(cmdObj.env);
|
|
44
|
-
const validator = new CombinedEnvValidator(envYamlFiles, envFiles);
|
|
45
|
-
validator.validate();
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
case "get": {
|
|
49
|
-
console.log(getMonorepoSecretStr(cmdObj.env, rest));
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
case "set": {
|
|
53
|
-
setMonorepoSecret(cmdObj.env, rest);
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
case "delete": {
|
|
57
|
-
deleteMonorepoSecret(cmdObj.env, rest);
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
default: {
|
|
61
|
-
printUsageAndExit(usage);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
export const env = { oneLiner, keyExamples, run };
|
package/dist/cli/core/exec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../../src/cli/core/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAsC,MAAM,WAAW,CAAC;AA4BjF,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAwBpC;AAED,eAAO,MAAM,IAAI;;;;CAAiC,CAAC"}
|
package/dist/cli/core/exec.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { CLICommandParser, CommandExecutor, printUsageAndExit } from "../common";
|
|
2
|
-
import url from "url";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { getWorkspace } from "../../libs/discovery";
|
|
5
|
-
const __file__ = url.fileURLToPath(import.meta.url);
|
|
6
|
-
const __cli__ = path.join(path.dirname(__file__), "../..", "cli");
|
|
7
|
-
const execShPath = path.join(__cli__, "exec.sh");
|
|
8
|
-
const oneLiner = "Executes a command after injecting env variables, either globally or in a workspace";
|
|
9
|
-
const keyExamples = `
|
|
10
|
-
$ devops exec tmp/test.sh
|
|
11
|
-
$ devops exec bun test.ts --in myworkspace --env staging
|
|
12
|
-
`.trim();
|
|
13
|
-
const usage = `
|
|
14
|
-
${oneLiner}
|
|
15
|
-
|
|
16
|
-
USAGE
|
|
17
|
-
devops exec <command>
|
|
18
|
-
devops exec --in <workspace> <command>
|
|
19
|
-
devops exec --in <workspace> <command> --interactive
|
|
20
|
-
|
|
21
|
-
EXAMPLES
|
|
22
|
-
${keyExamples}
|
|
23
|
-
`;
|
|
24
|
-
function run(cmdObj) {
|
|
25
|
-
if (cmdObj.help || cmdObj.args.length === 0)
|
|
26
|
-
printUsageAndExit(usage);
|
|
27
|
-
const parsed = cmdObj.parseOptions({
|
|
28
|
-
params: ["--in"],
|
|
29
|
-
booleans: ["--interactive"],
|
|
30
|
-
});
|
|
31
|
-
const workspace = parsed.options["--in"];
|
|
32
|
-
let executor;
|
|
33
|
-
if (workspace) {
|
|
34
|
-
const rootPath = getWorkspace(workspace).rootPath;
|
|
35
|
-
executor = cmdObj.executorFromEnv(`${execShPath} ${rootPath} ${parsed.argsStr}`, { checkEnvYaml: true });
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
executor = cmdObj.executorFromEnv(parsed.argsStr, { checkEnvYaml: true });
|
|
39
|
-
}
|
|
40
|
-
const interactive = Boolean(parsed.options["--interactive"]);
|
|
41
|
-
if (interactive) {
|
|
42
|
-
executor.spawn();
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
executor.exec();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
export const exec = { oneLiner, keyExamples, run };
|
package/dist/cli/core/image.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CLICommandParser } from "../../../src/cli/common";
|
|
2
|
-
declare function run(cmdObj: CLICommandParser): void;
|
|
3
|
-
export declare const image: {
|
|
4
|
-
oneLiner: string;
|
|
5
|
-
keyExamples: string;
|
|
6
|
-
run: typeof run;
|
|
7
|
-
};
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=image.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/cli/core/image.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,yBAAyB,CAAC;AA6K5F,iBAAS,GAAG,CAAC,MAAM,EAAE,gBAAgB,QAgCpC;AAED,eAAO,MAAM,KAAK;;;;CAAiC,CAAC"}
|