Skip to content

feat: 🎸 accept the target path param directly #35

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
23 changes: 6 additions & 17 deletions bin/entrypoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,13 @@ import { StsGateway } from '../lib/gateways/sts-gateway';
import { SsmService } from '../lib/services/ssm-service';
import { exit } from 'process';

export function resolveSsmRootDirectory(namespace: string): string {
if (namespace === 'live') {
return '/dt-config';
} else {
return `/dev-config/${namespace}`
}
}

export interface InputConfig {
configPathDir: string;
namespace: string;
targetSsmPath: string;
}
export async function execute(props: InputConfig): Promise<void> {

const ssmRootPath = resolveSsmRootDirectory(props.namespace);
const ssmRootPath = props.targetSsmPath

log.info(`SsmRootPath: ${ssmRootPath}`);

Expand Down Expand Up @@ -52,13 +44,11 @@ export async function execute(props: InputConfig): Promise<void> {

export async function updateAllConfigs(allConfigs: gitConfig.Config[], ssmRootPath: string) {
const ssmService = new SsmService();

const result = await ssmService.updateParametersByConfigRoot(allConfigs, ssmRootPath)

log.info("Update Result", {
result: result
})

}

// needs a tsconfig change that might not work for cdk, for now use top level promise.
Expand All @@ -84,19 +74,19 @@ log.options.debug = true;

const namespaceOption = cmdTs.option({
type: cmdTs.string,
long: 'namespace',
short: 'n',
long: 'targetSsmPath',
short: 't',
});

const cmd = cmdTs.command({
name: 'Config Deployer',
args: {
namespace: namespaceOption,
targetSsmPath: namespaceOption,
configDir: configDirOption,
},
handler: async (args) => {
const config: InputConfig = {
namespace: args.namespace,
targetSsmPath: args.targetSsmPath,
configPathDir: args.configDir,
}
await execute(config);
Expand All @@ -105,7 +95,6 @@ log.options.debug = true;

//start handling args
await cmdTs.run(cmd, process.argv.slice(2))

log.info("Complete. Exiting");

} catch (e) {
Expand Down
Loading