@catladder/pipeline 3.35.0 → 3.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/constants.js +1 -1
  2. package/dist/deploy/base/deploy.js +7 -4
  3. package/dist/deploy/base/stop.js +0 -5
  4. package/dist/tsconfig.tsbuildinfo +1 -1
  5. package/examples/__snapshots__/automatic-releases.test.ts.snap +0 -8
  6. package/examples/__snapshots__/cloud-run-execute-script-on-deploy.test.ts.snap +0 -8
  7. package/examples/__snapshots__/cloud-run-existing-image.test.ts.snap +657 -0
  8. package/examples/__snapshots__/cloud-run-health-check-defaults.test.ts.snap +0 -8
  9. package/examples/__snapshots__/cloud-run-health-check-only-startup.test.ts.snap +0 -8
  10. package/examples/__snapshots__/cloud-run-health-check.test.ts.snap +0 -8
  11. package/examples/__snapshots__/cloud-run-http2.test.ts.snap +0 -8
  12. package/examples/__snapshots__/cloud-run-llama.test.ts.snap +0 -8
  13. package/examples/__snapshots__/cloud-run-memory-limit.test.ts.snap +0 -8
  14. package/examples/__snapshots__/cloud-run-meteor-with-worker.test.ts.snap +0 -8
  15. package/examples/__snapshots__/cloud-run-nextjs.test.ts.snap +0 -8
  16. package/examples/__snapshots__/cloud-run-no-cpu-throttling.test.ts.snap +0 -8
  17. package/examples/__snapshots__/cloud-run-no-service.test.ts.snap +0 -8
  18. package/examples/__snapshots__/cloud-run-non-public.test.ts.snap +0 -8
  19. package/examples/__snapshots__/cloud-run-post-stop-job.test.ts.snap +0 -8
  20. package/examples/__snapshots__/cloud-run-service-custom-vpc-connector.test.ts.snap +0 -8
  21. package/examples/__snapshots__/cloud-run-service-custom-vpc.test.ts.snap +0 -8
  22. package/examples/__snapshots__/cloud-run-service-gen2.test.ts.snap +0 -8
  23. package/examples/__snapshots__/cloud-run-service-increase-timout.test.ts.snap +0 -8
  24. package/examples/__snapshots__/cloud-run-service-with-volumes.test.ts.snap +0 -8
  25. package/examples/__snapshots__/cloud-run-storybook.test.ts.snap +0 -8
  26. package/examples/__snapshots__/cloud-run-with-agents.test.ts.snap +0 -8
  27. package/examples/__snapshots__/cloud-run-with-gpu.test.ts.snap +0 -8
  28. package/examples/__snapshots__/cloud-run-with-ngnix.test.ts.snap +0 -8
  29. package/examples/__snapshots__/cloud-run-with-sql-legacy-jobs.test.ts.snap +0 -8
  30. package/examples/__snapshots__/cloud-run-with-sql-multiple-dbs.test.ts.snap +0 -24
  31. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +0 -16
  32. package/examples/__snapshots__/cloud-run-with-sql.test.ts.snap +0 -8
  33. package/examples/__snapshots__/cloud-run-with-worker.test.ts.snap +0 -8
  34. package/examples/__snapshots__/custom-build-job-with-tests.test.ts.snap +0 -8
  35. package/examples/__snapshots__/custom-build-job.test.ts.snap +0 -8
  36. package/examples/__snapshots__/custom-deploy.test.ts.snap +0 -2
  37. package/examples/__snapshots__/custom-docker-file.test.ts.snap +0 -8
  38. package/examples/__snapshots__/custom-sbom-java.test.ts.snap +0 -8
  39. package/examples/__snapshots__/custom-verify-job.test.ts.snap +0 -8
  40. package/examples/__snapshots__/git-submodule.test.ts.snap +0 -8
  41. package/examples/__snapshots__/kubernetes-application-customization.test.ts.snap +0 -8
  42. package/examples/__snapshots__/kubernetes-with-cloud-sql.test.ts.snap +0 -8
  43. package/examples/__snapshots__/kubernetes-with-jobs.test.ts.snap +0 -16
  44. package/examples/__snapshots__/kubernetes-with-mongodb.test.ts.snap +0 -8
  45. package/examples/__snapshots__/local-dot-env.test.ts.snap +0 -8
  46. package/examples/__snapshots__/meteor-kubernetes.test.ts.snap +0 -8
  47. package/examples/__snapshots__/multiline-var.test.ts.snap +0 -24
  48. package/examples/__snapshots__/native-app.test.ts.snap +0 -8
  49. package/examples/__snapshots__/node-build-with-custom-image.test.ts.snap +0 -8
  50. package/examples/__snapshots__/node-build-with-docker-additions.test.ts.snap +0 -8
  51. package/examples/__snapshots__/override-secrets.test.ts.snap +0 -8
  52. package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +0 -8
  53. package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +0 -8
  54. package/examples/__snapshots__/referencing-other-vars.test.ts.snap +0 -24
  55. package/examples/__snapshots__/workspace-api-www-turbo-cache.test.ts.snap +0 -16
  56. package/examples/__snapshots__/workspace-api-www.test.ts.snap +0 -16
  57. package/examples/cloud-run-existing-image.test.ts +12 -0
  58. package/examples/cloud-run-existing-image.ts +26 -0
  59. package/package.json +1 -1
  60. package/src/deploy/base/deploy.ts +37 -32
  61. package/src/deploy/base/stop.ts +0 -6
