storj/scripts/update-satellite-cfg-lock.sh
Ivan Fraixedes f8df461249 v3-1660: Create a test that breaks when satellite config file has changed (#1898)
* scripts: check for satellite configuration changes

Create a simple script that checks if the satellite configuration has
differed with the last changes.

* Makefile: add target to check satellite cfg changes

Add a Makefile target which executes the script that checks if the last
changes has made a change in the satellite configuration.

* ci: add satellite cfg check on integration stage

* FIXUP: use releae defaults rather than development ones

* FIXUP: show the message when config differs & some cleanups

* scripts: add script to update the satellite cfg lock

Add a script for allowing to update the satellite configuration lock
file and add Makefile target to run it.

* scripts/testsdata: update satellite cfg lock

Update the satellite configuration lock file with the last changes that
satellite has suffered upstream.
2019-05-07 17:20:04 -04:00

29 lines
772 B
Bash
Executable File

#!/bin/bash
# NOTE this script MUST BE EXECUTED from the same directory where it's located
# to always obtain the same paths in the satellite configuration file.
set -ueo pipefail
read -p "Have you warned the DevOps Team before updating this file? " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo operation aborted!!!
exit 1
fi
#setup tmpdir for testfiles and cleanup
TMP_DIR=$(mktemp -d -t update-satellite-cfg-lock-XXXXX)
cleanup(){
rm -rf "$TMP_DIR"
}
trap cleanup EXIT
go build -o "$TMP_DIR/satellite" "../cmd/satellite"
PATH=$TMP_DIR:$PATH
TESTDATA_DIR="./testdata"
satellite --config-dir "$TESTDATA_DIR" --defaults release setup > /dev/null
mv "$TESTDATA_DIR/config.yaml" "$TESTDATA_DIR/satellite-config.yaml.lock"