mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-11-03 20:37:24 +03:00
packaging/cli-migrations: Clean up curl containers.
We don't want to leave these curl containers lying around. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8002 GitOrigin-RevId: 5ceabc1cbe0a07fe4831b4752b6f71e79444a346
This commit is contained in:
parent
b72173c8cb
commit
d1ddf27159
@ -8,7 +8,7 @@ wait_for_server() {
|
||||
echo "waiting for server"
|
||||
for _ in $(seq 1 60);
|
||||
do
|
||||
docker run --network container:graphql-engine curlimages/curl http://127.0.0.1:8080/v1/version && return
|
||||
docker run --rm --network container:graphql-engine curlimages/curl http://127.0.0.1:8080/v1/version && return
|
||||
echo -n .
|
||||
sleep 1
|
||||
done
|
||||
@ -29,16 +29,16 @@ docker cp metadata/. graphql-engine:/hasura-metadata
|
||||
docker-compose -f docker-compose-latest.yaml up -d --no-recreate graphql-engine
|
||||
wait_for_server
|
||||
# export metadata and run diff with validation/metadata.json
|
||||
docker run --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "export_metadata", "args" : {} }' localhost:8080/v1/query | jq -j '.' | diff validation/metadata.json -
|
||||
docker run --rm --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "export_metadata", "args" : {} }' localhost:8080/v1/query | jq -j '.' | diff validation/metadata.json -
|
||||
# get list of migrations applied from graphql-engine server
|
||||
docker run --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "run_sql", "args" : {"sql": "select * from hdb_catalog.schema_migrations"} }' localhost:8080/v1/query | jq -j '.' | diff validation/schema_migrations.json -
|
||||
docker run --rm --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "run_sql", "args" : {"sql": "select * from hdb_catalog.schema_migrations"} }' localhost:8080/v1/query | jq -j '.' | diff validation/schema_migrations.json -
|
||||
|
||||
# use the current build to start container
|
||||
docker-compose up -d
|
||||
wait_for_server
|
||||
# export metadata and run diff with validation/metadata.json
|
||||
docker run --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "export_metadata", "args" : {} }' localhost:8080/v1/query | jq -j '.' | diff validation/metadata.json -
|
||||
docker run --rm --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "export_metadata", "args" : {} }' localhost:8080/v1/query | jq -j '.' | diff validation/metadata.json -
|
||||
# get list of migrations applied from graphql-engine server
|
||||
docker run --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "run_sql", "args" : {"sql": "select * from hdb_catalog.schema_migrations"} }' localhost:8080/v1/query | jq -j '.' | diff validation/schema_migrations.json -
|
||||
docker run --rm --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "run_sql", "args" : {"sql": "select * from hdb_catalog.schema_migrations"} }' localhost:8080/v1/query | jq -j '.' | diff validation/schema_migrations.json -
|
||||
# delete postgres and graphql-engine
|
||||
docker-compose down -v
|
||||
|
@ -38,8 +38,8 @@ docker cp metadata/. graphql-engine:/hasura-metadata
|
||||
docker-compose up -d --no-recreate graphql-engine
|
||||
wait_for_server
|
||||
# export metadata and run diff with validation/metadata.json
|
||||
docker run --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "export_metadata", "args" : {} }' localhost:8080/v1/query | jq -j '.' | diff validation/metadata.json -
|
||||
docker run --rm --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "export_metadata", "args" : {} }' localhost:8080/v1/query | jq -j '.' | diff validation/metadata.json -
|
||||
# get list of migrations applied from graphql-engine server
|
||||
docker run --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "run_sql", "args" : {"sql": "select * from hdb_catalog.schema_migrations"} }' localhost:8080/v1/query | jq -j '.' | diff validation/schema_migrations.json -
|
||||
docker run --rm --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "run_sql", "args" : {"sql": "select * from hdb_catalog.schema_migrations"} }' localhost:8080/v1/query | jq -j '.' | diff validation/schema_migrations.json -
|
||||
# delete postgres and graphql-engine
|
||||
docker-compose down -v
|
||||
docker-compose down -v
|
||||
|
@ -35,8 +35,8 @@ docker cp metadata/. graphql-engine:/hasura-metadata
|
||||
docker-compose up -d --no-recreate graphql-engine
|
||||
wait_for_server
|
||||
# export metadata and run diff with validation/metadata.json
|
||||
docker run --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "export_metadata", "args" : {} }' localhost:8080/v1/metadata | jq -j '.' | diff validation/metadata.json -
|
||||
docker run --rm --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "export_metadata", "args" : {} }' localhost:8080/v1/metadata | jq -j '.' | diff validation/metadata.json -
|
||||
# get list of migrations applied from graphql-engine server
|
||||
docker run --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "get_catalog_state", "args" : {} }' localhost:8080/v1/metadata | jq .cli_state | diff validation/catalog_cli_state.json -
|
||||
docker run --rm --network container:graphql-engine curlimages/curl -s -f -d'{"type" : "get_catalog_state", "args" : {} }' localhost:8080/v1/metadata | jq .cli_state | diff validation/catalog_cli_state.json -
|
||||
# delete postgres and graphql-engine
|
||||
docker-compose down -v
|
||||
docker-compose down -v
|
||||
|
Loading…
Reference in New Issue
Block a user