-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: support flat search input value field * i142 - added manadatory pagination arguments (partial) - fixed integration test environment * removed debug lines * remove quotes from Array value type * chore: bump to 0.3.0 * fix: change test branch to master * chore: version bump to 0.4.0 Co-authored-by: Francisco Ramírez <[email protected]>
- Loading branch information
1 parent
a011eaf
commit 1125784
Showing
8 changed files
with
229 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,60 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
# Wait until the relational database-server up and running | ||
waited=0 | ||
until node ./utils/testSequelizeDbServerAvailable.js | ||
until node ./scripts/testDatabaseConnectionsAvailable.js 1>/dev/null | ||
do | ||
if [ $waited == 240 ]; then | ||
echo -e '\nERROR: Time out reached while waiting for relational database server to be available.\n' | ||
exit 1 | ||
fi | ||
sleep 2 | ||
waited=$(expr $waited + 2) | ||
if [ $waited == 240 ]; then | ||
echo -e '\nERROR: Time out reached while waiting for relational database server to be available.\n' | ||
exit 1 | ||
fi | ||
sleep 2 | ||
waited=$(expr $waited + 2) | ||
done | ||
|
||
# Run the migrations | ||
if ! ./node_modules/.bin/sequelize db:migrate; then | ||
echo -e '\nERROR: Migrating the relational database(s) caused an error.\n' | ||
exit 1 | ||
fi | ||
|
||
# Run seeders if needed | ||
if [ -d ./seeders ]; then | ||
if ! ./node_modules/.bin/sequelize db:seed:all; then | ||
echo -e '\nERROR: Seeding the relational database(s) caused an error.\n' | ||
exit 1 | ||
fi | ||
fi | ||
# Read config and migrate/seed databases | ||
CONFIG="./config/data_models_storage_config.json" | ||
SEQUELIZE="./node_modules/.bin/sequelize" | ||
DB_KEYS=( $(node ./scripts/getStorageTypes.js) ) | ||
|
||
for object in ${DB_KEYS[@]}; do | ||
|
||
# Split "key:storageType" in each DB_KEYS element | ||
params=(${object//:/ }) | ||
|
||
# Retrieve individual values | ||
key="${params[0]}" | ||
storageType="${params[1]}" | ||
|
||
# Execute sequelize CLI | ||
sequelize_params=( | ||
"--config $CONFIG" | ||
"--env $key" | ||
"--migrations-path ./migrations/$key/" | ||
"--seeders-path ./seeders/$key/" | ||
) | ||
|
||
if [[ "$storageType" == "sql" ]]; then | ||
|
||
# Run the migrations | ||
if ! $SEQUELIZE db:migrate ${sequelize_params[@]}; then | ||
echo -e '\nERROR: Migrating the relational database(s) caused an error.\n' | ||
exit 1 | ||
fi | ||
|
||
# Run seeders if needed | ||
if [ -d ./seeders/$key ]; then | ||
if ! $SEQUELIZE db:seed:all ${sequelize_params[@]}; then | ||
echo -e '\nERROR: Seeding the relational database(s) caused an error.\n' | ||
exit 1 | ||
fi | ||
fi | ||
|
||
fi | ||
|
||
done | ||
|
||
|
||
# Start GraphQL-server | ||
npm start acl | ||
npm start acl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,10 @@ | ||
{ | ||
"development": { | ||
"default-sql": { | ||
"storageType": "sql", | ||
"username": "sciencedb", | ||
"password": "sciencedb", | ||
"database": "sciencedb_development", | ||
"host": "gql_postgres1", | ||
"dialect": "postgres", | ||
"operatorsAliases": false | ||
}, | ||
"test": { | ||
"username": "sciencedb", | ||
"password": "sciencedb", | ||
"database": "sciencedb_test", | ||
"host": "gql_postgres1", | ||
"dialect": "postgres", | ||
"operatorsAliases": false | ||
}, | ||
"production": { | ||
"username": "sciencedb", | ||
"password": "sciencedb", | ||
"database": "sciencedb_production", | ||
"host": "gql_postgres1", | ||
"dialect": "postgres", | ||
"operatorsAliases": false | ||
"dialect": "postgres" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,10 @@ | ||
{ | ||
"development": { | ||
"default-sql": { | ||
"storageType": "sql", | ||
"username": "sciencedb", | ||
"password": "sciencedb", | ||
"database": "sciencedb_development", | ||
"host": "gql_postgres2", | ||
"dialect": "postgres", | ||
"operatorsAliases": false | ||
}, | ||
"test": { | ||
"username": "sciencedb", | ||
"password": "sciencedb", | ||
"database": "sciencedb_test", | ||
"host": "gql_postgres2", | ||
"dialect": "postgres", | ||
"operatorsAliases": false | ||
}, | ||
"production": { | ||
"username": "sciencedb", | ||
"password": "sciencedb", | ||
"database": "sciencedb_production", | ||
"host": "gql_postgres2", | ||
"dialect": "postgres", | ||
"operatorsAliases": false | ||
"dialect": "postgres" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.