@catladder/pipeline 1.117.2 → 1.119.0

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 (27) hide show
  1. package/dist/build/node/buildJob.js +8 -4
  2. package/dist/build/node/cache.js +3 -2
  3. package/dist/bundles/catladder-gitlab/index.js +1 -1
  4. package/dist/constants.js +1 -1
  5. package/dist/pipeline/packageManager.js +1 -0
  6. package/dist/tsconfig.tsbuildinfo +1 -1
  7. package/dist/types/context.d.ts +1 -0
  8. package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +4 -0
  9. package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +4 -0
  10. package/examples/__snapshots__/cloud-run-non-public.ts.snap +4 -0
  11. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +8 -0
  12. package/examples/__snapshots__/cloud-run-with-sql.ts.snap +8 -0
  13. package/examples/__snapshots__/custom-deploy.ts.snap +4 -0
  14. package/examples/__snapshots__/custom-envs.ts.snap +6 -0
  15. package/examples/__snapshots__/kubernetes-application-customization.ts.snap +4 -0
  16. package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +4 -0
  17. package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +4 -0
  18. package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +8 -0
  19. package/examples/__snapshots__/kubernetes-with-mongodb.ts.snap +4 -0
  20. package/examples/__snapshots__/native-app.ts.snap +8 -0
  21. package/examples/__snapshots__/node-build-with-custom-image.ts.snap +4 -0
  22. package/examples/__snapshots__/wait-for-other-deploy.ts.snap +8 -0
  23. package/package.json +1 -1
  24. package/src/build/node/buildJob.ts +12 -6
  25. package/src/build/node/cache.ts +3 -2
  26. package/src/pipeline/packageManager.ts +1 -0
  27. package/src/types/context.ts +1 -0
@@ -157,6 +157,7 @@ cloudsql:
157
157
  "reports": {
158
158
  "junit": undefined,
159
159
  },
160
+ "when": "always",
160
161
  },
