Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: consume pulumi environment #99

Merged
merged 11 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions projects/bjerk-conf/Pulumi.prod.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
config:
environment:
- secrets
8 changes: 6 additions & 2 deletions projects/bjerk-conf/resources/github/providers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as github from '@pulumi/github';
import { bjerkBotGitHubToken as token } from '../stack-refs';
import * as pulumi from '@pulumi/pulumi';
import { getToken } from 'get-pulumi-secret';

const githubProviders = new Map<string, github.Provider>();

Expand All @@ -9,7 +10,10 @@ export function getGithubProvider(owner: string): github.Provider {
owner,
new github.Provider(owner, {
owner,
token,
token: getToken({
name: `${owner}-token`,
namespace: 'github',
}),
}),
);
}
Expand Down
7 changes: 0 additions & 7 deletions projects/bjerk-conf/resources/stack-refs.ts

This file was deleted.

2 changes: 2 additions & 0 deletions projects/bjerk-io/Pulumi.prod.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
config:
gcp:project: bjerk-io
environment:
- secrets
6 changes: 4 additions & 2 deletions projects/bjerk-io/src/github.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import * as github from '@pulumi/github';
import { bjerkBotGitHubToken } from './stack-refs';
import * as pulumi from '@pulumi/pulumi';

const config = new pulumi.Config('github');

export const githubProvider = new github.Provider('gh-provider', {
owner: 'bjerkio',
token: bjerkBotGitHubToken,
token: config.requireSecret('token'),
});
7 changes: 0 additions & 7 deletions projects/bjerk-io/src/stack-refs.ts

This file was deleted.

4 changes: 2 additions & 2 deletions projects/core-infra/Pulumi.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ config:
- group:gcp-organization-viewers@bjerk.io
branches:developers:
- group:developers@bjerk.io
github:token:
secure: AAABAFV2iNVa8uYxniCjg8903NVjQG4b9K6N4gcPlraAaszUTxUmkcft/IQm0j2NeqbTBGWH2Ei7xrtPpShS2hwaHHGE12rz
intg-avfnor:slack-channel: C03KE9E4QEQ
pulumi:token:
secure: AAABALfUIspDSD6BHc//gBuigJQpEPekvfyM5HhY3UZdRov/qkl2Jams+B4BQmmaPUZeO4qWiyk/2ymYEiIOTmYvidWSLKKqM4ioUg==
Expand All @@ -20,3 +18,5 @@ config:
slack:google-cloud-logger-slack-tag: latest
timely-agent:slack-channel: C03BY6RB248
tripletex-time-agent:slack-channel: C03J6TVRVFG
environment:
- secrets
3 changes: 2 additions & 1 deletion projects/core-infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"@pulumi/github": "^5.8.0",
"@pulumi/pulumi": "^3.65.1",
"date-fns": "^2.30.0",
"gcl-slack": "^3.0.0"
"gcl-slack": "^3.0.0",
"get-pulumi-secret": "^2.0.0"
},
"devDependencies": {
"@types/node": "^18.16.3",
Expand Down
3 changes: 3 additions & 0 deletions projects/core-infra/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ export const branchesDevelopers =
export const developers = config.requireObject<string[]>('developers');
export const internalViewers =
config.requireObject<string[]>('internal-viewers');

const githubConfig = new pulumi.Config('github');
export const githubToken = githubConfig.requireSecret('token');
13 changes: 0 additions & 13 deletions projects/core-infra/src/customers/bassene-web.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/core-infra/src/customers/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
import './bassene-web';
import './flexisoft';
import './abax-vwfs';
7 changes: 1 addition & 6 deletions projects/core-infra/src/github-orgs.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import * as github from '@pulumi/github';
import { bjerkBotGitHubToken as token } from './stack-refs';
import { githubToken as token } from './config';

export const bjerkio = new github.Provider('bjerkio-provider', {
owner: 'bjerkio',
token,
});

export const basssene = new github.Provider('basssene-provider', {
owner: 'basssene',
token,
});

export const branches = new github.Provider('branches-provider', {
owner: 'getbranches',
token,
Expand Down
4 changes: 2 additions & 2 deletions projects/core-infra/src/providers/github.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as github from '@pulumi/github';
import { bjerkBotGitHubToken } from '../stack-refs';
import { githubToken } from '../config';

export const provider = new github.Provider('github-provider', {
token: bjerkBotGitHubToken,
token: githubToken,
});
7 changes: 0 additions & 7 deletions projects/core-infra/src/stack-refs.ts

This file was deleted.