mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 01:12:09 +08:00
Remove test-release pipelines (#44220)
This commit is contained in:

committed by
GitHub

parent
bf4c217b95
commit
27fbe82bf1
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
load('scripts/drone/pipelines/pr.star', 'pr_pipelines')
|
load('scripts/drone/pipelines/pr.star', 'pr_pipelines')
|
||||||
load('scripts/drone/pipelines/main.star', 'main_pipelines')
|
load('scripts/drone/pipelines/main.star', 'main_pipelines')
|
||||||
load('scripts/drone/pipelines/release.star', 'release_pipelines', 'test_release_pipelines', 'publish_image_pipelines', 'publish_artifacts_pipelines', 'publish_npm_pipelines', 'publish_packages_pipeline')
|
load('scripts/drone/pipelines/release.star', 'release_pipelines', 'publish_image_pipelines', 'publish_artifacts_pipelines', 'publish_npm_pipelines', 'publish_packages_pipeline')
|
||||||
load('scripts/drone/version.star', 'version_branch_pipelines')
|
load('scripts/drone/version.star', 'version_branch_pipelines')
|
||||||
load('scripts/drone/pipelines/cron.star', 'cronjobs')
|
load('scripts/drone/pipelines/cron.star', 'cronjobs')
|
||||||
load('scripts/drone/vault.star', 'secrets')
|
load('scripts/drone/vault.star', 'secrets')
|
||||||
@ -17,4 +17,4 @@ def main(ctx):
|
|||||||
publish_image_pipelines('public') + publish_image_pipelines('security') + \
|
publish_image_pipelines('public') + publish_image_pipelines('security') + \
|
||||||
publish_artifacts_pipelines('security') + publish_artifacts_pipelines('public') + \
|
publish_artifacts_pipelines('security') + publish_artifacts_pipelines('public') + \
|
||||||
publish_npm_pipelines('public') + publish_packages_pipeline() + \
|
publish_npm_pipelines('public') + publish_packages_pipeline() + \
|
||||||
test_release_pipelines() + version_branch_pipelines() + cronjobs(edition=edition) + secrets()
|
version_branch_pipelines() + cronjobs(edition=edition) + secrets()
|
||||||
|
1334
.drone.yml
1334
.drone.yml
File diff suppressed because it is too large
Load Diff
@ -181,7 +181,7 @@ def publish_image_pipelines(mode):
|
|||||||
def get_steps(edition, ver_mode):
|
def get_steps(edition, ver_mode):
|
||||||
package_steps = []
|
package_steps = []
|
||||||
publish_steps = []
|
publish_steps = []
|
||||||
should_publish = ver_mode in ('release', 'test-release',)
|
should_publish = ver_mode == 'release'
|
||||||
should_upload = should_publish or ver_mode in ('release-branch',)
|
should_upload = should_publish or ver_mode in ('release-branch',)
|
||||||
include_enterprise2 = edition == 'enterprise'
|
include_enterprise2 = edition == 'enterprise'
|
||||||
edition2 = 'enterprise2'
|
edition2 = 'enterprise2'
|
||||||
@ -451,7 +451,7 @@ def release_pipelines(ver_mode='release', trigger=None, environment=None):
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
should_publish = ver_mode in ('release', 'test-release',)
|
should_publish = ver_mode == 'release'
|
||||||
|
|
||||||
# The release pipelines include also enterprise ones, so both editions are built for a release.
|
# The release pipelines include also enterprise ones, so both editions are built for a release.
|
||||||
# We could also solve this by triggering a downstream build for the enterprise repo, but by including enterprise
|
# We could also solve this by triggering a downstream build for the enterprise repo, but by including enterprise
|
||||||
@ -470,39 +470,6 @@ def release_pipelines(ver_mode='release', trigger=None, environment=None):
|
|||||||
|
|
||||||
return pipelines
|
return pipelines
|
||||||
|
|
||||||
def test_release_pipelines():
|
|
||||||
ver_mode = 'test-release'
|
|
||||||
|
|
||||||
services = integration_test_services(edition='enterprise')
|
|
||||||
trigger = {
|
|
||||||
'event': ['custom',],
|
|
||||||
}
|
|
||||||
|
|
||||||
oss_pipelines = get_oss_pipelines(ver_mode=ver_mode, trigger=trigger)
|
|
||||||
enterprise_pipelines = get_enterprise_pipelines(ver_mode=ver_mode, trigger=trigger)
|
|
||||||
|
|
||||||
publish_cmd = './bin/grabpl store-packages --edition {{}} --dry-run {}'.format(test_release_ver)
|
|
||||||
|
|
||||||
steps = [
|
|
||||||
store_packages_step(edition='oss', ver_mode=ver_mode),
|
|
||||||
store_packages_step(edition='enterprise', ver_mode=ver_mode),
|
|
||||||
]
|
|
||||||
|
|
||||||
publish_pipeline = pipeline(
|
|
||||||
name='publish-{}'.format(ver_mode), trigger=trigger, edition='oss',
|
|
||||||
steps=[download_grabpl_step()] + initialize_step(edition='oss', platform='linux', ver_mode=ver_mode, install_deps=False) + steps,
|
|
||||||
depends_on=[p['name'] for p in oss_pipelines + enterprise_pipelines],
|
|
||||||
)
|
|
||||||
|
|
||||||
pipelines = oss_pipelines + enterprise_pipelines + [publish_pipeline,]
|
|
||||||
|
|
||||||
pipelines.append(notify_pipeline(
|
|
||||||
name='notify-{}'.format(ver_mode), slack_channel='grafana-ci-notifications', trigger=dict(trigger, status = ['failure']),
|
|
||||||
depends_on=[p['name'] for p in pipelines], template=failure_template, secret='slack_webhook',
|
|
||||||
))
|
|
||||||
|
|
||||||
return pipelines
|
|
||||||
|
|
||||||
def get_e2e_suffix():
|
def get_e2e_suffix():
|
||||||
if not disable_tests:
|
if not disable_tests:
|
||||||
return '-e2e'
|
return '-e2e'
|
||||||
|
@ -46,9 +46,6 @@ def initialize_step(edition, platform, ver_mode, is_downstream=False, install_de
|
|||||||
if ver_mode == 'release':
|
if ver_mode == 'release':
|
||||||
args = '${DRONE_TAG}'
|
args = '${DRONE_TAG}'
|
||||||
common_cmds.append('./bin/grabpl verify-version ${DRONE_TAG}')
|
common_cmds.append('./bin/grabpl verify-version ${DRONE_TAG}')
|
||||||
elif ver_mode == 'test-release':
|
|
||||||
args = test_release_ver
|
|
||||||
common_cmds.append('./bin/grabpl verify-version {}'.format(test_release_ver))
|
|
||||||
else:
|
else:
|
||||||
if not is_downstream:
|
if not is_downstream:
|
||||||
build_no = '${DRONE_BUILD_NUMBER}'
|
build_no = '${DRONE_BUILD_NUMBER}'
|
||||||
@ -68,8 +65,6 @@ def initialize_step(edition, platform, ver_mode, is_downstream=False, install_de
|
|||||||
if ver_mode == 'release':
|
if ver_mode == 'release':
|
||||||
committish = '${DRONE_TAG}'
|
committish = '${DRONE_TAG}'
|
||||||
source_commit = ' ${DRONE_TAG}'
|
source_commit = ' ${DRONE_TAG}'
|
||||||
elif ver_mode == 'test-release':
|
|
||||||
committish = 'main'
|
|
||||||
elif ver_mode == 'release-branch':
|
elif ver_mode == 'release-branch':
|
||||||
committish = '${DRONE_BRANCH}'
|
committish = '${DRONE_BRANCH}'
|
||||||
else:
|
else:
|
||||||
@ -232,7 +227,7 @@ def benchmark_ldap_step():
|
|||||||
|
|
||||||
|
|
||||||
def build_storybook_step(edition, ver_mode):
|
def build_storybook_step(edition, ver_mode):
|
||||||
if edition in ('enterprise', 'enterprise2') and ver_mode in ('release', 'test-release'):
|
if edition in ('enterprise', 'enterprise2') and ver_mode == 'release':
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -256,24 +251,20 @@ def store_storybook_step(edition, ver_mode):
|
|||||||
if edition in ('enterprise', 'enterprise2'):
|
if edition in ('enterprise', 'enterprise2'):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if ver_mode == 'test-release':
|
|
||||||
commands = [
|
commands = []
|
||||||
'echo Testing release',
|
if ver_mode == 'release':
|
||||||
]
|
channels = ['latest', '${DRONE_TAG}', ]
|
||||||
else:
|
else:
|
||||||
commands = []
|
channels = ['canary', ]
|
||||||
if ver_mode == 'release':
|
commands.extend([
|
||||||
channels = ['latest', '${DRONE_TAG}', ]
|
'printenv GCP_KEY | base64 -d > /tmp/gcpkey.json',
|
||||||
else:
|
'gcloud auth activate-service-account --key-file=/tmp/gcpkey.json',
|
||||||
channels = ['canary', ]
|
] + [
|
||||||
commands.extend([
|
'gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://$${{PRERELEASE_BUCKET}}/artifacts/storybook/{}'.format(
|
||||||
'printenv GCP_KEY | base64 -d > /tmp/gcpkey.json',
|
c)
|
||||||
'gcloud auth activate-service-account --key-file=/tmp/gcpkey.json',
|
for c in channels
|
||||||
] + [
|
])
|
||||||
'gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://$${{PRERELEASE_BUCKET}}/artifacts/storybook/{}'.format(
|
|
||||||
c)
|
|
||||||
for c in channels
|
|
||||||
])
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'name': 'store-storybook',
|
'name': 'store-storybook',
|
||||||
@ -370,15 +361,6 @@ def build_backend_step(edition, ver_mode, variants=None, is_downstream=False):
|
|||||||
edition,
|
edition,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
elif ver_mode == 'test-release':
|
|
||||||
env = {
|
|
||||||
'GITHUB_TOKEN': from_secret(github_token),
|
|
||||||
}
|
|
||||||
cmds = [
|
|
||||||
'./bin/grabpl build-backend --jobs 8 --edition {} --github-token $${{GITHUB_TOKEN}} --no-pull-enterprise {}'.format(
|
|
||||||
edition, test_release_ver,
|
|
||||||
),
|
|
||||||
]
|
|
||||||
else:
|
else:
|
||||||
if not is_downstream:
|
if not is_downstream:
|
||||||
build_no = '${DRONE_BUILD_NUMBER}'
|
build_no = '${DRONE_BUILD_NUMBER}'
|
||||||
@ -414,11 +396,6 @@ def build_frontend_step(edition, ver_mode, is_downstream=False):
|
|||||||
'./bin/grabpl build-frontend --jobs 8 --github-token $${GITHUB_TOKEN} --no-install-deps ' + \
|
'./bin/grabpl build-frontend --jobs 8 --github-token $${GITHUB_TOKEN} --no-install-deps ' + \
|
||||||
'--edition {} --no-pull-enterprise ${{DRONE_TAG}}'.format(edition),
|
'--edition {} --no-pull-enterprise ${{DRONE_TAG}}'.format(edition),
|
||||||
]
|
]
|
||||||
elif ver_mode == 'test-release':
|
|
||||||
cmds = [
|
|
||||||
'./bin/grabpl build-frontend --jobs 8 --github-token $${GITHUB_TOKEN} --no-install-deps ' + \
|
|
||||||
'--edition {} --no-pull-enterprise {}'.format(edition, test_release_ver),
|
|
||||||
]
|
|
||||||
else:
|
else:
|
||||||
cmds = [
|
cmds = [
|
||||||
'./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition {} '.format(edition) + \
|
'./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition {} '.format(edition) + \
|
||||||
@ -631,7 +608,7 @@ def package_step(edition, ver_mode, include_enterprise2=False, variants=None, is
|
|||||||
if variants:
|
if variants:
|
||||||
variants_str = ' --variants {}'.format(','.join(variants))
|
variants_str = ' --variants {}'.format(','.join(variants))
|
||||||
|
|
||||||
if ver_mode in ('main', 'release', 'test-release', 'release-branch'):
|
if ver_mode in ('main', 'release', 'release-branch'):
|
||||||
sign_args = ' --sign'
|
sign_args = ' --sign'
|
||||||
env = {
|
env = {
|
||||||
'GRAFANA_API_KEY': from_secret('grafana_api_key'),
|
'GRAFANA_API_KEY': from_secret('grafana_api_key'),
|
||||||
@ -654,13 +631,6 @@ def package_step(edition, ver_mode, include_enterprise2=False, variants=None, is
|
|||||||
sign_args
|
sign_args
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
elif ver_mode == 'test-release':
|
|
||||||
cmds = [
|
|
||||||
'{}./bin/grabpl package --jobs 8 --edition {} '.format(test_args, edition) + \
|
|
||||||
'--github-token $${{GITHUB_TOKEN}} --no-pull-enterprise{} {}'.format(
|
|
||||||
sign_args, test_release_ver,
|
|
||||||
),
|
|
||||||
]
|
|
||||||
else:
|
else:
|
||||||
if not is_downstream:
|
if not is_downstream:
|
||||||
build_no = '${DRONE_BUILD_NUMBER}'
|
build_no = '${DRONE_BUILD_NUMBER}'
|
||||||
@ -758,9 +728,6 @@ def copy_packages_for_docker_step():
|
|||||||
|
|
||||||
|
|
||||||
def package_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publish=False):
|
def package_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publish=False):
|
||||||
if ver_mode == 'test-release':
|
|
||||||
publish = False
|
|
||||||
|
|
||||||
cmd = './bin/grabpl build-docker --edition {} --shouldSave'.format(edition)
|
cmd = './bin/grabpl build-docker --edition {} --shouldSave'.format(edition)
|
||||||
ubuntu_sfx = ''
|
ubuntu_sfx = ''
|
||||||
if ubuntu:
|
if ubuntu:
|
||||||
@ -789,9 +756,6 @@ def package_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publ
|
|||||||
}
|
}
|
||||||
|
|
||||||
def build_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publish=False):
|
def build_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publish=False):
|
||||||
if ver_mode == 'test-release':
|
|
||||||
publish = False
|
|
||||||
|
|
||||||
ubuntu_sfx = ''
|
ubuntu_sfx = ''
|
||||||
if ubuntu:
|
if ubuntu:
|
||||||
ubuntu_sfx = '-ubuntu'
|
ubuntu_sfx = '-ubuntu'
|
||||||
@ -936,10 +900,7 @@ def upload_packages_step(edition, ver_mode, is_downstream=False):
|
|||||||
if ver_mode == 'main' and edition in ('enterprise', 'enterprise2') and not is_downstream:
|
if ver_mode == 'main' and edition in ('enterprise', 'enterprise2') and not is_downstream:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if ver_mode == 'test-release':
|
if ver_mode == 'release':
|
||||||
cmd = './bin/grabpl upload-packages --edition {} '.format(edition) + \
|
|
||||||
'--packages-bucket grafana-downloads-test'
|
|
||||||
elif ver_mode == 'release':
|
|
||||||
packages_bucket = '$${{PRERELEASE_BUCKET}}/artifacts/downloads{}'.format(enterprise2_suffix(edition))
|
packages_bucket = '$${{PRERELEASE_BUCKET}}/artifacts/downloads{}'.format(enterprise2_suffix(edition))
|
||||||
cmd = './bin/grabpl upload-packages --edition {} --packages-bucket {}'.format(edition, packages_bucket)
|
cmd = './bin/grabpl upload-packages --edition {} --packages-bucket {}'.format(edition, packages_bucket)
|
||||||
elif edition == 'enterprise2':
|
elif edition == 'enterprise2':
|
||||||
@ -968,13 +929,7 @@ def upload_packages_step(edition, ver_mode, is_downstream=False):
|
|||||||
|
|
||||||
|
|
||||||
def store_packages_step(edition, ver_mode, is_downstream=False):
|
def store_packages_step(edition, ver_mode, is_downstream=False):
|
||||||
if ver_mode == 'test-release':
|
if ver_mode == 'release':
|
||||||
cmd = './bin/grabpl store-packages --edition {} --gcp-key /tmp/gcpkey.json '.format(edition) + \
|
|
||||||
'--deb-db-bucket grafana-testing-aptly-db --deb-repo-bucket grafana-testing-repo --packages-bucket ' + \
|
|
||||||
'grafana-downloads-test --rpm-repo-bucket grafana-testing-repo --simulate-release {}'.format(
|
|
||||||
test_release_ver,
|
|
||||||
)
|
|
||||||
elif ver_mode == 'release':
|
|
||||||
cmd = './bin/grabpl store-packages --edition {} --packages-bucket grafana-downloads --gcp-key /tmp/gcpkey.json ${{DRONE_TAG}}'.format(
|
cmd = './bin/grabpl store-packages --edition {} --packages-bucket grafana-downloads --gcp-key /tmp/gcpkey.json ${{DRONE_TAG}}'.format(
|
||||||
edition,
|
edition,
|
||||||
)
|
)
|
||||||
@ -1033,18 +988,13 @@ def get_windows_steps(edition, ver_mode, is_downstream=False):
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
if (ver_mode == 'main' and (edition not in ('enterprise', 'enterprise2') or is_downstream)) or ver_mode in (
|
if (ver_mode == 'main' and (edition not in ('enterprise', 'enterprise2') or is_downstream)) or ver_mode in (
|
||||||
'release', 'test-release', 'release-branch',
|
'release', 'release-branch',
|
||||||
):
|
):
|
||||||
bucket_part = ''
|
bucket_part = ''
|
||||||
bucket = '%PRERELEASE_BUCKET%/artifacts/downloads'
|
bucket = '%PRERELEASE_BUCKET%/artifacts/downloads'
|
||||||
if ver_mode == 'release':
|
if ver_mode == 'release':
|
||||||
ver_part = '${DRONE_TAG}'
|
ver_part = '${DRONE_TAG}'
|
||||||
dir = 'release'
|
dir = 'release'
|
||||||
elif ver_mode == 'test-release':
|
|
||||||
ver_part = test_release_ver
|
|
||||||
dir = 'release'
|
|
||||||
bucket = 'grafana-downloads-test'
|
|
||||||
bucket_part = ' --packages-bucket {}'.format(bucket)
|
|
||||||
else:
|
else:
|
||||||
dir = 'main'
|
dir = 'main'
|
||||||
bucket = 'grafana-downloads'
|
bucket = 'grafana-downloads'
|
||||||
@ -1064,7 +1014,7 @@ def get_windows_steps(edition, ver_mode, is_downstream=False):
|
|||||||
'cp C:\\App\\nssm-2.24.zip .',
|
'cp C:\\App\\nssm-2.24.zip .',
|
||||||
]
|
]
|
||||||
if (ver_mode == 'main' and (edition not in ('enterprise', 'enterprise2') or is_downstream)) or ver_mode in (
|
if (ver_mode == 'main' and (edition not in ('enterprise', 'enterprise2') or is_downstream)) or ver_mode in (
|
||||||
'release', 'test-release',
|
'release',
|
||||||
):
|
):
|
||||||
installer_commands.extend([
|
installer_commands.extend([
|
||||||
'.\\grabpl.exe gen-version {}'.format(ver_part),
|
'.\\grabpl.exe gen-version {}'.format(ver_part),
|
||||||
@ -1098,8 +1048,6 @@ def get_windows_steps(edition, ver_mode, is_downstream=False):
|
|||||||
if edition in ('enterprise', 'enterprise2'):
|
if edition in ('enterprise', 'enterprise2'):
|
||||||
if ver_mode == 'release':
|
if ver_mode == 'release':
|
||||||
committish = '${DRONE_TAG}'
|
committish = '${DRONE_TAG}'
|
||||||
elif ver_mode == 'test-release':
|
|
||||||
committish = 'main'
|
|
||||||
elif ver_mode == 'release-branch':
|
elif ver_mode == 'release-branch':
|
||||||
committish = '$$env:DRONE_BRANCH'
|
committish = '$$env:DRONE_BRANCH'
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user