-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.ts
More file actions
23 lines (20 loc) · 757 Bytes
/
utils.ts
File metadata and controls
23 lines (20 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as dotenv from 'dotenv';
import git from "@rkesters/git-agent";
export class InfrastructureContext {
private currentBranch: string;
private envFile: string;
constructor() {
this.currentBranch = git.branchName();
this.envFile = `.env.${this.currentBranch}`;
}
public load() {
dotenv.config({ path: this.envFile });
console.log(`Git Branch ${this.currentBranch}`);
console.log(`Loading configuration from ${this.envFile}`);
console.log(`Git Branch ${process.env.BRANCH}`);
console.log(`Environment ${process.env.ENVIRONMENT}`);
console.log(`Profile ${process.env.AWS_PROFILE}`);
console.log(`Region ${process.env.DEFAULT_REGION}`);
console.log(`Deploying to ${process.env.DEFAULT_ACCOUNT}`);
}
}