Skip to content

Commit

Permalink
Create entrypoint bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-snx committed Oct 29, 2024
1 parent cde7a83 commit 3623f3c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
5 changes: 4 additions & 1 deletion indexers-v2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ COPY . .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

ENTRYPOINT ["sh", "-c", "python3 main.py --network_name \"$NETWORK_NAME\" --rpc_endpoint \"$RPC_ENDPOINT\" && npm run generate:processor && npm run build && (npm run generate:migration || true) && npm run start"]
COPY entrypoint.sh .
RUN chmod +x entrypoint.sh

ENTRYPOINT ["./entrypoint.sh"]
19 changes: 19 additions & 0 deletions indexers-v2/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Exit on error
set -e

# Get contract data from SDK and generate squidgen.yaml and squid.yaml
python3 main.py --network_name "$NETWORK_NAME" --rpc_endpoint "$RPC_ENDPOINT"

# Generate squid processor
npm run generate:processor

# Build squid processor
npm run build

# Run migrations (continue if it fails e.g. if migrations already ran)
npm run generate:migration || true

# Start the squid processor
npm run start

0 comments on commit 3623f3c

Please sign in to comment.