Skip to content

Commit 508e996

Browse files
authored
chore: fix test-registry Makefile target (#196)
1 parent 85290fa commit 508e996

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

Makefile

+16-10
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,44 @@ docs: options.go
1414
go run ./scripts/docsgen/main.go
1515

1616
.PHONY: test
17-
test: test-registry test-images
17+
test: test-registry
1818
go test -count=1 ./...
1919

2020
test-race:
2121
go test -race -count=3 ./...
2222

2323
# Starts a local Docker registry on port 5000 with a local disk cache.
2424
.PHONY: test-registry
25-
test-registry: .registry-cache
25+
test-registry: test-registry-container test-images-pull test-images-push
26+
27+
.PHONY: test-registry-container
28+
test-registry-container: .registry-cache
2629
if ! curl -fsSL http://localhost:5000/v2/_catalog > /dev/null 2>&1; then \
2730
docker rm -f envbuilder-registry && \
2831
docker run -d -p 5000:5000 --name envbuilder-registry --volume $(PWD)/.registry-cache:/var/lib/registry registry:2; \
2932
fi
3033

3134
# Pulls images referenced in integration tests and pushes them to the local cache.
32-
.PHONY: test-images
33-
test-images: .registry-cache .registry-cache/docker/registry/v2/repositories/envbuilder-test-alpine .registry-cache/docker/registry/v2/repositories/envbuilder-test-ubuntu .registry-cache/docker/registry/v2/repositories/envbuilder-test-codercom-code-server
35+
.PHONY: test-images-push
36+
test-images-push: .registry-cache/docker/registry/v2/repositories/envbuilder-test-alpine .registry-cache/docker/registry/v2/repositories/envbuilder-test-ubuntu .registry-cache/docker/registry/v2/repositories/envbuilder-test-codercom-code-server
37+
38+
.PHONY: test-images-pull
39+
test-images-pull:
40+
docker pull alpine:latest
41+
docker tag alpine:latest localhost:5000/envbuilder-test-alpine:latest
42+
docker pull ubuntu:latest
43+
docker tag ubuntu:latest localhost:5000/envbuilder-test-ubuntu:latest
44+
docker pull codercom/code-server:latest
45+
docker tag codercom/code-server:latest localhost:5000/envbuilder-test-codercom-code-server:latest
3446

3547
.registry-cache:
3648
mkdir -p .registry-cache && chmod -R ag+w .registry-cache
3749

3850
.registry-cache/docker/registry/v2/repositories/envbuilder-test-alpine:
39-
docker pull alpine:latest
40-
docker tag alpine:latest localhost:5000/envbuilder-test-alpine:latest
4151
docker push localhost:5000/envbuilder-test-alpine:latest
4252

4353
.registry-cache/docker/registry/v2/repositories/envbuilder-test-ubuntu:
44-
docker pull ubuntu:latest
45-
docker tag ubuntu:latest localhost:5000/envbuilder-test-ubuntu:latest
4654
docker push localhost:5000/envbuilder-test-ubuntu:latest
4755

4856
.registry-cache/docker/registry/v2/repositories/envbuilder-test-codercom-code-server:
49-
docker pull codercom/code-server:latest
50-
docker tag codercom/code-server:latest localhost:5000/envbuilder-test-codercom-code-server:latest
5157
docker push localhost:5000/envbuilder-test-codercom-code-server:latest

0 commit comments

Comments
 (0)