Skip to content
Snippets Groups Projects
Commit fe72f1fb authored by Bartek Wrona's avatar Bartek Wrona
Browse files

Update .gitlab-ci.yaml

parent 37d1868e
No related branches found
No related tags found
4 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!135Enable postgres monitoring on CI server,!38Hivemind ci separate sync
...@@ -12,7 +12,7 @@ variables: ...@@ -12,7 +12,7 @@ variables:
GIT_STRATEGY: clone GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
HIVEMIND_SOURCE_HIVED_URL: $HIVEMIND_SOURCE_HIVED_URL HIVEMIND_SOURCE_HIVED_URL: $HIVEMIND_SOURCE_HIVED_URL
HIVEMIND_DB_NAME: "${hive_$CI_COMMIT_REF_SLUG/-/_}" HIVEMIND_DB_NAME: "hive_$CI_COMMIT_REF_SLUG"
HIVEMIND_HTTP_PORT: $HIVEMIND_HTTP_PORT HIVEMIND_HTTP_PORT: $HIVEMIND_HTTP_PORT
# Configured at gitlab repository settings side # Configured at gitlab repository settings side
POSTGRES_USER: $HIVEMIND_POSTGRES_USER POSTGRES_USER: $HIVEMIND_POSTGRES_USER
...@@ -20,7 +20,6 @@ variables: ...@@ -20,7 +20,6 @@ variables:
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
# official way to provide password to psql: http://www.postgresql.org/docs/9.3/static/libpq-envars.html # official way to provide password to psql: http://www.postgresql.org/docs/9.3/static/libpq-envars.html
PGPASSWORD: $HIVEMIND_POSTGRES_PASSWORD PGPASSWORD: $HIVEMIND_POSTGRES_PASSWORD
DB_URL: "$HIVEMIND_POSTGRESQL_CONNECTION_STRING/$HIVEMIND_DB_NAME"
PYTHONUSERBASE: ./local-site PYTHONUSERBASE: ./local-site
...@@ -60,14 +59,18 @@ hivemind_sync: ...@@ -60,14 +59,18 @@ hivemind_sync:
HIVEMIND_MAX_BLOCK: 50000 HIVEMIND_MAX_BLOCK: 50000
script: script:
- DB_NAME=${HIVEMIND_DB_NAME/-/_}
- DB_URL="$HIVEMIND_POSTGRESQL_CONNECTION_STRING/$HIVEMIND_DB_NAME"
- echo "Corrected db name: $DB_NAME"
- echo "Corrected db url: $DB_URL"
- ls -l dist/* - ls -l dist/*
- rm -rf ./local-site - rm -rf ./local-site
- mkdir -p `python3 -m site --user-site` - mkdir -p `python3 -m site --user-site`
- python3 setup.py install --user --force - python3 setup.py install --user --force
- ./local-site/bin/hive -h - ./local-site/bin/hive -h
- "echo Attempting to recreate database $HIVEMIND_DB_NAME" - "echo Attempting to recreate database $DB_NAME"
- psql -U $POSTGRES_USER -h localhost -d postgres -c "DROP DATABASE IF EXISTS $HIVEMIND_DB_NAME;" - psql -U $POSTGRES_USER -h localhost -d postgres -c "DROP DATABASE IF EXISTS $DB_NAME;"
- psql -U $POSTGRES_USER -h localhost -d postgres -c "CREATE DATABASE $HIVEMIND_DB_NAME;" - psql -U $POSTGRES_USER -h localhost -d postgres -c "CREATE DATABASE $DB_NAME;"
- "echo Attempting to starting hive sync using hived node: $HIVEMIND_SOURCE_HIVED_URL . Max sync block is: $HIVEMIND_MAX_BLOCK" - "echo Attempting to starting hive sync using hived node: $HIVEMIND_SOURCE_HIVED_URL . Max sync block is: $HIVEMIND_MAX_BLOCK"
- echo Attempting to access database $DB_URL - echo Attempting to access database $DB_URL
- ./local-site/bin/hive sync --test-max-block=$HIVEMIND_MAX_BLOCK --exit-after-sync --test-profile=False --steemd-url "$HIVEMIND_SOURCE_HIVED_URL" --database-url $DB_URL 2>&1 | tee -i hivemind-sync.log - ./local-site/bin/hive sync --test-max-block=$HIVEMIND_MAX_BLOCK --exit-after-sync --test-profile=False --steemd-url "$HIVEMIND_SOURCE_HIVED_URL" --database-url $DB_URL 2>&1 | tee -i hivemind-sync.log
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment