@catladder/pipeline 3.35.0 → 3.36.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.
- package/dist/constants.js +1 -1
- package/dist/deploy/base/deploy.js +7 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/examples/__snapshots__/cloud-run-existing-image.test.ts.snap +665 -0
- package/examples/cloud-run-existing-image.test.ts +12 -0
- package/examples/cloud-run-existing-image.ts +26 -0
- package/package.json +1 -1
- package/src/deploy/base/deploy.ts +37 -32
|
@@ -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
|
@@ -69,40 +69,45 @@ export const createDeployJob = (
|
|
|
69
69
|
})) ?? [])
|
|
70
70
|
: []),
|
|
71
71
|
],
|
|
72
|
-
|
|
73
|
-
needsStages:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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: "
|
|
94
|
-
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,
|