Skip to content

Commit

Permalink
feat: [KTD-3526] workable solution 19
Browse files Browse the repository at this point in the history
  • Loading branch information
damwu1 committed May 11, 2024
1 parent 7d0a980 commit ed75cf1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions k8s-deployer/src/deployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,19 @@ export const deployComponent = async (
commitSha = await cloneFromGit(spec.id, spec.location, appDir)
} else {
logger.info("Reading commit sha of local project: '%s'", appDir)
logger.info("Current directory: 😜😜😜😜😜😜😜😜😜😜😜😜😜😜😜😜", process.cwd())
// const currentPath = await Shell.exec(`ls -lah ${ appDir }`)
// const unknown = await fs.promises.access(appDir, fs.constants.X_OK)
// logger.info('🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡', currentPath, appDir, unknown, spec)

if (spec.location.path) {
appDir = spec.location.path
logger.info("The application directory will be taken from 'location.path' attribute: '%s' of '%s'", appDir, spec.name)
} else {
const currentPath = await Shell.exec(`pwd`);
console.log('😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈', currentPath);
appDir = fs.existsSync(spec.id) ? spec.id : ''
const currentPath = await Shell.exec('ls -lah')
// logger.info('😈😈😈😈😈😈😈😈😈', currentPath, fs.existsSync(spec.id))
// appDir = fs.existsSync(spec.id) ? spec.id : '.'
appDir = spec.id
logger.info("The application directory will be taken from 'id' attribute: '%s' of '%s'", appDir, spec.name)
}
commitSha = await Shell.exec(`cd ${ appDir } && git log --pretty=format:"%h" -1`)
Expand All @@ -234,9 +239,10 @@ export const undeployComponent = async (workspace: string, namespace: Namespace,
appDir = spec.location.path
logger.info("The application directory will be taken from 'location.path' attribute: '%s' of '%s'", appDir, spec.name)
} else {
const currentPath = await Shell.exec(`pwd`);
console.log('😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈', currentPath);
appDir = fs.existsSync(spec.id) ? spec.id : ''
// const currentPath = await Shell.exec("ls -a")
// logger.info('🤯🤯🤯🤯🤯🤯🤯🤯🤯🤯', currentPath)
// appDir = fs.existsSync(spec.id) ? spec.id : '.'
appDir = spec.id
logger.info("The application directory will be taken from 'id' attribute: '%s' of '%s'", appDir, spec.name)
}
}
Expand Down

0 comments on commit ed75cf1

Please sign in to comment.