Skip to content

Commit

Permalink
Replace manually adding tags with multimod (open-telemetry#6292)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan <[email protected]>

Signed-off-by: Bogdan <[email protected]>
  • Loading branch information
bogdandrutu authored and jaronoff97 committed Dec 14, 2022
1 parent 3d6a19c commit f5e033c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 32 deletions.
39 changes: 10 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,35 +165,16 @@ ifndef COMPONENT
$(error COMPONENT variable was not defined)
endif

.PHONY: add-tag
add-tag:
@[ "${TAG}" ] || ( echo ">> env var TAG is not set"; exit 1 )
@echo "Adding tag ${TAG}"
@git tag -a ${TAG} -s -m "Version ${TAG}"
@set -e; for dir in $(ALL_MODULES); do \
(echo Adding tag "$${dir:2}/$${TAG}" && \
git tag -a "$${dir:2}/$${TAG}" -s -m "Version ${dir:2}/${TAG}" ); \
done

.PHONY: push-tag
push-tag:
@[ "${TAG}" ] || ( echo ">> env var TAG is not set"; exit 1 )
@echo "Pushing tag ${TAG}"
@git push [email protected]:open-telemetry/opentelemetry-collector.git ${TAG}
@set -e; for dir in $(ALL_MODULES); do \
(echo Pushing tag "$${dir:2}/$${TAG}" && \
git push [email protected]:open-telemetry/opentelemetry-collector.git "$${dir:2}/$${TAG}"); \
done

.PHONY: delete-tag
delete-tag:
@[ "${TAG}" ] || ( echo ">> env var TAG is not set"; exit 1 )
@echo "Deleting tag ${TAG}"
@git tag -d ${TAG}
@set -e; for dir in $(ALL_MODULES); do \
(echo Deleting tag "$${dir:2}/$${TAG}" && \
git tag -d "$${dir:2}/$${TAG}" ); \
done
COMMIT?=HEAD
MODSET?=stable
REMOTE?[email protected]:open-telemetry/opentelemetry-collector.git
.PHONY: push-tags
push-tags:
multimod verify
set -e; for tag in `multimod tag -m ${MODSET} -c ${COMMIT} --print-tags | grep -v "Using" `; do \
echo "pushing tag $${tag}"; \
git push ${REMOTE} $${tag}; \
done;

# Build the Collector executable.
.PHONY: otelcorecol
Expand Down
6 changes: 3 additions & 3 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ It is possible that a core approver isn't a contrib approver. In that case, the

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`.

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.
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` and `make push-tags MODSET=beta`). Wait for the new tag build to pass successfully.

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.

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

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`.

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.
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.

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!)."

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

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).

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.
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.

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

Expand Down

0 comments on commit f5e033c

Please sign in to comment.