Skip to content

Commit 0a26aee

Browse files
committed
Replace manually adding tags with multimod
Signed-off-by: Bogdan <[email protected]>
1 parent 5fbf38f commit 0a26aee

File tree

2 files changed

+13
-32
lines changed

2 files changed

+13
-32
lines changed

Makefile

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -165,35 +165,16 @@ ifndef COMPONENT
165165
$(error COMPONENT variable was not defined)
166166
endif
167167

168-
.PHONY: add-tag
169-
add-tag:
170-
@[ "${TAG}" ] || ( echo ">> env var TAG is not set"; exit 1 )
171-
@echo "Adding tag ${TAG}"
172-
@git tag -a ${TAG} -s -m "Version ${TAG}"
173-
@set -e; for dir in $(ALL_MODULES); do \
174-
(echo Adding tag "$${dir:2}/$${TAG}" && \
175-
git tag -a "$${dir:2}/$${TAG}" -s -m "Version ${dir:2}/${TAG}" ); \
176-
done
177-
178-
.PHONY: push-tag
179-
push-tag:
180-
@[ "${TAG}" ] || ( echo ">> env var TAG is not set"; exit 1 )
181-
@echo "Pushing tag ${TAG}"
182-
@git push [email protected]:open-telemetry/opentelemetry-collector.git ${TAG}
183-
@set -e; for dir in $(ALL_MODULES); do \
184-
(echo Pushing tag "$${dir:2}/$${TAG}" && \
185-
git push [email protected]:open-telemetry/opentelemetry-collector.git "$${dir:2}/$${TAG}"); \
186-
done
187-
188-
.PHONY: delete-tag
189-
delete-tag:
190-
@[ "${TAG}" ] || ( echo ">> env var TAG is not set"; exit 1 )
191-
@echo "Deleting tag ${TAG}"
192-
@git tag -d ${TAG}
193-
@set -e; for dir in $(ALL_MODULES); do \
194-
(echo Deleting tag "$${dir:2}/$${TAG}" && \
195-
git tag -d "$${dir:2}/$${TAG}" ); \
196-
done
168+
COMMIT?=HEAD
169+
MODSET?=stable
170+
REMOTE?[email protected]:open-telemetry/opentelemetry-collector.git
171+
.PHONY: push-tags
172+
push-tags:
173+
multimod verify
174+
set -e; for tag in `multimod tag -m ${MODSET} -c ${COMMIT} --print-tags | grep -v "Using" `; do \
175+
echo "pushing tag $${tag}"; \
176+
git push ${REMOTE} $${tag}; \
177+
done;
197178

198179
# Build the Collector executable.
199180
.PHONY: otelcorecol

docs/release.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ It is possible that a core approver isn't a contrib approver. In that case, the
4848

4949
1. Create a branch named `release/<release-series>` (e.g. `release/v0.45.x`) from the changelog update commit and push to `open-telemetry/opentelemetry-collector`.
5050

51-
1. Tag all the modules with the new release version by running the `make add-tag` command (e.g. `make add-tag TAG=v0.55.0`). Push them to `open-telemetry/opentelemetry-collector` with `make push-tag TAG=v0.55.0`. Wait for the new tag build to pass successfully.
51+
1. Tag all the module groups (stable, beta) with the new release version by running the `make push-tags` command (e.g. `make push-tags MODSET=stable`). Wait for the new tag build to pass successfully.
5252

5353
1. The release script for the collector builder should create a new GitHub release for the builder. This is a separate release from the core, but we might join them in the future if it makes sense.
5454

@@ -75,7 +75,7 @@ It is possible that a core approver isn't a contrib approver. In that case, the
7575

7676
1. Create a branch named `release/<release-series>` (e.g. `release/v0.45.x`) in Contrib from the changelog update commit and push it to `open-telemetry/opentelemetry-collector-contrib`.
7777

78-
1. Tag all the modules with the new release version by running the `make add-tag TAG=v0.55.0` command. Push them to `open-telemetry/opentelemetry-collector-contrib` with `make push-tag TAG=v0.55.0`. Wait for the new tag build to pass successfully.
78+
1. Tag all the module groups (`contrib-base`) with the new release version by running the `make push-tags MODSET=contrib-base` command. Wait for the new tag build to pass successfully.
7979

8080
1. A new `v0.55.0` release should be automatically created on Github by now. Edit it and use the contents from the CHANGELOG.md as the release's description. At the top of the description add a link to Core release notes (assuming the previous release of Core and Contrib was also performed simultaneously), e.g. "The OpenTelemetry Collector Contrib contains everything in the [opentelemetry-collector release](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.55.0) (be sure to check the release notes here as well!)."
8181

@@ -89,7 +89,7 @@ The last step of the release process creates artifacts for the new version of th
8989

9090
1. Create a pull request with the change and ensure the build completes successfully. See [example](https://github.com/open-telemetry/opentelemetry-collector-releases/pull/71).
9191

92-
1. Tag with the new release version by running the `make add-tag TAG=v0.55.0` command. Push them to `open-telemetry/opentelemetry-collector-releases` with `make push-tag TAG=v0.55.0`. Wait for the new tag build to pass successfully.
92+
1. Tag with the new release version by running the `make push-tags TAG=v0.55.0` command. Wait for the new tag build to pass successfully.
9393

9494
1. Ensure the "Release" action passes, this will
9595

0 commit comments

Comments
 (0)