Drone: Verify Drone config at beginning of pipelines (#29071)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-11-13 19:28:46 +01:00
committed by GitHub
parent 28ce2f12ed
commit 113e288668
2 changed files with 47 additions and 27 deletions
+11 -9
View File
@@ -1,4 +1,4 @@
grabpl_version = '0.5.25'
grabpl_version = '0.5.26'
build_image = 'grafana/build-container:1.2.28'
publish_image = 'grafana/grafana-ci-deploy:1.2.6'
grafana_docker_image = 'grafana/drone-grafana-docker:0.3.2'
@@ -94,8 +94,9 @@ def init_steps(edition, platform, ver_mode, is_downstream=False, install_deps=Tr
),
'chmod +x bin/grabpl',
]
common_cmds = []
pre_cmds = []
common_cmds = [
'./bin/grabpl verify-drone',
]
if ver_mode == 'release':
common_cmds.append('./bin/grabpl verify-version ${DRONE_TAG}')
@@ -140,7 +141,7 @@ def init_steps(edition, platform, ver_mode, is_downstream=False, install_deps=Tr
'from_secret': 'github_token',
},
},
'commands': download_grabpl_cmds + pre_cmds + [
'commands': download_grabpl_cmds + [
'git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"',
'cd grafana-enterprise',
'git checkout {}'.format(committish),
@@ -155,7 +156,7 @@ def init_steps(edition, platform, ver_mode, is_downstream=False, install_deps=Tr
'depends_on': [
'clone',
],
'commands': pre_cmds + [
'commands': [
'mv bin/grabpl /tmp/',
'rmdir bin',
'mv grafana-enterprise /tmp/',
@@ -176,7 +177,7 @@ def init_steps(edition, platform, ver_mode, is_downstream=False, install_deps=Tr
'environment': {
'DOCKERIZE_VERSION': dockerize_version,
},
'commands': download_grabpl_cmds + pre_cmds + common_cmds,
'commands': download_grabpl_cmds + common_cmds,
},
]
@@ -845,7 +846,6 @@ def get_windows_steps(edition, ver_mode, is_downstream=False):
else:
source_commit = ' $$env:SOURCE_COMMIT'
pre_cmds = []
sfx = ''
if edition == 'enterprise':
sfx = '-enterprise'
@@ -854,6 +854,7 @@ def get_windows_steps(edition, ver_mode, is_downstream=False):
init_cmds.extend([
'$$ProgressPreference = "SilentlyContinue"',
'Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v{}/windows/grabpl.exe -OutFile grabpl.exe'.format(grabpl_version),
'.\\grabpl.exe verify-drone',
])
steps = [
{
@@ -908,7 +909,7 @@ def get_windows_steps(edition, ver_mode, is_downstream=False):
'from_secret': 'gcp_key',
},
},
'commands': pre_cmds + installer_commands,
'commands': installer_commands,
'depends_on': [
'initialize',
],
@@ -929,6 +930,7 @@ def get_windows_steps(edition, ver_mode, is_downstream=False):
'Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v{}/windows/grabpl.exe -OutFile grabpl.exe'.format(grabpl_version),
]
clone_cmds = [
'.\\grabpl.exe verify-drone',
'git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git"',
]
if not is_downstream:
@@ -944,7 +946,7 @@ def get_windows_steps(edition, ver_mode, is_downstream=False):
'from_secret': 'github_token',
},
},
'commands': download_grabpl_cmds + pre_cmds + clone_cmds,
'commands': download_grabpl_cmds + clone_cmds,
})
steps[1]['depends_on'] = [
'clone',