@@ -29,7 +29,7 @@ const setup = (): void => {
29
29
mkdirSync ( valuesDir , { recursive : true } )
30
30
}
31
31
32
- interface HelmRelese {
32
+ interface HelmRelease {
33
33
name : string
34
34
namespace : string
35
35
enabled : boolean
@@ -38,11 +38,11 @@ interface HelmRelese {
38
38
chart : string
39
39
version : string
40
40
}
41
- const getAppName = ( release : HelmRelese ) : string => {
41
+ const getAppName = ( release : HelmRelease ) : string => {
42
42
return `${ release . namespace } -${ release . name } `
43
43
}
44
44
45
- const getArgocdAppManifest = ( release : HelmRelese , values : Record < string , any > , otomiVersion ) => {
45
+ const getArgocdAppManifest = ( release : HelmRelease , values : Record < string , any > , otomiVersion ) => {
46
46
return {
47
47
apiVersion : 'argoproj.io/v1alpha1' ,
48
48
kind : 'Application' ,
@@ -80,17 +80,17 @@ const getArgocdAppManifest = (release: HelmRelese, values: Record<string, any>,
80
80
}
81
81
}
82
82
83
- const removeApplication = async ( release : HelmRelese ) : Promise < void > => {
83
+ const removeApplication = async ( release : HelmRelease ) : Promise < void > => {
84
84
const name = getAppName ( release )
85
85
if ( ! ( await isResourcePresent ( 'application' , name , 'argocd' ) ) ) return
86
86
87
- // TODO: do we always want to remove finalisers ?
87
+ // TODO: do we always want to remove finalizers ?
88
88
await $ `kubectl -n argocd patch application ${ name } -p '{"metadata": {"finalizers": null}}' --type merge`
89
89
const resDelete = await $ `kubectl -n argocd delete application ${ name } `
90
90
d . info ( resDelete . stdout . toString ( ) )
91
91
}
92
92
93
- const writeApplicationManifest = async ( release : HelmRelese , otomiVersion : string ) : Promise < void > => {
93
+ const writeApplicationManifest = async ( release : HelmRelease , otomiVersion : string ) : Promise < void > => {
94
94
const appName = `${ release . namespace } -${ release . name } `
95
95
// d.info(`Generating Argocd Application at ${appName}`)
96
96
const applicationPath = `${ appsDir } /${ appName } .yaml`
@@ -125,9 +125,9 @@ export const applyAsApps = async (argv: HelmArguments): Promise<void> => {
125
125
} )
126
126
const errors : Array < any > = [ ]
127
127
// Generate JSON object with all helmfile releases defined in helmfile.d
128
- const releses : [ ] = JSON . parse ( res . stdout . toString ( ) )
128
+ const releases : [ ] = JSON . parse ( res . stdout . toString ( ) )
129
129
await Promise . allSettled (
130
- releses . map ( async ( release : HelmRelese ) => {
130
+ releases . map ( async ( release : HelmRelease ) => {
131
131
try {
132
132
if ( release . installed ) await writeApplicationManifest ( release , otomiVersion )
133
133
else {
@@ -147,10 +147,10 @@ export const applyAsApps = async (argv: HelmArguments): Promise<void> => {
147
147
d . error ( e )
148
148
errors . push ( e )
149
149
}
150
- if ( errors . length === 0 ) d . info ( `All applications has been deployed succesfully ` )
150
+ if ( errors . length === 0 ) d . info ( `All applications has been deployed successfully ` )
151
151
else {
152
152
errors . map ( ( e ) => d . error ( e ) )
153
- d . error ( `Not all applications has been deployed succesfully ` )
153
+ d . error ( `Not all applications has been deployed successfully ` )
154
154
}
155
155
}
156
156
0 commit comments