[10.4.x] backport CI / release changes (#89631)
* Chore: Add go workspace (#83191) --------- Co-authored-by: ismail simsek <ismailsimsek09@gmail.com> * CI: Make pkg/build its own module, remove unused Grafana modules in go.mo… (#89243) * Make pkg/build its own module, remove unused Grafana modules in go.mod/go.sum * fix go.work format * log errors on file close errors * CI: Add release-pr workflow (#89005) * Add release-pr workflow * update CODEOWNERS * CI: Trigger release pr workflow when a release is completed (#89062) * Automation: Verify release artifacts on grafana.com (#89197) * baldm0mma/verify_release/ create verify_release_for_download function * baldm0mma/verify_release/ add name, image, env * baldm0mma/verify_release/ add initial commands * baldm0mma/verify_release/ add deps? * baldm0mma/verify_release/ update location * baldm0mma/verify_release/ add anno to lib-star * bald0mma/verify_release/ update func name to verify_grafanacom_step * baldm0mma/verify_release/ add verify shell script * baldm0mma/verify_release/ add script content, first attempt * baldm0mma/verify_release/ add node image to verify_grafanacom_step * baldm0mma/verify_release/ add gcom secret note * baldm0mma/verify_release/ add sudo to apt-get * baldm0mma/verify_release/ add anno * baldm0mma/verify_release/ add anno to secrets * baldm0mma/verify_release/ update commands to reflect node env image * baldm0mma/verify_release/ update annos * baldm0mma/verify_release/ update tag variable * baldm0mma/verify release/ add whitespace * baldm0mma/verify_releases/ update with no bash loops * baldm0mma/verify_release/ update exit logic * baldm0mma/verify_release/ remove annos * baldm0mma/verify_releasse/ resign and build yml * baldm0mma/verify_release/ remove annos * baldm0mma/verify_release/ update signature * baldm0mma/verify_release/ download curl * baldm0mma/verify_release/ remove temp key folder removal * baldm0mma/verify_release/ account for artifact download time * baldm0mma/verify_release/ add anno * baldm0mma/verify_release/ update location * baldm0mma/verify_release/ update script * baldm0mma/verify_release/ make drone * baldm0mma/verify_release/ update script for oss or ent * baldm0mma/verify_release/ add promotion option * baldm0mma/verify_release/ make drone * Update scripts/drone/events/release.star Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com> * Update scripts/drone/steps/lib.star Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com> * Update scripts/drone/steps/lib.star Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com> * baldm0mma/verify_release/ update drone * Update scripts/drone/events/release.star Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com> * baldm0mma/verify_release/ update drone * Update scripts/drone/steps/lib.star Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com> * baldm0mma/update drone * baldm0mma/verify_release/ update path * baldm0mma/verify_release/ make drone * baldm0mma/update drone * Apply suggestions from code review Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com> * baldm0mma/verify_release/ update for loop to account for failure * baldm0mma/verify_release/ make drone * baldm0mma/verify_release/ make format-drone * baldm0mma/verify_release/ rem unused var --------- Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com> --------- Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com> Co-authored-by: ismail simsek <ismailsimsek09@gmail.com> Co-authored-by: Jev Forsberg <46619047+baldm0mma@users.noreply.github.com>
This commit is contained in:
co-authored by
ismail simsek
Todd Treece
Jev Forsberg
parent
e95b1e838c
commit
8e9aa45716
@@ -506,7 +506,7 @@ def test_backend_step():
|
||||
# shared-mime-info and shared-mime-info-lang is used for exactly 1 test for the
|
||||
# mime.TypeByExtension function.
|
||||
"apk add --update build-base shared-mime-info shared-mime-info-lang",
|
||||
"go test -tags requires_buildifer -short -covermode=atomic -timeout=5m ./pkg/...",
|
||||
"go list -f '{{.Dir}}/...' -m | xargs go test -tags requires_buildifer -short -covermode=atomic -timeout=5m",
|
||||
],
|
||||
}
|
||||
|
||||
@@ -958,7 +958,7 @@ def mysql_integration_tests_steps(hostname, version):
|
||||
def redis_integration_tests_steps():
|
||||
cmds = [
|
||||
"go clean -testcache",
|
||||
"go test -run IntegrationRedis -covermode=atomic -timeout=2m ./pkg/...",
|
||||
"go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationRedis -covermode=atomic -timeout=2m",
|
||||
]
|
||||
|
||||
environment = {
|
||||
@@ -983,7 +983,7 @@ def remote_alertmanager_integration_tests_steps():
|
||||
def memcached_integration_tests_steps():
|
||||
cmds = [
|
||||
"go clean -testcache",
|
||||
"go test -run IntegrationMemcached -covermode=atomic -timeout=2m ./pkg/...",
|
||||
"go list -f '{{.Dir}}/...' -m | xargs go test -run IntegrationMemcached -covermode=atomic -timeout=2m",
|
||||
]
|
||||
|
||||
environment = {
|
||||
@@ -1096,6 +1096,34 @@ def publish_grafanacom_step(ver_mode):
|
||||
],
|
||||
}
|
||||
|
||||
def verify_grafanacom_step(depends_on = ["publish-grafanacom"]):
|
||||
return {
|
||||
"name": "verify-grafanacom",
|
||||
"image": images["node"],
|
||||
"commands": [
|
||||
# Download and install `curl` and `bash` - both of which aren't available inside of the `node:{version}-alpine` docker image.
|
||||
"apk add curl bash",
|
||||
|
||||
# There may be a slight lag between when artifacts are uploaded to Google Storage,
|
||||
# and when they become available on the website. This `for` loop sould account for that discrepancy.
|
||||
# We attempt the verification up to 5 times. If successful, exit the loop with a success (0) status.
|
||||
# If any attempt fails, but it's not the final attempt, wait 60 seconds before the next attempt.
|
||||
# If the 5th (final) attempt fails, exit with error (1) status.
|
||||
"""
|
||||
for i in {1..5}; do
|
||||
if ./scripts/drone/verify-grafanacom.sh; then
|
||||
exit 0
|
||||
elif [ $i -eq 5 ]; then
|
||||
exit 1
|
||||
else
|
||||
sleep 60
|
||||
fi
|
||||
done
|
||||
""",
|
||||
],
|
||||
"depends_on": depends_on,
|
||||
}
|
||||
|
||||
def publish_linux_packages_step(package_manager = "deb"):
|
||||
return {
|
||||
"name": "publish-linux-packages-{}".format(package_manager),
|
||||
|
||||
Reference in New Issue
Block a user