mirror of
https://github.com/coder/terraform-provider-envbuilder.git
synced 2025-11-03 11:08:59 +00:00
implement first pass at cached image data source (#3)
implements envbuilder_cached_image data source
This commit is contained in:
parent
1a49822fc9
commit
c9e7cb8178
10 changed files with 1698 additions and 147 deletions
31
GNUmakefile
31
GNUmakefile
|
|
@ -17,3 +17,34 @@ build: terraform-provider-envbuilder
|
|||
|
||||
terraform-provider-envbuilder: internal/provider/*.go main.go
|
||||
CGO_ENABLED=0 go build .
|
||||
|
||||
.PHONY: update-envbuilder-version
|
||||
update-envbuilder-version:
|
||||
go get github.com/coder/envbuilder@main
|
||||
go mod tidy
|
||||
|
||||
# Starts a local Docker registry on port 5000 with a local disk cache.
|
||||
.PHONY: test-registry
|
||||
test-registry: test-registry-container test-images-pull test-images-push
|
||||
|
||||
.PHONY: test-registry-container
|
||||
test-registry-container: .registry-cache
|
||||
if ! curl -fsSL http://localhost:5000/v2/_catalog > /dev/null 2>&1; then \
|
||||
docker rm -f tfprov-envbuilder-registry && \
|
||||
docker run -d -p 5000:5000 --name envbuilder-registry --volume $(PWD)/.registry-cache:/var/lib/registry registry:2; \
|
||||
fi
|
||||
|
||||
# Pulls images referenced in integration tests and pushes them to the local cache.
|
||||
.PHONY: test-images-push
|
||||
test-images-push: .registry-cache/docker/registry/v2/repositories/test-ubuntu
|
||||
|
||||
.PHONY: test-images-pull
|
||||
test-images-pull:
|
||||
docker pull ubuntu:latest
|
||||
docker tag ubuntu:latest localhost:5000/test-ubuntu:latest
|
||||
|
||||
.registry-cache:
|
||||
mkdir -p .registry-cache && chmod -R ag+w .registry-cache
|
||||
|
||||
.registry-cache/docker/registry/v2/repositories/test-ubuntu:
|
||||
docker push localhost:5000/test-ubuntu:latest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue