forked from cerc-io/ipld-eth-server
Use ipld-eth-db docker image.
This commit is contained in:
parent
2a1ec043b8
commit
25b49f784b
4
.github/workflows/on-pr.yaml
vendored
4
.github/workflows/on-pr.yaml
vendored
@ -28,7 +28,7 @@ jobs:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run database
|
||||
run: docker-compose up -d db
|
||||
run: docker-compose up -d ipld-eth-db
|
||||
- name: Test
|
||||
run: |
|
||||
sleep 10
|
||||
@ -52,7 +52,7 @@ jobs:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run database
|
||||
run: docker-compose -f docker-compose.test.yml -f docker-compose.yml up -d db dapptools contract eth-server
|
||||
run: docker-compose -f docker-compose.test.yml -f docker-compose.yml up -d ipld-eth-db dapptools contract eth-server
|
||||
- name: Test
|
||||
run: |
|
||||
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8081)" != "200" ]; do echo "waiting for ipld-eth-server..." && sleep 5; done && \
|
||||
|
4
Makefile
4
Makefile
@ -57,10 +57,6 @@ TEST_CONNECT_STRING_LOCAL = postgresql://$(USER)@$(HOST_NAME):$(PORT)/$(TEST_DB)
|
||||
test: | $(GINKGO) $(GOOSE)
|
||||
go vet ./...
|
||||
go fmt ./...
|
||||
export PGPASSWORD=$(DATABASE_PASSWORD)
|
||||
dropdb -h $(DATABASE_HOSTNAME) -p $(DATABASE_PORT) -U $(DATABASE_USER) --if-exists $(TEST_DB)
|
||||
createdb -h $(DATABASE_HOSTNAME) -p $(DATABASE_PORT) -U $(DATABASE_USER) $(TEST_DB)
|
||||
$(GOOSE) -dir db/migrations postgres "$(TEST_CONNECT_STRING)" up
|
||||
$(GINKGO) -r --skipPackage=test
|
||||
|
||||
.PHONY: integrationtest
|
||||
|
@ -4,33 +4,21 @@ services:
|
||||
dapptools:
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- statediff-migrations
|
||||
- ipld-eth-db
|
||||
image: vulcanize/dapptools:v0.30.0-v1.10.9-statediff-0.0.27
|
||||
environment:
|
||||
DB_USER: vdbm
|
||||
DB_NAME: vulcanize_public
|
||||
DB_HOST: db
|
||||
DB_HOST: ipld-eth-db
|
||||
DB_PORT: 5432
|
||||
DB_PASSWORD: password
|
||||
ports:
|
||||
- "127.0.0.1:8545:8545"
|
||||
- "127.0.0.1:8546:8546"
|
||||
|
||||
statediff-migrations:
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- db
|
||||
image: vulcanize/statediff-migrations:v0.8.0
|
||||
environment:
|
||||
DATABASE_USER: vdbm
|
||||
DATABASE_NAME: vulcanize_public
|
||||
DATABASE_HOSTNAME: db
|
||||
DATABASE_PORT: 5432
|
||||
DATABASE_PASSWORD: password
|
||||
|
||||
db:
|
||||
ipld-eth-db:
|
||||
restart: always
|
||||
image: postgres:10.12-alpine
|
||||
image: vulcanize/ipld-eth-db:v0.2.0
|
||||
environment:
|
||||
POSTGRES_USER: "vdbm"
|
||||
POSTGRES_DB: "vulcanize_public"
|
||||
@ -44,7 +32,7 @@ services:
|
||||
eth-server:
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- db
|
||||
- ipld-eth-db
|
||||
build:
|
||||
context: ./
|
||||
cache_from:
|
||||
@ -57,7 +45,7 @@ services:
|
||||
VDB_COMMAND: "serve"
|
||||
ETH_CHAIN_CONFIG: "/tmp/chain.json"
|
||||
DATABASE_NAME: "vulcanize_public"
|
||||
DATABASE_HOSTNAME: "db"
|
||||
DATABASE_HOSTNAME: "ipld-eth-db"
|
||||
DATABASE_PORT: 5432
|
||||
DATABASE_USER: "vdbm"
|
||||
DATABASE_PASSWORD: "password"
|
||||
@ -73,7 +61,7 @@ services:
|
||||
graphql:
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- db
|
||||
- ipld-eth-db
|
||||
image: vulcanize/postgraphile:v1.0.1
|
||||
environment:
|
||||
- PG_HOST=db
|
||||
|
@ -188,7 +188,7 @@ func SetupDB() (*postgres.DB, error) {
|
||||
User: "vdbm",
|
||||
Password: "password",
|
||||
Hostname: "localhost",
|
||||
Name: "vulcanize_testing",
|
||||
Name: "vulcanize_public",
|
||||
Port: 8077,
|
||||
})
|
||||
return postgres.NewDB(uri, postgres.ConnectionConfig{}, node.Info{})
|
||||
|
@ -49,7 +49,7 @@ func SetupDB() (*postgres.DB, error) {
|
||||
User: "vdbm",
|
||||
Password: "password",
|
||||
Hostname: "localhost",
|
||||
Name: "vulcanize_testing",
|
||||
Name: "vulcanize_public",
|
||||
Port: 8077,
|
||||
})
|
||||
return postgres.NewDB(uri, postgres.ConnectionConfig{}, node.Info{})
|
||||
|
@ -7,7 +7,7 @@ docker-compose down --remove-orphans --volumes
|
||||
# Build and start the containers.
|
||||
# Note: Build only if `ipld-eth-server` or other container code is modified. Otherwise comment this line.
|
||||
docker-compose -f docker-compose.test.yml -f docker-compose.yml build eth-server
|
||||
docker-compose -f docker-compose.test.yml -f docker-compose.yml up -d db dapptools contract eth-server
|
||||
docker-compose -f docker-compose.test.yml -f docker-compose.yml up -d ipld-eth-db dapptools contract eth-server
|
||||
|
||||
export PGPASSWORD=password
|
||||
export DATABASE_USER=vdbm
|
||||
|
Loading…
Reference in New Issue
Block a user