161
162
  "cache": [
162
163
  {
@@ -845,6 +846,7 @@ cloudsql:
845
846
  "reports": {
846
847
  "junit": undefined,
847
848
  },
849
+ "when": "always",
848
850
  },
849
851
  "cache": [
850
852
  {
@@ -1588,6 +1590,7 @@ cloudsql:
1588
1590
  "reports": {
1589
1591
  "junit": undefined,
1590
1592
  },
1593
+ "when": "always",
1591
1594
  },
1592
1595
  "cache": [
1593
1596
  {
@@ -1666,6 +1669,7 @@ cloudsql:
1666
1669
  "reports": {
1667
1670
  "junit": undefined,
1668
1671
  },
1672
+ "when": "always",
1669
1673
  },
1670
1674
  "cache": [
1671
1675
  {
@@ -153,6 +153,7 @@ cronjobs:
153
153
  "reports": {
154
154
  "junit": undefined,
155
155
  },
156
+ "when": "always",
156
157
  },
157
158
  "cache": [
158
159
  {
@@ -748,6 +749,7 @@ application:
748
749
  "reports": {
749
750
  "junit": undefined,
750
751
  },
752
+ "when": "always",
751
753
  },
752
754
  "cache": [
753
755
  {
@@ -1405,6 +1407,7 @@ cronjobs: {}
1405
1407
  "reports": {
1406
1408
  "junit": undefined,
1407
1409
  },
1410
+ "when": "always",
1408
1411
  },
1409
1412
  "cache": [
1410
1413
  {
@@ -1994,6 +1997,7 @@ application:
1994
1997
  "reports": {
1995
1998
  "junit": undefined,
1996
1999
  },
2000
+ "when": "always",
1997
2001
  },
1998
2002
  "cache": [
1999
2003
  {
@@ -2705,6 +2709,7 @@ cronjobs:
2705
2709
  "reports": {
2706
2710
  "junit": undefined,
2707
2711
  },
2712
+ "when": "always",
2708
2713
  },
2709
2714
  "cache": [
2710
2715
  {
@@ -2781,6 +2786,7 @@ cronjobs:
2781
2786
  "reports": {
2782
2787
  "junit": undefined,
2783
2788
  },
2789
+ "when": "always",
2784
2790
  },
2785
2791
  "cache": [
2786
2792
  {
@@ -3649,6 +3655,7 @@ application:
3649
3655
  "reports": {
3650
3656
  "junit": undefined,
3651
3657
  },
3658
+ "when": "always",
3652
3659
  },
3653
3660
  "cache": [
3654
3661
  {
@@ -3725,6 +3732,7 @@ application:
3725
3732
  "reports": {
3726
3733
  "junit": undefined,
3727
3734
  },
3735
+ "when": "always",
3728
3736
  },
3729
3737
  "cache": [
3730
3738
  {
@@ -173,6 +173,7 @@ mongodb:
173
173
  "reports": {
174
174
  "junit": undefined,
175
175
  },
176
+ "when": "always",
176
177
  },
177
178
  "cache": [
178
179
  {
@@ -909,6 +910,7 @@ mongodb:
909
910
  "reports": {
910
911
  "junit": undefined,
911
912
  },
913
+ "when": "always",
912
914
  },
913
915
  "cache": [
914
916
  {
@@ -1716,6 +1718,7 @@ mongodb:
1716
1718
  "reports": {
1717
1719
  "junit": undefined,
1718
1720
  },
1721
+ "when": "always",
1719
1722
  },
1720
1723
  "cache": [
1721
1724
  {
@@ -1794,6 +1797,7 @@ mongodb:
1794
1797
  "reports": {
1795
1798
  "junit": undefined,
1796
1799
  },
1800
+ "when": "always",
1797
1801
  },
1798
1802
  "cache": [
1799
1803
  {
@@ -59,6 +59,7 @@ exports[`matches snapshot 1`] = `
59
59
  "reports": {
60
60
  "junit": undefined,
61
61
  },
62
+ "when": "always",
62
63
  },
63
64
  "cache": [
64
65
  {
@@ -516,6 +517,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
516
517
  "reports": {
517
518
  "junit": undefined,
518
519
  },
520
+ "when": "always",
519
521
  },
520
522
  "cache": [
521
523
  {
@@ -925,6 +927,7 @@ EOF",
925
927
  "reports": {
926
928
  "junit": undefined,
927
929
  },
930
+ "when": "always",
928
931
  },
929
932
  "cache": [
930
933
  {
@@ -1388,6 +1391,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
1388
1391
  "reports": {
1389
1392
  "junit": undefined,
1390
1393
  },
1394
+ "when": "always",
1391
1395
  },
1392
1396
  "cache": [
1393
1397
  {
@@ -1754,6 +1758,7 @@ EOF",
1754
1758
  "reports": {
1755
1759
  "junit": undefined,
1756
1760
  },
1761
+ "when": "always",
1757
1762
  },
1758
1763
  "cache": [
1759
1764
  {
@@ -1829,6 +1834,7 @@ EOF",
1829
1834
  "reports": {
1830
1835
  "junit": undefined,
1831
1836
  },
1837
+ "when": "always",
1832
1838
  },
1833
1839
  "cache": [
1834
1840
  {
@@ -2418,6 +2424,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
2418
2424
  "reports": {
2419
2425
  "junit": undefined,
2420
2426
  },
2427
+ "when": "always",
2421
2428
  },
2422
2429
  "cache": [
2423
2430
  {
@@ -2528,6 +2535,7 @@ EOF",
2528
2535
  "reports": {
2529
2536
  "junit": undefined,
2530
2537
  },
2538
+ "when": "always",
2531
2539
  },
2532
2540
  "cache": [
2533
2541
  {
@@ -59,6 +59,7 @@ exports[`matches snapshot 1`] = `
59
59
  "reports": {
60
60
  "junit": undefined,
61
61
  },
62
+ "when": "always",
62
63
  },
63
64
  "cache": [
64
65
  {
@@ -586,6 +587,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
586
587
  "reports": {
587
588
  "junit": undefined,
588
589
  },
590
+ "when": "always",
589
591
  },
590
592
  "cache": [
591
593
  {
@@ -1076,6 +1078,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
1076
1078
  "reports": {
1077
1079
  "junit": undefined,
1078
1080
  },
1081
+ "when": "always",
1079
1082
  },
1080
1083
  "cache": [
1081
1084
  {
@@ -1151,6 +1154,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
1151
1154
  "reports": {
1152
1155
  "junit": undefined,
1153
1156
  },
1157
+ "when": "always",
1154
1158
  },
1155
1159
  "cache": [
1156
1160
  {
@@ -59,6 +59,7 @@ exports[`matches snapshot 1`] = `
59
59
  "reports": {
60
60
  "junit": undefined,
61
61
  },
62
+ "when": "always",
62
63
  },
63
64
  "cache": [
64
65
  {
@@ -331,6 +332,7 @@ exports[`matches snapshot 1`] = `
331
332
  "reports": {
332
333
  "junit": undefined,
333
334
  },
335
+ "when": "always",
334
336
  },
335
337
  "cache": [
336
338
  {
@@ -679,6 +681,7 @@ exports[`matches snapshot 1`] = `
679
681
  "reports": {
680
682
  "junit": undefined,
681
683
  },
684
+ "when": "always",
682
685
  },
683
686
  "cache": [
684
687
  {
@@ -951,6 +954,7 @@ exports[`matches snapshot 1`] = `
951
954
  "reports": {
952
955
  "junit": undefined,
953
956
  },
957
+ "when": "always",
954
958
  },
955
959
  "cache": [
956
960
  {
@@ -1256,6 +1260,7 @@ exports[`matches snapshot 1`] = `
1256
1260
  "reports": {
1257
1261
  "junit": undefined,
1258
1262
  },
1263
+ "when": "always",
1259
1264
  },
1260
1265
  "cache": [
1261
1266
  {
@@ -1328,6 +1333,7 @@ exports[`matches snapshot 1`] = `
1328
1333
  "reports": {
1329
1334
  "junit": undefined,
1330
1335
  },
1336
+ "when": "always",
1331
1337
  },
1332
1338
  "cache": [
1333
1339
  {
@@ -1554,6 +1560,7 @@ exports[`matches snapshot 1`] = `
1554
1560
  "reports": {
1555
1561
  "junit": undefined,
1556
1562
  },
1563
+ "when": "always",
1557
1564
  },
1558
1565
  "cache": [
1559
1566
  {
@@ -1626,6 +1633,7 @@ exports[`matches snapshot 1`] = `
1626
1633
  "reports": {
1627
1634
  "junit": undefined,
1628
1635
  },
1636
+ "when": "always",
1629
1637
  },
1630
1638
  "cache": [
1631
1639
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@catladder/pipeline",
3
- "version": "1.117.2",
3
+ "version": "1.119.0",
4
4
  "scripts": {
5
5
  "build:tsc": "yarn tsc",
6
6
  "build": "yarn build:compile && yarn build:inline-variables && yarn build:bundle",
@@ -4,7 +4,7 @@ import type { Context } from "../../types/context";
4
4
  import type { CatladderJob } from "../../types/jobs";
5
5
  import { ensureArray } from "../../utils";
6
6
  import { createBuildJobs } from "../base";
7
- import { getDockerBuildDefaultScript, requiresDockerBuild } from "../docker";
7
+ import { getDockerBuildDefaultScript } from "../docker";
8
8
  import { isOfBuildType } from "../types";
9
9
  import { getNextCache, getNodeCache, getYarnCache } from "./cache";
10
10
  import { NODE_RUNNER_BUILD_VARIABLES } from "./constants";
@@ -39,14 +39,20 @@ export const createNodeBuildJobs = (context: Context): CatladderJob[] => {
39
39
  ],
40
40
  artifacts: {
41
41
  paths: [
42
- join(context.componentConfig.dir, "__build_info.json"),
43
- join(context.componentConfig.dir, "dist"),
44
- join(context.componentConfig.dir, ".next"),
42
+ context.componentConfig.dir,
43
+ // also copy workspace dependencies in monorepo if packages are shared and they create build artifacts
44
+ ...(context.packageManagerInfo?.currentWorkspaceDependencies ??
45
+ []),
46
+ ].flatMap((dir) => [
47
+ join(dir, "__build_info.json"),
48
+ join(dir, "dist"),
49
+ join(dir, ".next"),
45
50
  ...(buildConfig.artifactsPaths?.map((path) =>
46
- join(context.componentConfig.dir, path)
51
+ join(dir, path)
47
52
  ) ?? []),
48
- ],
53
+ ]),
49
54
  expire_in: "1 day",
55
+ when: "always",
50
56
  },
51
57
  jobTags: buildConfig.jobTags,
52
58
  }
@@ -2,6 +2,7 @@ import { join } from "path";
2
2
  import slugify from "slugify";
3
3
  import type { Context } from "../../types/context";
4
4
  import type { GitlabJobCache } from "../../types/gitlab-types";
5
+ import { uniq } from "lodash";
5
6
 
6
7
  export const getYarnCache = (
7
8
  context: Context,
@@ -42,12 +43,12 @@ export const getNodeModulesCache = (
42
43
  policy,
43
44
  paths: [
44
45
  ...(componentIsInWorkspace
45
- ? [
46
+ ? uniq([
46
47
  "node_modules",
47
48
  ...(context.packageManagerInfo?.workspaces.map((w) =>
48
49
  join(w.location, "node_modules")
49
50
  ) ?? []),
50
- ]
51
+ ])
51
52
  : [join(context.componentConfig.dir, "node_modules")]),
52
53
  ],
53
54
  },
@@ -59,6 +59,7 @@ export const getPackageManagerInfo = async (
59
59
  version,
60
60
  isClassic,
61
61
  currentWorkspace,
62
+ currentWorkspaceDependencies,
62
63
  componentIsInWorkspace,
63
64
  pathsToCopyInDocker,
64
65
  };
@@ -64,6 +64,7 @@ export type YarnPackageManagerInfo = {
64
64
  isClassic: boolean;
65
65
  componentIsInWorkspace: boolean;
66
66
  pathsToCopyInDocker: string[];
67
+ currentWorkspaceDependencies: string[];
67
68
  };
68
69
 
69
70
  export type PackageManagerInfo = YarnPackageManagerInfo;