Skip to content

Commit

Permalink
Add tagging script
Browse files Browse the repository at this point in the history
Add a script that will create and push tags
to the upstream repo, for each module.
  • Loading branch information
axw committed Jan 17, 2019
1 parent 4befd75 commit 981178c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,9 @@ adequately cover the code using `go test -cover`.
2. Update CHANGELOG.md, adding a new version heading and changing the base tag of the Unreleased comparison URL
3. Merge changes into github.com/elastic/apm-agent-go@master
4. Create tags: vN.N.N, and module/$MODULE/vN.N.N for each instrumentation module

scripts/tagversion.sh

5. Create release on GitHub

hub release -d vN.N.N
23 changes: 23 additions & 0 deletions scripts/tagversion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
set -e

export GO111MODULE=on

prefix=go.elastic.co/apm
version=$(sed 's@^\s*AgentVersion = "\(.*\)"$@\1@;t;d' version.go)
modules=$(for dir in $(./scripts/moduledirs.sh); do (cd $dir && go list -m); done | grep $prefix/)

echo "# Create tags"
for m in "" $modules; do
p=$(echo $m | sed "s@^$prefix/\(.\{0,\}\)@\1/@")
echo git tag -s ${p}v$version -m v$version
done

echo
echo "# Push tags"
echo -n git push upstream
for m in "" $modules; do
p=$(echo $m | sed "s@^$prefix/\(.\{0,\}\)@\1/@")
echo -n " ${p}v$version"
done
echo

0 comments on commit 981178c

Please sign in to comment.