Skip to content

Commit

Permalink
fix: Allowing bake to be debugged from mono repo
Browse files Browse the repository at this point in the history
  • Loading branch information
whilke committed May 15, 2019
1 parent 69ddae5 commit 4dd7239
Show file tree
Hide file tree
Showing 23 changed files with 114 additions and 56 deletions.
9 changes: 9 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
BAKE_ENV_NAME=Bill Dev Env
BAKE_ENV_CODE=BDE0
BAKE_ENV_REGIONS=[{"name":"East US","code":"eus","shortName":"centralus"}]
BAKE_AUTH_SERVICE_ID=79d94f23-955c-4431-9b77-ea7e9c2565c3
BAKE_AUTH_SERVICE_KEY=zfw3AYhVIn4AY6Mem9SaDVJ0j9+3SI1xxZrjxo5AFhg=
BAKE_AUTH_TENANT_ID=hchbazure.onmicrosoft.com
BAKE_AUTH_SUBSCRIPTION_ID=9c1dbd64-75a9-457b-bd3f-6649fe9c82d8
BAKE_DEBUG=1
BAKE_DEBUG_INGREDIENT_PATH=c:/git/bake/ingredient
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ lib
azdevops/**/*.js
!azdevops/imports/**/*.js
/.vs
.env
27 changes: 3 additions & 24 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,12 @@
"type": "node",
"request": "launch",
"name": "Debug Locally",
"program": "${workspaceFolder}/src/index.ts",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"program": "${workspaceFolder}/system/dist/index.js",
"args": ["serve","c:/git/bake/system/package/test.yaml"],
"envFile": "${workspaceFolder}/.env",
"env": {
"NODE_ENV": "development"
}
},
{
"type": "node",
"request": "attach",
"name": "Debug Container",
"preLaunchTask": "start-compose",
"postDebugTask": "stop-compose",
"showAsyncStacks": true,
"protocol": "inspector",
"port": 9229,
"restart": false,
"timeout": 10000,
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app/bake",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"skipFiles": [
"<node_internals>/**/*.js",
]
}
]
}
2 changes: 1 addition & 1 deletion arm-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@azure/arm-resources": "1.*"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@azure/arm-resources": "1.*",
"@types/node": "^10.12.18"
},
Expand Down
13 changes: 9 additions & 4 deletions core/src/ingredient-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ export class IngredientManager {

if (module.plugin){

let packagePath = process.env['npm_ingredient_root'] + '/' + moduleName + '/package.json';
let module_version = null
try{
module_version = require(moduleName + '/package.json').version
}catch(e){
let packagePath = process.env['npm_ingredient_root'] + '/' + moduleName + '/package.json';
let content = fs.readFileSync(packagePath).toString('utf-8')
let json = JSON.parse(content)
module_version = json.version
}

let content = fs.readFileSync(packagePath).toString('utf-8')
let json = JSON.parse(content)
let module_version = json.version

IngredientManager.ingredientTypes.set(module.pluginNS, module.plugin)
IngredientManager.ingredientTypesVersions.set(module.pluginNS, module_version)
Expand Down
2 changes: 1 addition & 1 deletion ingredient/ingredient-app-insights/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@azure/ms-rest-nodeauth": "0.9.2"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@azure/ms-rest-nodeauth": "0.9.2",
"@types/node": "^10.12.18"
},
Expand Down
2 changes: 1 addition & 1 deletion ingredient/ingredient-app-service-plan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@azure/ms-rest-nodeauth": "0.9.2"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@azbake/ingredient-utils": "^0.1.46",
"@azure/ms-rest-nodeauth": "0.9.2",
"@types/node": "^10.12.18"
Expand Down
2 changes: 1 addition & 1 deletion ingredient/ingredient-arm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@azure/ms-rest-nodeauth": "0.9.2"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@azure/ms-rest-nodeauth": "0.9.2",
"@types/node": "^10.12.18"
},
Expand Down
2 changes: 1 addition & 1 deletion ingredient/ingredient-container-reg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@azure/ms-rest-nodeauth": "0.9.2"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@azure/ms-rest-nodeauth": "0.9.2",
"@types/node": "^10.12.18"
},
Expand Down
2 changes: 1 addition & 1 deletion ingredient/ingredient-event-hub-namespace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@azure/ms-rest-nodeauth": "0.9.2"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@azure/ms-rest-nodeauth": "0.9.2",
"@types/node": "^10.12.18"
},
Expand Down
2 changes: 1 addition & 1 deletion ingredient/ingredient-event-hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@azure/ms-rest-nodeauth": "0.9.2"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@azure/ms-rest-nodeauth": "0.9.2",
"@types/node": "^10.12.18"
},
Expand Down
2 changes: 1 addition & 1 deletion ingredient/ingredient-host-names/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@azure/ms-rest-nodeauth": "0.9.2"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@azbake/ingredient-utils": "^0.1.46",
"@azure/ms-rest-nodeauth": "0.9.2"
},
Expand Down
2 changes: 1 addition & 1 deletion ingredient/ingredient-script/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@azbake/core": "0.*"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@types/node": "^10.12.18"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion ingredient/ingredient-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@azure/ms-rest-nodeauth": "0.9.2"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@azure/ms-rest-nodeauth": "0.9.2",
"@types/node": "^10.12.18"
},
Expand Down
2 changes: 1 addition & 1 deletion ingredient/ingredient-traffic-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@azure/ms-rest-nodeauth": "0.9.2"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@azbake/ingredient-utils": "^0.1.46",
"@azure/ms-rest-nodeauth": "0.9.2",
"@types/node": "^10.12.18"
Expand Down
2 changes: 1 addition & 1 deletion ingredient/ingredient-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@azbake/core": "0.*"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@types/node": "^10.12.18"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion ingredient/ingredient-webapp-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@azure/ms-rest-nodeauth": "0.9.2"
},
"devDependencies": {
"@azbake/core": "^0.1.46",
"@azbake/core": "0.*",
"@azbake/ingredient-utils": "^0.1.46",
"@azure/ms-rest-nodeauth": "0.9.2",
"@types/node": "^10.12.18"
Expand Down
41 changes: 30 additions & 11 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"scripts": {
"clean:build": "lerna clean --yes && lerna bootstrap --hoist && lerna run compile",
"load:build": "lerna bootstrap --hoist && lerna run compile",
"load:ingredients": "lerna run link:ingredients",
"build": "lerna bootstrap --hoist && lerna run compile",
"publish": "npm run clean:build && lerna publish --conventional-commits --yes"
}
Expand Down
3 changes: 2 additions & 1 deletion system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"debug": "node --inspect-brk=0.0.0.0:9229 dist/index.js",
"start": "node dist/index.js",
"test": "mocha --timeout 30000 -r ts-node/register test/**/*.ts",
"dockertag": "node ./dist/dockertag.js"
"dockertag": "node ./dist/dockertag.js",
"link:ingredients": "node ./dist/setup-ingredients.js"
},
"devDependencies": {
"@types/chai": "^4.1.7",
Expand Down
1 change: 1 addition & 0 deletions system/package/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ingredients:
- "@azbake/ingredient-storage@~0"
resourceGroup: true
parallelRegions: true
rgOverride: whilke-poc
variables:
test1: "[coreutils.variable('test2','default')]"
test2: whilke-poc
Expand Down
Loading

0 comments on commit 4dd7239

Please sign in to comment.