Skip to content
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
22 changes: 8 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ db-migrate-package:

# Usage:
#
# Reset all keyspaces
# Reset all keyspaces and reset the ES index
# make db-reset
#
# Reset keyspace for only one service, say galley:
Expand All @@ -252,28 +252,22 @@ ifeq ($(package), all)
else
$(EXE_SCHEMA) --keyspace $(package)_test --replication-factor 1 --reset
endif
./dist/brig-index reset --elasticsearch-server http://localhost:9200 > /dev/null

# Usage:
#
# Migrate all keyspaces
# Migrate all keyspaces and reset the ES index
# make db-migrate
#
# Migrate keyspace for only one service, say galley:
# make db-migrate package=galley
.PHONY: db-migrate
db-migrate: c
ifeq ($(package), all)
./dist/brig-schema --keyspace brig_test --replication-factor 1
./dist/galley-schema --keyspace galley_test --replication-factor 1
./dist/gundeck-schema --keyspace gundeck_test --replication-factor 1
./dist/spar-schema --keyspace spar_test --replication-factor 1
# How this check works: https://stackoverflow.com/a/9802777
else ifeq ($(package), $(filter $(package),brig galley gundeck spar))
$(EXE_SCHEMA) --keyspace $(package)_test --replication-factor 1
else
@echo No schema migrations for $(package)
endif

./dist/brig-schema --keyspace brig_test --replication-factor 1 > /dev/null
./dist/galley-schema --keyspace galley_test --replication-factor 1 > /dev/null
./dist/gundeck-schema --keyspace gundeck_test --replication-factor 1 > /dev/null
./dist/spar-schema --keyspace spar_test --replication-factor 1 > /dev/null
./dist/brig-index reset --elasticsearch-server http://localhost:9200 > /dev/null

#################################
## dependencies
Expand Down
5 changes: 0 additions & 5 deletions libs/types-common/src/Util/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import Imports
import Options.Applicative
import Options.Applicative.Types
import System.Exit (die)
import System.IO (hPutStrLn)
import URI.ByteString
import Util.Options.Common

Expand Down Expand Up @@ -137,10 +136,6 @@ getOptions desc pars defaultPath = do
Right o -> pure o
-- Config doesn't exist but at least we have a CLI options parser
(False, Just p) -> do
hPutStrLn stderr $
"Config file at "
++ path
++ " does not exist, falling back to command-line arguments. \n"
execParser (info (helper <*> p) mkDesc)
-- No config, no parser :(
(False, Nothing) -> do
Expand Down