Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
02e648c4
Unverified
Commit
02e648c4
authored
Sep 24, 2020
by
Arve Knudsen
Committed by
GitHub
Sep 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drone: Separate pipeline for publishing packages (#27774)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent
9ca12a76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
17 deletions
+99
-17
.drone.yml
+47
-2
scripts/lib.star
+52
-15
No files found.
.drone.yml
View file @
02e648c4
...
...
@@ -522,10 +522,10 @@ steps:
depends_on
:
-
end-to-end-tests
-
name
:
publish
-packages
-
name
:
upload
-packages
image
:
grafana/grafana-ci-deploy:1.2.6
commands
:
-
./bin/grabpl
publish
-packages --edition oss
-
./bin/grabpl
upload
-packages --edition oss
environment
:
GCP_GRAFANA_UPLOAD_KEY
:
from_secret
:
gcp_key
...
...
@@ -615,4 +615,49 @@ trigger:
depends_on
:
-
build-master
---
kind
:
pipeline
type
:
docker
name
:
publish-master
platform
:
os
:
linux
arch
:
amd64
steps
:
-
name
:
identify-runner
image
:
alpine:3.12
commands
:
-
echo $DRONE_RUNNER_NAME
-
name
:
initialize
image
:
grafana/build-container:1.2.27
commands
:
-
curl -fLO https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.10/grabpl
-
chmod +x grabpl
-
mkdir -p bin
-
mv grabpl bin
environment
:
DOCKERIZE_VERSION
:
0.6.1
-
name
:
publish-packages
image
:
grafana/grafana-ci-deploy:1.2.6
commands
:
-
./bin/grabpl publish-packages --edition oss
environment
:
GRAFANA_COM_API_KEY
:
from_secret
:
grafana_api_key
depends_on
:
-
upload-packages
trigger
:
branch
:
-
master
event
:
-
push
depends_on
:
-
build-master
-
windows-master
...
scripts/lib.star
View file @
02e648c4
...
...
@@ -88,12 +88,16 @@ def master_steps(edition, is_downstream=False):
postgres_integration_tests_step(),
mysql_integration_tests_step(),
release_next_npm_packages_step(edition),
publish
_packages_step(edition, is_downstream),
upload
_packages_step(edition, is_downstream),
deploy_to_kubernetes_step(edition, is_downstream),
]
windows_steps = get_windows_steps(edition=edition, version_mode='master', is_downstream=is_downstream)
return steps, windows_steps
publish_steps = [
publish_packages_step(edition, is_downstream),
]
return steps, windows_steps, publish_steps
def master_pipelines(edition):
services = [
...
...
@@ -121,7 +125,7 @@ def master_pipelines(edition):
'event': ['push',],
'branch': 'master',
}
steps, windows_steps = master_steps(edition=edition)
steps, windows_steps
, publish_steps
= master_steps(edition=edition)
pipelines = [
pipeline(
name='build-master', edition=edition, trigger=trigger, services=services, steps=steps
...
...
@@ -131,12 +135,17 @@ def master_pipelines(edition):
depends_on=['build-master'],
),
]
if edition != 'enterprise':
pipelines.append(pipeline(
name='publish-master', edition=edition, trigger=trigger, steps=publish_steps,
depends_on=['build-master', 'windows-master',], install_deps=False,
))
if edition == 'enterprise':
# Add downstream enterprise pipelines triggerable from OSS builds
trigger = {
'event': ['custom',],
}
steps, windows_steps = master_steps(edition=edition, is_downstream=True)
steps, windows_steps
, publish_steps
= master_steps(edition=edition, is_downstream=True)
pipelines.append(pipeline(
name='build-master-downstream', edition=edition, trigger=trigger, services=services, steps=steps,
is_downstream=True,
...
...
@@ -145,10 +154,15 @@ def master_pipelines(edition):
name='windows-master-downstream', edition=edition, trigger=trigger, steps=windows_steps,
platform='windows', depends_on=['build-master-downstream'], is_downstream=True,
))
pipelines.append(pipeline(
name='publish-master-downstream', edition=edition, trigger=trigger, steps=publish_steps,
depends_on=['build-master-downstream', 'windows-master-downstream'], is_downstream=True, install_deps=False,
))
return pipelines
def pipeline(name, edition, trigger, steps, services=[], platform='linux', depends_on=[], is_downstream=False):
def pipeline(name, edition, trigger, steps, services=[], platform='linux', depends_on=[], is_downstream=False,
install_deps=True):
if platform != 'windows':
platform_conf = {
'os': 'linux',
...
...
@@ -168,7 +182,7 @@ def pipeline(name, edition, trigger, steps, services=[], platform='linux', depen
'name': name,
'trigger': trigger,
'services': services,
'steps': init_steps(edition, platform, is_downstream=is_downstream) + steps,
'steps': init_steps(edition, platform, is_downstream=is_downstream
, install_deps=install_deps
) + steps,
'depends_on': depends_on,
}
...
...
@@ -180,7 +194,7 @@ def pipeline(name, edition, trigger, steps, services=[], platform='linux', depen
return pipeline
def init_steps(edition, platform, is_downstream=False):
def init_steps(edition, platform, is_downstream=False
, install_deps=True
):
if platform == 'windows':
return [
{
...
...
@@ -200,12 +214,15 @@ def init_steps(edition, platform, is_downstream=False):
],
}
common_cmds = [
'curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz',
'tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz',
'rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz',
'yarn install --frozen-lockfile --no-progress',
]
if install_deps:
common_cmds = [
'curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz',
'tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz',
'rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz',
'yarn install --frozen-lockfile --no-progress',
]
else:
common_cmds = []
if edition == 'enterprise':
if is_downstream:
source_commit = ' $${SOURCE_COMMIT}'
...
...
@@ -730,12 +747,12 @@ def deploy_to_kubernetes_step(edition, is_downstream):
],
}
def
publish
_packages_step(edition, is_downstream):
def
upload
_packages_step(edition, is_downstream):
if edition == 'enterprise' and not is_downstream:
return None
return {
'name': '
publish
-packages',
'name': '
upload
-packages',
'image': publish_image,
'depends_on': [
'package',
...
...
@@ -761,6 +778,26 @@ def publish_packages_step(edition, is_downstream):
},
},
'commands': [
'./bin/grabpl upload-packages --edition {}'.format(edition),
],
}
def publish_packages_step(edition, is_downstream):
if edition == 'enterprise' and not is_downstream:
return None
return {
'name': 'publish-packages',
'image': publish_image,
'depends_on': [
'upload-packages',
],
'environment': {
'GRAFANA_COM_API_KEY': {
'from_secret': 'grafana_api_key',
},
},
'commands': [
'./bin/grabpl publish-packages --edition {}'.format(edition),
],
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment