@catladder/pipeline 1.139.3 → 1.139.5

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,32 @@
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: "node",
12
+ },
13
+ deploy: {
14
+ type: "google-cloudrun",
15
+ projectId: "asdf",
16
+ region: "asia-east1",
17
+ service: false,
18
+ jobs: {
19
+ "alarm-clock": {
20
+ command: "./wake-up-call",
21
+ when: "schedule",
22
+ schedule: "0 7 0 0 1-5",
23
+ },
24
+ },
25
+ },
26
+ },
27
+ },
28
+ };
29
+
30
+ it("matches snapshot", async () => {
31
+ expect(await createAllPipelines(config)).toMatchSnapshot();
32
+ });
package/package.json CHANGED
@@ -52,7 +52,7 @@
52
52
  }
53
53
  ],
54
54
  "license": "MIT",
55
- "version": "1.139.3",
55
+ "version": "1.139.5",
56
56
  "scripts": {
57
57
  "build:tsc": "yarn tsc",
58
58
  "build": "yarn build:compile && yarn build:inline-variables && yarn build:bundle",
@@ -1,3 +1,4 @@
1
+ import { isOfDeployType } from "../deploy";
1
2
  import type { Config } from "../types/config";
2
3
 
3
4
  import type { CommitInfo, Environment } from "../types/context";
@@ -25,14 +26,20 @@ export const getEnvironment = async (
25
26
  );
26
27
 
27
28
  const envType = envContext.envType;
29
+ const deployConfig = config.components[componentName].deploy;
30
+
31
+ const gitlabEnvironment = {
32
+ name: envContext.gitlabEnvironmentName,
33
+ ...(!isOfDeployType(deployConfig, "google-cloudrun") ||
34
+ deployConfig.service !== false
35
+ ? { url: variables.url }
36
+ : {}),
37
+ };
28
38
 
29
39
  return {
30
40
  envType,
31
41
 
32
- gitlabEnvironment: {
33
- name: envContext.gitlabEnvironmentName,
34
- url: variables.url,
35
- },
42
+ gitlabEnvironment,
36
43
  fullName: envContext.fullName,
37
44
  slugPrefix: envContext.environmentSlugPrefix,
38
45
  slug: envContext.environmentSlug,
@@ -32,7 +32,7 @@ export type Environment = {
32
32
 
33
33
  gitlabEnvironment: {
34
34
  name: string;
35
- url: string;
35
+ url?: string;
36
36
  };
37
37
  shortName: string;
38
38
  slugPrefix: string;