@@ -913,8 +913,6 @@ before_script:
913
913
  name: dev/api
914
914
  action: stop
915
915
  rules:
916
- - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
917
- when: on_success
918
916
  - when: never
919
917
  if: $CI_PIPELINE_SOURCE == "trigger"
920
918
  - when: manual
@@ -1148,8 +1146,6 @@ before_script:
1148
1146
  name: review/$CI_COMMIT_REF_NAME/api
1149
1147
  action: stop
1150
1148
  rules:
1151
- - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
1152
- when: on_success
1153
1149
  - when: never
1154
1150
  if: $CI_PIPELINE_SOURCE == "trigger"
1155
1151
  - when: manual
@@ -1368,8 +1364,6 @@ before_script:
1368
1364
  name: stage/api
1369
1365
  action: stop
1370
1366
  rules:
1371
- - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
1372
- when: on_success
1373
1367
  - when: never
1374
1368
  if: $CI_PIPELINE_SOURCE == "trigger"
1375
1369
  - when: manual
@@ -1588,8 +1582,6 @@ before_script:
1588
1582
  name: prod/api
1589
1583
  action: stop
1590
1584
  rules:
1591
- - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
1592
- when: on_success
1593
1585
  - when: never
1594
1586
  if: $CI_PIPELINE_SOURCE == "trigger"
1595
1587
  - when: manual
@@ -1818,8 +1810,6 @@ before_script:
1818
1810
  name: dev/www
1819
1811
  action: stop
1820
1812
  rules:
1821
- - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
1822
- when: on_success
1823
1813
  - when: never
1824
1814
  if: $CI_PIPELINE_SOURCE == "trigger"
1825
1815
  - when: manual
@@ -2056,8 +2046,6 @@ before_script:
2056
2046
  name: review/$CI_COMMIT_REF_NAME/www
2057
2047
  action: stop
2058
2048
  rules:
2059
- - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
2060
- when: on_success
2061
2049
  - when: never
2062
2050
  if: $CI_PIPELINE_SOURCE == "trigger"
2063
2051
  - when: manual
@@ -2279,8 +2267,6 @@ before_script:
2279
2267
  name: stage/www
2280
2268
  action: stop
2281
2269
  rules:
2282
- - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
2283
- when: on_success
2284
2270
  - when: never
2285
2271
  if: $CI_PIPELINE_SOURCE == "trigger"
2286
2272
  - when: manual
@@ -2502,8 +2488,6 @@ before_script:
2502
2488
  name: prod/www
2503
2489
  action: stop
2504
2490
  rules:
2505
- - if: $CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/
2506
- when: on_success
2507
2491
  - when: never
2508
2492
  if: $CI_PIPELINE_SOURCE == "trigger"
2509
2493
  - when: manual
