Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(version-variable): use package.json version on integration_versi… #3

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/rulesTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@
"valueSource": "EXPRESSION",
"transform": "NONE",
"variableName": "PMUSER_FPJS_INTEGRATION_VERSION",
"variableValue": "0.0.1"
"variableValue": "__integration_version__"
}
},
{
Expand Down
2 changes: 2 additions & 0 deletions generators/generatePatchBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import rulesTemplate from '../assets/rulesTemplate.json'
import rulePatch from '../assets/patch-body/patchBodyAddRule.json'
import variablePatch from '../assets/patch-body/patchBodyAddVariable.json'
import variables from '../assets/variables.json'
import packageJSON from '../package.json'

interface PatchBodyOptions {
integrationPath?: string
Expand Down Expand Up @@ -30,6 +31,7 @@ export default function generatePatchBody({
bodyString = bodyString.replace(/__agent_path__/g, agentPath)
bodyString = bodyString.replace(/__result_path__/g, resultPath)
bodyString = bodyString.replace(/__proxy_secret__/g, proxySecret)
bodyString = bodyString.replace(/__integration_version__/g, packageJSON.version)

return bodyString
}
2 changes: 2 additions & 0 deletions generators/generateTerraformPropertyRules.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import rulesTemplate from '../assets/rulesTemplate.json'
import packageJSON from '../package.json'

export default function generateTerraformPropertyRules() {
let bodyString = JSON.stringify(rulesTemplate, null, 2)
bodyString = bodyString.replace(/__integration_path__/g, "${env.fpjs_integration_path}")
bodyString = bodyString.replace(/__agent_path__/g, "${env.fpjs_agent_path}")
bodyString = bodyString.replace(/__result_path__/g, "${env.fpjs_result_path}")
bodyString = bodyString.replace(/__proxy_secret__/g, "${env.fpjs_proxy_secret}")
bodyString = bodyString.replace(/__integration_version__/g, packageJSON.version)

return bodyString
}
Loading