Skip to content

Commit

Permalink
DEVOP-32: test out migration for test chart
Browse files Browse the repository at this point in the history
  • Loading branch information
michperalbo-fsl committed May 17, 2024
1 parent be31a15 commit a3edfca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
7 changes: 4 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24310,7 +24310,7 @@ function run(exec, context, core, env) {
const repository = context.repo.repo;
const serviceName = getServiceName(repository);
const gitsha = context.sha.slice(0, 7);
const timeout = core.getInput('timeout') || '600';
const timeout = core.getInput('timeout') || '600s';
const pullSecret = core.getInput('imagePullSecret') || 'peachjar-eks-github-pull-secret';
const helmChartPath = core.getInput('helmChartPath') || `./${serviceName}`;
const helmReleaseName = core.getInput('helmReleaseName') || serviceName;
Expand All @@ -24329,8 +24329,9 @@ function run(exec, context, core, env) {
core.info('Adding plugin helm v2to3');
yield exec('helm', ['plugin', 'install', 'https://github.com/helm/helm-2to3.git']);
core.info('Starting migration to helm v3');
yield exec('helm', ['--kubeconfig', `../kilauea/kubefiles/${environment}/kubectl_configs/${environment}-kube-config-beta-admins.yml`,
'2to3', 'convert', helmReleaseName, '--release-versions-max', '200', '--ignore-already-migrated', '--dry-run'
yield exec('helm', [
'--kubeconfig', `../kilauea/kubefiles/${environment}/kubectl_configs/${environment}-kube-config-beta-admins.yml`,
'2to3', 'convert', helmReleaseName, '--release-versions-max', '200', '--ignore-already-migrated'
], {
cwd: 'peachjar-aloha/',
env: Object.assign({}, env, {
Expand Down
24 changes: 13 additions & 11 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default async function run(
const serviceName = getServiceName(repository)
const gitsha = context.sha.slice(0, 7)

const timeout = core.getInput('timeout') || '600'
const timeout = core.getInput('timeout') || '600s'
const pullSecret = core.getInput('imagePullSecret') || 'peachjar-eks-github-pull-secret'
const helmChartPath = core.getInput('helmChartPath') || `./${serviceName}`
const helmReleaseName = core.getInput('helmReleaseName') || serviceName
Expand All @@ -70,15 +70,17 @@ export default async function run(

core.info('Starting migration to helm v3')

await exec('helm', ['--kubeconfig', `../kilauea/kubefiles/${environment}/kubectl_configs/${environment}-kube-config-beta-admins.yml`,
'2to3','convert', helmReleaseName, '--release-versions-max', '200','--ignore-already-migrated', '--dry-run'
], {
cwd: 'peachjar-aloha/',
env: Object.assign({}, env, {
AWS_ACCESS_KEY_ID: awsAccessKeyId,
AWS_SECRET_ACCESS_KEY: awsSecretAccessKey,
}),
})
await exec('helm', [
'--kubeconfig', `../kilauea/kubefiles/${environment}/kubectl_configs/${environment}-kube-config-beta-admins.yml`,
'2to3', 'convert', helmReleaseName, '--release-versions-max', '200', '--ignore-already-migrated'
], {
cwd: 'peachjar-aloha/',
env: Object.assign({}, env, {
AWS_ACCESS_KEY_ID: awsAccessKeyId,
AWS_SECRET_ACCESS_KEY: awsSecretAccessKey,
}),
})

await exec('helm', ['--kubeconfig', `../kilauea/kubefiles/${environment}/kubectl_configs/${environment}-kube-config-beta-admins.yml`, 'ls'],
{
cwd: 'peachjar-aloha/',
Expand All @@ -88,7 +90,7 @@ export default async function run(
}),
}
)

core.info('Migration to helm3 succeeded')

await exec('helm', [
Expand Down

0 comments on commit a3edfca

Please sign in to comment.