Skip to content

Commit

Permalink
feat: added config context function to use
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-ra committed Jul 24, 2023
1 parent ebb1428 commit de9666f
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
69 changes: 69 additions & 0 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/handlers/kubectl-set-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {repositoryDirectory} from '../constants/repositoryDirectory'
import * as core from '@actions/core'
import {errorHandler} from '../helpers/error-handler'

export async function setContext(context?: string) {
export async function setKubectlContext(context?: string) {
try {
if (!context) {
return
Expand Down
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {execSync} from 'child_process'
import {repositoryDirectory} from './constants/repositoryDirectory'
import {errorHandler} from './helpers/error-handler'
import {deployHelmChart} from './handlers/deploy-helm'
import {setKubectlContext} from './handlers/kubectl-set-context'

async function run(): Promise<void> {
try {
Expand All @@ -24,6 +25,7 @@ async function run(): Promise<void> {
await installKubectl()
await setupKubectlConfig(kubeConfig)
await installHelm()
await setKubectlContext(context)
await deployHelmChart(releaseName, genericChart, namespace)

return
Expand Down

0 comments on commit de9666f

Please sign in to comment.