@tahminator/pipeline 1.0.25 → 1.0.27
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/pulumi/client.d.ts +9 -0
- package/dist/pulumi/client.js +20 -0
- package/dist/pulumi/index.d.ts +3 -0
- package/dist/pulumi/index.js +3 -0
- package/dist/pulumi/strategy/azure.d.ts +10 -0
- package/dist/pulumi/strategy/azure.js +36 -0
- package/dist/pulumi/strategy/index.d.ts +2 -0
- package/dist/pulumi/strategy/index.js +2 -0
- package/dist/pulumi/strategy/types.d.ts +5 -0
- package/dist/pulumi/strategy/types.js +0 -0
- package/dist/pulumi/types.d.ts +23 -0
- package/dist/pulumi/types.js +4 -0
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PreviewResult, UpResult } from "@pulumi/pulumi/automation";
|
|
2
|
+
import { type PulumiClientCreateArgs } from "./types";
|
|
3
|
+
export declare class PulumiClient {
|
|
4
|
+
private readonly strategy;
|
|
5
|
+
private constructor();
|
|
6
|
+
static create(args: PulumiClientCreateArgs): Promise<PulumiClient>;
|
|
7
|
+
up(): Promise<UpResult>;
|
|
8
|
+
preview(): Promise<PreviewResult>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AzurePulumiClientStrategy, } from "./strategy";
|
|
2
|
+
import { PulumiClientStrategy } from "./types";
|
|
3
|
+
export class PulumiClient {
|
|
4
|
+
strategy;
|
|
5
|
+
constructor(strategy) {
|
|
6
|
+
this.strategy = strategy;
|
|
7
|
+
}
|
|
8
|
+
static async create(args) {
|
|
9
|
+
switch (args.strategy) {
|
|
10
|
+
case PulumiClientStrategy.AZURE:
|
|
11
|
+
return new this(await AzurePulumiClientStrategy.create(args));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async up() {
|
|
15
|
+
return this.strategy.up();
|
|
16
|
+
}
|
|
17
|
+
async preview() {
|
|
18
|
+
return this.strategy.preview();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PreviewResult, type UpResult } from "@pulumi/pulumi/automation";
|
|
2
|
+
import type { PulumiClientAzureStrategy as PulumiClientAzureStrategyConfig } from "../types";
|
|
3
|
+
import type { IPulumiClientStrategy } from "./types";
|
|
4
|
+
export declare class AzurePulumiClientStrategy implements IPulumiClientStrategy {
|
|
5
|
+
private readonly stack;
|
|
6
|
+
private constructor();
|
|
7
|
+
static create(args: PulumiClientAzureStrategyConfig): Promise<AzurePulumiClientStrategy>;
|
|
8
|
+
up(): Promise<UpResult>;
|
|
9
|
+
preview(): Promise<PreviewResult>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LocalWorkspace, } from "@pulumi/pulumi/automation";
|
|
2
|
+
export class AzurePulumiClientStrategy {
|
|
3
|
+
stack;
|
|
4
|
+
constructor(stack) {
|
|
5
|
+
this.stack = stack;
|
|
6
|
+
}
|
|
7
|
+
static async create(args) {
|
|
8
|
+
const stack = await LocalWorkspace.createOrSelectStack({
|
|
9
|
+
stackName: args.stackName,
|
|
10
|
+
workDir: args.workDir,
|
|
11
|
+
}, {
|
|
12
|
+
envVars: {
|
|
13
|
+
ARM_CLIENT_ID: args.auth.clientId,
|
|
14
|
+
ARM_CLIENT_SECRET: args.auth.clientSecret,
|
|
15
|
+
ARM_TENANT_ID: args.auth.tenantId,
|
|
16
|
+
ARM_SUBSCRIPTION_ID: args.auth.subscriptionId,
|
|
17
|
+
PULUMI_BACKEND_URL: args.stateFile.azureStateLocation,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
return new AzurePulumiClientStrategy(stack);
|
|
21
|
+
}
|
|
22
|
+
async up() {
|
|
23
|
+
return this.stack.up({
|
|
24
|
+
color: "never",
|
|
25
|
+
diff: true,
|
|
26
|
+
refresh: true,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async preview() {
|
|
30
|
+
return this.stack.preview({
|
|
31
|
+
color: "never",
|
|
32
|
+
diff: true,
|
|
33
|
+
refresh: true,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LocalProgramArgs } from "@pulumi/pulumi/automation";
|
|
2
|
+
export declare enum PulumiClientStrategy {
|
|
3
|
+
AZURE = 1
|
|
4
|
+
}
|
|
5
|
+
export interface IPulumiClientStrategyArgs {
|
|
6
|
+
strategy: PulumiClientStrategy;
|
|
7
|
+
auth: Record<string, unknown>;
|
|
8
|
+
stateFile: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export interface PulumiClientAzureStrategy extends IPulumiClientStrategyArgs, LocalProgramArgs {
|
|
11
|
+
strategy: PulumiClientStrategy.AZURE;
|
|
12
|
+
auth: {
|
|
13
|
+
clientId: string;
|
|
14
|
+
clientSecret: string;
|
|
15
|
+
tenantId: string;
|
|
16
|
+
subscriptionId: string;
|
|
17
|
+
};
|
|
18
|
+
stateFile: {
|
|
19
|
+
azureStateLocation: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export type PulumiClientStrategies = PulumiClientAzureStrategy;
|
|
23
|
+
export type PulumiClientCreateArgs = PulumiClientStrategies & LocalProgramArgs;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"author": "Tahmid Ahmed",
|
|
5
5
|
"description": "A collection of Bun shell scripts that can be re-used in various CICD pipelines.",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.27",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "git+https://github.com/tahminator/pipeline.git"
|
|
9
9
|
},
|
|
@@ -40,7 +40,9 @@
|
|
|
40
40
|
"jiti": "^2.6.1",
|
|
41
41
|
"prettier": "^3.8.1",
|
|
42
42
|
"typescript-eslint": "^8.57.1",
|
|
43
|
-
"vitest": "^4.1.0"
|
|
43
|
+
"vitest": "^4.1.0",
|
|
44
|
+
"@types/semver": "^7.7.1",
|
|
45
|
+
"@types/yargs": "^17.0.35"
|
|
44
46
|
},
|
|
45
47
|
"peerDependencies": {
|
|
46
48
|
"typescript": "^5"
|
|
@@ -48,8 +50,7 @@
|
|
|
48
50
|
"dependencies": {
|
|
49
51
|
"@octokit/auth-app": "^8.2.0",
|
|
50
52
|
"@octokit/rest": "^22.0.1",
|
|
51
|
-
"@
|
|
52
|
-
"@types/yargs": "^17.0.35",
|
|
53
|
+
"@pulumi/pulumi": "^3.230.0",
|
|
53
54
|
"neverthrow": "^8.2.0",
|
|
54
55
|
"semver": "^7.7.4",
|
|
55
56
|
"yaml": "^2.8.2",
|