Skip to content

Commit

Permalink
chore: Update build instructions for build image
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Haudum <[email protected]>
  • Loading branch information
chaudum committed Oct 4, 2024
1 parent a3ed3e7 commit 458be8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ else
endif

build-image: ensure-buildx-builder
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-build-image:$(IMAGE_TAG) ./loki-build-image
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-build-image:$(BUILD_IMAGE_VERSION) ./loki-build-image
build-image-push: build-image ## push the docker build image
ifneq (,$(findstring WIP,$(IMAGE_TAG)))
@echo "Cannot push a WIP image, commit changes first"; \
Expand Down
28 changes: 8 additions & 20 deletions docs/sources/community/maintaining/release-loki-build-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,11 @@ if any changes were made in the folder `./loki-build-image/`.

**To build and use the `loki-build-image`:**

## Step 1

1. Create a branch with the desired changes to the Dockerfile.
2. Update the version tag of the `loki-build-image` pipeline defined in `.drone/drone.jsonnet` (search for `pipeline('loki-build-image')`) to a new version number (try to follow semver).
3. Run `DRONE_SERVER=https://drone.grafana.net/ DRONE_TOKEN=<token> make drone` and commit the changes to the same branch.
1. The `<token>` is your personal drone token, which can be found by navigating to https://drone.grafana.net/account.
4. Create a PR.
5. Once approved and merged to `main`, the image with the new version is built and published.
{{% admonition type="note" %}}
Keep an eye on https://drone.grafana.net/grafana/loki for the build after merging ([example](https://drone.grafana.net/grafana/loki/17760/1/2)).
{{% /admonition %}}

## Step 2

1. Create a branch.
2. Update the `BUILD_IMAGE_VERSION` variable in the `Makefile`.
3. Run `loki-build-image/version-updater.sh <new-version>` to update all the references.
4. Run `DRONE_SERVER=https://drone.grafana.net/ DRONE_TOKEN=<token> make drone` to update the Drone config to use the new build image.
5. Create a new PR.

1. Create a branch with the desired changes to the `./loki-build-image/Dockerfile`.
1. Update the `BUILD_IMAGE_VERSION` variable in the `Makefile`.
1. Commit your changes.
1. Run `make build-image-push` to build and publish the new version of the build image.
1. Run `make release-workflows` to update the Github workflows.
1. Commit your changes.
1. Push your changes to the remote branch.
1. Open a PR against the `main` branch.

0 comments on commit 458be8f

Please sign in to comment.