Skip to content

Commit

Permalink
INFRA-427: Update the existing ENVs check to avoid matching unwanted …
Browse files Browse the repository at this point in the history
…ENVs (#44)
  • Loading branch information
enyachoke authored Jan 31, 2024
1 parent 26717d8 commit 1cf84cf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jenkins/jenkins_home/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.1' encoding='UTF-8'?>
<hudson>
<disabledAdministrativeMonitors/>
<version>2.387.3</version>
<version>2.426.3</version>
<numExecutors>2</numExecutors>
<mode>NORMAL</mode>
<useSecurity>true</useSecurity>
Expand Down
2 changes: 1 addition & 1 deletion node-scripts/spec/pipeline3/scripts.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ describe("Scripts", function() {
var filename = ".env";

expect(scripts.writeProperty(envVar, value, filename)).toEqual(
'if ! grep -R "^[#]*s*KEY.*" .env > /dev/null; then\n' +
'if ! grep -w "KEY" .env > /dev/null; then\n' +
"\techo \"'KEY' is not found in file '.env'. Appending...\"\n" +
'\techo "KEY=a/path/on/the/disk" >> .env\n' +
"else\n" +
Expand Down
2 changes: 1 addition & 1 deletion node-scripts/src/pipeline3/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ module.exports = {
writeProperty(propertyName, value, filename) {
var script = "";

script += `if ! grep -R "^[#]*\s*${propertyName}.*" ${filename} > /dev/null; then\n`;
script += `if ! grep -w "${propertyName}" ${filename} > /dev/null; then\n`;
script += `\techo "'${propertyName}' is not found in file '${filename}'. Appending..."\n`;
script += `\techo "${propertyName}=${value}" >> ${filename}\n`;
script += "else\n";
Expand Down

0 comments on commit 1cf84cf

Please sign in to comment.