@@ -0,0 +1,12 @@
1
+ import { it, expect } from "vitest";
2
+ import { createYamlLocalPipeline } from "./__utils__/helpers";
3
+ import config from "./cloud-run-existing-image";
4
+
5
+ /**
6
+ * This test is auto-generated.
7
+ * Modifications will be overwritten on every `yarn test` run!
8
+ */
9
+
10
+ it("matches snapshot for cloud-run-existing-image local pipeline YAML", async () => {
11
+ expect(await createYamlLocalPipeline(config)).toMatchSnapshot();
12
+ });
@@ -0,0 +1,26 @@
1
+ import type { Config } from "../src";
2
+
3
+ const config = {
4
+ appName: "test-app",
5
+ customerName: "pan",
6
+ components: {
7
+ www: {
8
+ dir: "app",
9
+ build: false,
10
+ deploy: {
11
+ type: "google-cloudrun",
12
+ projectId: "google-project-id",
13
+ region: "europe-west6",
14
+ service: {
15
+ image: "gcr.io/google-project-id/my-image:latest",
16
+ },
17
+ },
18
+ },
19
+ },
20
+ } satisfies Config;
21
+
22
+ export default config;
23
+
24
+ export const information = {
25
+ title: "Cloud Run: With existing image",
26
+ };
package/package.json CHANGED
@@ -53,7 +53,7 @@
53
53
  }
54
54
  ],
55
55
  "license": "MIT",
56
- "version": "3.35.0",
56
+ "version": "3.36.1",
57
57
  "scripts": {
58
58
  "build:tsc": "yarn tsc",
59
59
  "build": "yarn build:compile && yarn build:inline-variables",
@@ -69,40 +69,45 @@ export const createDeployJob = (
69
69
  })) ?? [])
70
70
  : []),
71
71
  ],
72
- // we don't want to deploy when there is a broken test
73
- needsStages: [
74
- ...(componentContextHasWorkspaceBuild(context)
75
- ? hasDocker // docker build is per component,
76
- ? [
77
- // we don't need artifacts, but have to wait for the component build
78
- {
79
- stage: "build" as BaseStage,
80
- artifacts: false,
81
- },
82
- ]
83
- : [
84
- {
85
- // pick build artifacts from workspace build
86
- stage: "build" as BaseStage,
87
- artifacts: true,
88
- workspaceName: context.build.workspaceName,
89
- },
90
- ]
91
- : [
72
+
73
+ needsStages:
74
+ // if the build is disabled, we don't need to wait for it
75
+ context.build.type !== "disabled"
76
+ ? [
77
+ ...(componentContextHasWorkspaceBuild(context)
78
+ ? hasDocker // docker build is per component,
79
+ ? [
80
+ // we don't need artifacts, but have to wait for the component build
81
+ {
82
+ stage: "build" as BaseStage,
83
+ artifacts: false,
84
+ },
85
+ ]
86
+ : [
87
+ {
88
+ // pick build artifacts from workspace build
89
+ stage: "build" as BaseStage,
90
+ artifacts: true,
91
+ workspaceName: context.build.workspaceName,
92
+ },
93
+ ]
94
+ : [
95
+ {
96
+ stage: "build" as BaseStage,
97
+ artifacts: hasDocker ? false : true, // we asume that no-docker deployments need build artifacts,
98
+ },
99
+ ]),
100
+ // we don't want to deploy when there is a broken test
92
101
  {
93
- stage: "build" as BaseStage,
94
- artifacts: hasDocker ? false : true, // we asume that no-docker deployments need build artifacts,
102
+ stage: "test",
103
+ artifacts: false,
104
+ // use test from workspace build
105
+ workspaceName: componentContextHasWorkspaceBuild(context)
106
+ ? context.build.workspaceName
107
+ : undefined,
95
108
  },
96
- ]),
97
- {
98
- stage: "test",
99
- artifacts: false,
100
- // use test from workspace build
101
- workspaceName: componentContextHasWorkspaceBuild(context)
102
- ? context.build.workspaceName
103
- : undefined,
104
- },
105
- ],
109
+ ]
110
+ : [],
106
111
  when: whenDeploy === "auto" ? "on_success" : "manual",
107
112
 
108
113
  allow_failure: whenDeploy === "manual" ? true : false,
@@ -16,12 +16,6 @@ export const createStopJob = (
16
16
  needs: [], // can be executed even if the deploy job failed
17
17
  allow_failure: true,
18
18
  when: "manual", // stop is always manual
19
- rules: [
20
- {
21
- if: "$CI_COMMIT_BRANCH =~ /^[0-9]+\\.([0-9]+|x)\\.x$/", // automatic on hotfix branches
22
- when: "on_success",
23
- },
24
- ],
25
19
  variables: {
26
20
  ...context.environment.jobOnlyVars.deploy.envVars,
27
21
  ...jobDefinition.variables,