Files
mattermost/scripts/diff-config.sh
Martin Kraft 8f01a1b5a1 MM-36448: Removes legacy CLI commands. (#17995)
* MM-36448: Removes legacy CLI commands.

* MM-26448: Update translations.

* MM-36448: Fixes some lint errors.

* MM-36448: Conflict resolution error fix. Lint fixes.

* MM-36448: Removes some more commands.

* MM-36448: Removes unused functions.

* MM-36448: Re-adds config command.

* MM-36448: Re-adds func for use by config.

* MM-36448: Moved structs back.

* MM-36488: Re-adds version.

* MM-36448: Re-added some commands.

* MM-36448: Fix tests.

* MM-36448: Removed unused func.

* MM-36448: Removes test.

* MM-36448: Removes uses of 'config set'.

* MM-36448: Moves some test structs.

* MM-36448: Removes the logs command.

* MM-36448: Re-deleted file after bad merge.

* MM-36448: Deleted test files again.

* MM-36448: Re-delete files.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-08-18 14:06:28 -04:00

48 lines
970 B
Bash
Executable File

#!/usr/bin/env bash
./jq-dep-check.sh
if [ -z "$FROM" ]
then
echo "Missing FROM version. Usage: make diff-config FROM=1.1.1 TO=2.2.2"
exit 1
fi
if [ -z "$TO" ]
then
echo "Missing TO version. Usage: make diff-config FROM=1.1.1 TO=2.2.2"
exit 1
fi
# Returns the config file for a specific release
fetch_config() {
local url="https://releases.mattermost.com/$1/mattermost-$1-linux-amd64.tar.gz"
curl -sf "$url" | tar -xzOf - mattermost/config/config.json | jq -S .
}
echo Fetching config files
from_config="$(fetch_config "$FROM")"
if [ -z "$from_config" ]
then
echo Invalid version "$FROM"
exit 1
fi
to_config=$(fetch_config "$TO")
if [ -z "$to_config" ]
then
echo Invalid version "$TO"
exit 1
fi
echo Comparing config files
diff -y <(echo "$from_config") <(echo "$to_config")
# We ignore exits with 1 since it just means there's a difference, which is fine for us.
diff_exit=$?
if [ $diff_exit -eq 1 ]; then
exit 0
else
exit $diff_exit
fi