Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from 3lvia/CORE-1835
Browse files Browse the repository at this point in the history
 CORE-1835: remove transient json decimal diff
  • Loading branch information
mofsesam authored Apr 22, 2024
2 parents 2754722 + f93e6d4 commit ba9fa8b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN apt-get update && apt-get install -y \
curl \
unzip \
jq \
sed \
&& rm -rf /var/lib/apt/lists/*

ADD entrypoint.sh /entrypoint.sh
Expand Down
8 changes: 8 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ else
exit 1
fi

# We are not interested in diffs that are not relevant and will change configs so we do not get false positives
# Transient values that are not relevant for the diff. That is e.g. -0.1234 and "~f-0.1234" is considered the same value.

no_transient_decimal.sh /tmp/sesam/tmp_download/pipes/ "*.conf.json"
no_transient_decimal.sh /tmp/sesam/tmp_upload/pipes/ "*.conf.json"
no_transient_decimal.sh /tmp/sesam/tmp_download/systems/ "*.conf.json"
no_transient_decimal.sh /tmp/sesam/tmp_upload/systems/ "*.conf.json"

# Check if there are differences between the downloaded config and the local config

echo '```diff' | tee -a $GITHUB_STEP_SUMMARY
Expand Down
10 changes: 10 additions & 0 deletions no_transient_decimal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# The folder name
folder_name="$1"

# The glob expression
glob_expr="$2"

# Process all files in the specified folder that match the glob expression
find "$folder_name" -name "$glob_expr" -type f -exec sed -i -r 's/"~f([-]?[0-9]+\.[0-9]+)"/\1/g' {} \;

0 comments on commit ba9fa8b

Please sign in to comment.