Skip to content

Commit

Permalink
chore: make clean and docker cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsenta authored Jul 26, 2023
2 parents 150a3df + 3211d60 commit 182dd47
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-kubo-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
cars=$(find ./fixtures -name '*.car')
for car in $cars
do
ipfs dag import "$car" --pin-roots=false
ipfs dag import --pin-roots=false --stats "$car"
done
# Import ipns records
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
/merge-fixtures
/entrypoint
/gateway-conformance
/dnslinks.json
/*.ipns-record

# Logs
logs
Expand Down
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
all: test-kubo
all: gateway-conformance

clean: clean-docker
rm -f ./gateway-conformance
rm -f *.ipns-record
rm -f fixtures.car
rm -f dnslinks.json
rm -f ./reports/*

test-cargateway: provision-cargateway fixtures.car gateway-conformance
./gateway-conformance test --json reports/output.json --gateway-url http://127.0.0.1:8040 --specs -subdomain-gateway
Expand Down Expand Up @@ -31,12 +38,17 @@ test-docker: docker fixtures.car gateway-conformance
./reports/output.xml: ./reports/output.json
jq -ns 'inputs' ./reports/output.json > ./reports/output.json.alt
docker run --rm -v "${PWD}:/workspace" -w "/workspace" ghcr.io/pl-strflt/saxon:v1 -json:"./reports/output.json.alt" -xsl:/etc/gotest.xsl -o:"./reports/output.xml"

./reports/output.html: ./reports/output.xml
docker run --rm -v "${PWD}:/workspace" -w "/workspace" ghcr.io/pl-strflt/saxon:v1 -s:./reports/output.xml -xsl:/etc/junit-noframes-saxon.xsl -o:./reports/output.html
open ./reports/output.html

docker:
docker build -t gateway-conformance .

clean-docker:
@if command -v docker >/dev/null 2>&1 && docker image inspect gateway-conformance >/dev/null 2>&1; then \
docker image rm gateway-conformance; \
fi

.PHONY: gateway-conformance
7 changes: 6 additions & 1 deletion gc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/usr/bin/env bash

docker run --rm -v "${PWD}:/workspace" -w "/workspace" --network=host gateway-conformance "$@"
if docker image inspect gateway-conformance >/dev/null 2>&1; then
docker run --rm -v "${PWD}:/workspace" -w "/workspace" --network=host gateway-conformance "$@"
else
echo "Docker image 'gateway-conformance' does not exist. Run 'make docker' first." >&2
exit 1
fi

0 comments on commit 182dd47

Please sign in to comment.