mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 08:02:25 +08:00
CI: Add automation for github assets publishing (#59491)
* Add github.star # Conflicts: # .drone.star # .drone.yml * Make step depend on fetch images # Conflicts: # .drone.yml * artifacts -> path # Conflicts: # .drone.yml * Add github token # Conflicts: # .drone.yml * Fix custom path # Conflicts: # .drone.yml * Add case where path is absent # Conflicts: # .drone.yml * Add GH_REGISTRY secret # Conflicts: # .drone.yml
This commit is contained in:

committed by
GitHub

parent
583aafbbd8
commit
e9cf8fa751
36
scripts/drone/pipelines/github.star
Normal file
36
scripts/drone/pipelines/github.star
Normal file
@ -0,0 +1,36 @@
|
||||
load(
|
||||
'scripts/drone/steps/lib.star',
|
||||
'download_grabpl_step',
|
||||
'publish_images_step',
|
||||
'compile_build_cmd',
|
||||
'fetch_images_step',
|
||||
'publish_image',
|
||||
)
|
||||
|
||||
load('scripts/drone/vault.star', 'from_secret')
|
||||
|
||||
load(
|
||||
'scripts/drone/utils/utils.star',
|
||||
'pipeline',
|
||||
)
|
||||
|
||||
def publish_github_step():
|
||||
return {
|
||||
'name': 'publish-github',
|
||||
'image': publish_image,
|
||||
'commands': ['./bin/build publish github --repo $${GH_REGISTRY} --create'],
|
||||
'depends_on': ['fetch-images-enterprise2'],
|
||||
'environment': {
|
||||
'GH_TOKEN': from_secret('github_token'),
|
||||
'GH_REGISTRY': from_secret('gh_registry'),
|
||||
},
|
||||
}
|
||||
|
||||
def publish_github_pipeline(mode):
|
||||
trigger = {
|
||||
'event': ['promote'],
|
||||
'target': [mode],
|
||||
}
|
||||
return [pipeline(
|
||||
name='publish-github-{}'.format(mode), trigger=trigger, steps=[compile_build_cmd(), fetch_images_step('enterprise2'), publish_github_step()], edition="", environment = {'EDITION': 'enterprise2'}
|
||||
),]
|
Reference in New Issue
Block a user