@catladder/pipeline 0.0.0-refactor-docker-de6b3576 → 0.0.0-refactor-docker-427f63d6
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/build/node/buildJob.js +1 -1
- package/dist/bundles/catladder-gitlab/index.js +17 -7
- package/dist/constants.js +1 -1
- package/dist/pipeline/generatePipelineFiles.js +15 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/examples/__snapshots__/cloud-run-storybook.ts.snap +1687 -0
- package/examples/cloud-run-storybook.ts +24 -0
- package/package.json +1 -1
- package/src/build/node/buildJob.ts +3 -1
- package/src/pipeline/generatePipelineFiles.ts +20 -11
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Config } from "../src";
|
|
2
|
+
import { createAllPipelines } from "./__utils__/helpers";
|
|
3
|
+
|
|
4
|
+
const config: Config = {
|
|
5
|
+
appName: "test-app",
|
|
6
|
+
customerName: "pan",
|
|
7
|
+
components: {
|
|
8
|
+
api: {
|
|
9
|
+
dir: "app",
|
|
10
|
+
build: {
|
|
11
|
+
type: "storybook",
|
|
12
|
+
},
|
|
13
|
+
deploy: {
|
|
14
|
+
type: "google-cloudrun",
|
|
15
|
+
projectId: "asdf",
|
|
16
|
+
region: "asia-east1",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
it("matches snapshot", async () => {
|
|
23
|
+
expect(await createAllPipelines(config)).toMatchSnapshot();
|
|
24
|
+
});
|
package/package.json
CHANGED
|
@@ -59,7 +59,9 @@ export const createNodeBuildJobs = (context: Context): CatladderJob[] => {
|
|
|
59
59
|
dockerBuild: {
|
|
60
60
|
script: getDockerBuildScriptWithBuiltInDockerFile(
|
|
61
61
|
context,
|
|
62
|
-
buildConfig.type === "node-static"
|
|
62
|
+
buildConfig.type === "node-static" || buildConfig.type === "storybook"
|
|
63
|
+
? "nginx"
|
|
64
|
+
: "node",
|
|
63
65
|
),
|
|
64
66
|
cache: [...getYarnCache(context, "pull")],
|
|
65
67
|
variables: {
|
|
@@ -11,19 +11,28 @@ export async function generatePipelineFiles<T extends PipelineType>(
|
|
|
11
11
|
if (mode === "childpipeline") {
|
|
12
12
|
const trigger = getPipelineTriggerForGitlabChildPipeline();
|
|
13
13
|
|
|
14
|
-
const { jobs, ...mainPipeline } =
|
|
15
|
-
pipelineType,
|
|
16
|
-
trigger,
|
|
17
|
-
config,
|
|
18
|
-
);
|
|
14
|
+
const { jobs, image, stages, variables, workflow, ...mainPipeline } =
|
|
15
|
+
await createChildPipeline(pipelineType, trigger, config);
|
|
19
16
|
// need to spread out the jobs, forgot why
|
|
20
|
-
await writeYamlfile(`__pipeline.yml`, {
|
|
17
|
+
await writeYamlfile(`__pipeline.yml`, {
|
|
18
|
+
image,
|
|
19
|
+
stages,
|
|
20
|
+
variables,
|
|
21
|
+
workflow,
|
|
22
|
+
...mainPipeline,
|
|
23
|
+
...jobs,
|
|
24
|
+
});
|
|
21
25
|
} else {
|
|
22
|
-
const { jobs, ...mainPipeline } =
|
|
23
|
-
pipelineType,
|
|
24
|
-
config,
|
|
25
|
-
);
|
|
26
|
+
const { jobs, image, stages, variables, workflow, ...mainPipeline } =
|
|
27
|
+
await createMainPipeline(pipelineType, config);
|
|
26
28
|
// need to spread out the jobs, forgot why
|
|
27
|
-
await writeYamlfile(`.gitlab-ci.yml`, {
|
|
29
|
+
await writeYamlfile(`.gitlab-ci.yml`, {
|
|
30
|
+
image,
|
|
31
|
+
stages,
|
|
32
|
+
variables,
|
|
33
|
+
workflow,
|
|
34
|
+
...mainPipeline,
|
|
35
|
+
...jobs,
|
|
36
|
+
});
|
|
28
37
|
}
|
|
29
38
|
}
|