diff --git a/k8s-deployer/scripts/start-example.sh b/k8s-deployer/scripts/start-example.sh index b14d86c..c9e3545 100755 --- a/k8s-deployer/scripts/start-example.sh +++ b/k8s-deployer/scripts/start-example.sh @@ -60,7 +60,6 @@ fi if [ "${DO_NOT_CREATE_PROJECT_DIR}" == "" ]; then DO_NOT_CREATE_PROJECT_DIR="false"; fi if [ "${DO_NOT_CREATE_PROJECT_DIR}" == "true" ]; then - export DO_NOT_CREATE_PROJECT_DIR PROJECT_DIR="${PROJECT_DIR}/*" fi diff --git a/k8s-deployer/src/deployer.ts b/k8s-deployer/src/deployer.ts index 5361432..92fd5ba 100644 --- a/k8s-deployer/src/deployer.ts +++ b/k8s-deployer/src/deployer.ts @@ -209,13 +209,13 @@ export const deployComponent = async ( } else { logger.info("Reading commit sha of local project: '%s'", appDir) - if (process.env.DO_NOT_CREATE_PROJECT_DIR === "true") spec.location.path = "."; // only if creating project directory is not required - 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 { - appDir = spec.id + const currentPath = await Shell.exec(`pwd`); + console.log('😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈', currentPath); + appDir = fs.existsSync(spec.id) ? 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`) @@ -229,14 +229,14 @@ export const undeployComponent = async (workspace: string, namespace: Namespace, const spec = deploymentInfo.component let appDir = `${workspace}/${ spec.id }` - if (process.env.DO_NOT_CREATE_PROJECT_DIR === "true") spec.location.path = "." // only if creating project directory is not required - if (spec.location.type === LocationType.Local) { 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 { - appDir = spec.id + const currentPath = await Shell.exec(`pwd`); + console.log('😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈😈', currentPath); + appDir = fs.existsSync(spec.id) ? spec.id : '' logger.info("The application directory will be taken from 'id' attribute: '%s' of '%s'", appDir, spec.name) } } diff --git a/k8s-deployer/src/test-suite-handler.ts b/k8s-deployer/src/test-suite-handler.ts index 57618bd..b3e27bb 100644 --- a/k8s-deployer/src/test-suite-handler.ts +++ b/k8s-deployer/src/test-suite-handler.ts @@ -1,14 +1,14 @@ import * as fs from "fs" +import { Config } from "./config.js" +import * as Deployer from "./deployer.js" +import * as K8s from "./k8s.js" import { LOG_SEPARATOR_LINE, logger } from "./logger.js" import { DeployedComponent, DeployedTestSuite, GraphDeploymentResult, Namespace, Prefix, Schema } from "./model.js" -import * as Deployer from "./deployer.js" -import { Config } from "./config.js" import * as PifFileLoader from "./pitfile/pitfile-loader.js" -import * as K8s from "./k8s.js" -import * as TestRunner from "./test-app-client/test-runner.js" -import * as Shell from "./shell-facade.js" import { PodLogTail } from "./pod-log-tail.js" +import * as Shell from "./shell-facade.js" +import * as TestRunner from "./test-app-client/test-runner.js" export const generatePrefix = (env: string): Prefix => { return generatePrefixByDate(new Date(), env) @@ -137,7 +137,7 @@ const deployLocal = async ( logger.info("process.env.MOCK_NS=%s", process.env.MOCK_NS) } - logger.info("NAMEPSACE IN USE=%s, process.env.MOCK_NS=%s", ns, process.env.MOCK_NS) + logger.info("NAMESPACE IN USE=%s, process.env.MOCK_NS=%s", ns, process.env.MOCK_NS) await deployLockManager(config, workspace, ns, pitfile.lockManager.enabled, testSuite.id) logger.info("") @@ -234,7 +234,7 @@ export const processTestSuite = async ( // By default assume processing strategy to be "deploy all then run tests one by one" logger.info("") - logger.info("--------------- Processig %s ---------------", testSuite.id) + logger.info("--------------- Processing %s ---------------", testSuite.id) logger.info("") const list = await deployAll(prefix, config, pitfile, seqNumber, testSuite)