@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.
@@ -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
@@ -52,7 +52,7 @@
52
52
  }
53
53
  ],
54
54
  "license": "MIT",
55
- "version": "0.0.0-refactor-docker-de6b3576",
55
+ "version": "0.0.0-refactor-docker-427f63d6",
56
56
  "stableVersion": "0.1.0",
57
57
  "scripts": {
58
58
  "build:tsc": "yarn tsc",
@@ -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" ? "nginx" : "node",
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 } = await createChildPipeline(
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`, { ...jobs, ...mainPipeline });
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 } = await createMainPipeline(
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`, { ...jobs, ...mainPipeline });
29
+ await writeYamlfile(`.gitlab-ci.yml`, {
30
+ image,
31
+ stages,
32
+ variables,
33
+ workflow,
34
+ ...mainPipeline,
35
+ ...jobs,
36
+ });
28
37
  }
29
38
  }