From 9fdc1e29720eff766898c5839e1eba0e0929e8e4 Mon Sep 17 00:00:00 2001 From: cnichols Date: Thu, 27 Apr 2023 16:53:25 -0700 Subject: [PATCH] Add multi-platform build/push Add release instructions Separate build/release commands --- Makefile | 9 ++++++++- README.md | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ae50410..05254fc 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,14 @@ image_name=newrelic/fastly-to-insights +require_tag: + @if [ -z "$(tag)" ]; then echo "tag must be set" && exit 1; fi + @if [ "$(tag)" != "$(shell git describe --tags --exact-match)" ]; then echo "please checkout requested tag: $(tag)" && exit 1; fi + +release: require_tag + docker buildx build --platform linux/amd64,linux/arm64 --push -t $(image_name):$(tag) . + build: - docker build -t $(image_name) . + docker buildx build --platform linux/amd64,linux/arm64 -t $(image_name) . run: build docker run --rm --env-file .env --name fastly-to-insights $(image_name) diff --git a/README.md b/README.md index adde442..d1280f8 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,10 @@ You are welcome to send pull requests to us - however, by doing so you agree tha A Makefile is provided which you can use to build and run the fastly to insights integration locally -- `make run` will build and then run the image. You can provide configuration via a `.env` file (`.env.example` provided as an example). +## Releasing + +To release a new image, make sure you've created a tag for your release, check it out and then run `make release tag=`. This will build the Docker image and push it to DockerHub. + ## More Information For more information on the Fastly Real-Time Analytics API, look [here](https://docs.fastly.com/api/analytics).