Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare CI for our internal release train #828

Merged
merged 4 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ steps:
- name: image-tag
image: alpine/git
commands:
- apk --update --no-cache add bash
- git fetch origin --tags
- echo $(./tools/image-tag) > .tags

Expand All @@ -36,6 +37,8 @@ trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/heads/r? # For weekly release
- refs/heads/r?? # For weekly release
kvrhdn marked this conversation as resolved.
Show resolved Hide resolved

---
## AMD64 ##
Expand All @@ -50,6 +53,7 @@ steps:
- name: image-tag
image: alpine/git
commands:
- apk --update --no-cache add bash
- git fetch origin --tags
- echo $(./tools/image-tag)-amd64 > .tags

Expand Down Expand Up @@ -90,6 +94,8 @@ trigger:
ref:
- refs/heads/main
- refs/tags/v*
- refs/heads/r? # For weekly release
- refs/heads/r?? # For weekly release

---
## ARM64 ##
Expand All @@ -104,6 +110,7 @@ steps:
- name: image-tag
image: alpine/git
commands:
- apk --update --no-cache add bash
- git fetch origin --tags
- echo $(./tools/image-tag)-arm64 > .tags

Expand Down Expand Up @@ -144,6 +151,8 @@ trigger:
ref:
- refs/heads/main
- refs/tags/v*
- refs/heads/r? # For weekly release
- refs/heads/r?? # For weekly release

---
## MANIFEST ##
Expand All @@ -158,6 +167,7 @@ steps:
- name: image-tag
image: alpine/git
commands:
- apk --update --no-cache add bash
- git fetch origin --tags
- echo $(./tools/image-tag) > .tags

Expand Down Expand Up @@ -189,6 +199,8 @@ trigger:
ref:
- refs/heads/main
- refs/tags/v*
- refs/heads/r? # For weekly release
- refs/heads/r?? # For weekly release

---
kind: secret
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* [ENHANCEMENT] Add `-config.expand-env` cli flag to support environment variables expansion in config file. [#796](https://github.com/grafana/tempo/pull/796) (@Ashmita152)
* [ENHANCEMENT] Emit traces for ingester flush operations. [#812](https://github.com/grafana/tempo/pull/812) (@bboreham)
* [ENHANCEMENT] Add retry middleware in query-frontend. [#814](https://github.com/grafana/tempo/pull/814) (@kvrhdn)
* [CHANGE] Docker images are now prefixed by their branch name [#828](https://github.com/grafana/tempo/pull/828) (@jvrplmlmn)

## v1.0.1

Expand Down
16 changes: 11 additions & 5 deletions tools/image-tag
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

annanay25 marked this conversation as resolved.
Show resolved Hide resolved
set -o errexit
set -o nounset
set -o pipefail

SHA="$(git rev-parse --short HEAD)"
WIP=$(git diff --quiet || echo '-WIP')
kvrhdn marked this conversation as resolved.
Show resolved Hide resolved
BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's#/#-#g')
# When 7 chars are not enough to be unique, git automatically uses more.
# We are forcing to 7 here, as we are doing for grafana/grafana as well.
SHA=$(git rev-parse --short=7 HEAD | head -c7)

# If not a tag, use branch-hash else use tag
TAG=$((git describe --exact-match 2> /dev/null || echo "") | sed 's/v//g')

# If tag, use tag
TAG=$( (git describe --exact-match 2> /dev/null || echo "") | sed 's/v//g')
if [ -z "$TAG" ]
then
echo ${SHA}
echo ${BRANCH}-${SHA}${WIP}
jvrplmlmn marked this conversation as resolved.
Show resolved Hide resolved
else
echo ${TAG}
fi