diff --git a/.drone.yml b/.drone.yml index cf50395cde6..6e77b603d39 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1401,11 +1401,29 @@ steps: environment: DOCKERIZE_VERSION: 0.6.1 -- name: publish-packages +- name: publish-packages-oss image: grafana/grafana-ci-deploy:1.2.7 commands: - printenv GCP_KEY | base64 -d > /tmp/gcpkey.json - ./bin/grabpl publish-packages --edition oss --gcp-key /tmp/gcpkey.json ${DRONE_TAG} + environment: + GCP_KEY: + from_secret: gcp_key + GPG_KEY_PASSWORD: + from_secret: gpg_key_password + GPG_PRIV_KEY: + from_secret: gpg_priv_key + GPG_PUB_KEY: + from_secret: gpg_pub_key + GRAFANA_COM_API_KEY: + from_secret: grafana_api_key + depends_on: + - initialize + +- name: publish-packages-enterprise + image: grafana/grafana-ci-deploy:1.2.7 + commands: + - printenv GCP_KEY | base64 -d > /tmp/gcpkey.json - ./bin/grabpl publish-packages --edition enterprise --gcp-key /tmp/gcpkey.json ${DRONE_TAG} environment: GCP_KEY: diff --git a/scripts/release.star b/scripts/release.star index 98dfead08b9..a6521237e08 100644 --- a/scripts/release.star +++ b/scripts/release.star @@ -116,6 +116,38 @@ def get_enterprise_pipelines(trigger, ver_mode, publish): ), ] +def publish_packages_step(edition): + return { + 'name': 'publish-packages-{}'.format(edition), + 'image': publish_image, + 'depends_on': [ + 'initialize', + ], + 'environment': { + 'GRAFANA_COM_API_KEY': { + 'from_secret': 'grafana_api_key', + }, + 'GCP_KEY': { + 'from_secret': 'gcp_key', + }, + 'GPG_PRIV_KEY': { + 'from_secret': 'gpg_priv_key', + }, + 'GPG_PUB_KEY': { + 'from_secret': 'gpg_pub_key', + }, + 'GPG_KEY_PASSWORD': { + 'from_secret': 'gpg_key_password', + }, + }, + 'commands': [ + 'printenv GCP_KEY | base64 -d > /tmp/gcpkey.json', + './bin/grabpl publish-packages --edition {} --gcp-key /tmp/gcpkey.json ${{DRONE_TAG}}'.format( + edition, + ), + ], + } + def release_pipelines(ver_mode='release', trigger=None): services = integration_test_services() if not trigger: @@ -135,35 +167,8 @@ def release_pipelines(ver_mode='release', trigger=None): if publish: publish_pipeline = pipeline( name='publish-{}'.format(ver_mode), trigger=trigger, edition='oss', steps=[ - { - 'name': 'publish-packages', - 'image': publish_image, - 'depends_on': [ - 'initialize', - ], - 'environment': { - 'GRAFANA_COM_API_KEY': { - 'from_secret': 'grafana_api_key', - }, - 'GCP_KEY': { - 'from_secret': 'gcp_key', - }, - 'GPG_PRIV_KEY': { - 'from_secret': 'gpg_priv_key', - }, - 'GPG_PUB_KEY': { - 'from_secret': 'gpg_pub_key', - }, - 'GPG_KEY_PASSWORD': { - 'from_secret': 'gpg_key_password', - }, - }, - 'commands': [ - 'printenv GCP_KEY | base64 -d > /tmp/gcpkey.json', - './bin/grabpl publish-packages --edition oss --gcp-key /tmp/gcpkey.json ${DRONE_TAG}', - './bin/grabpl publish-packages --edition enterprise --gcp-key /tmp/gcpkey.json ${DRONE_TAG}', - ], - }, + publish_packages_step(edition='oss'), + publish_packages_step(edition='enterprise'), ], depends_on=[p['name'] for p in oss_pipelines + enterprise_pipelines], install_deps=False, ver_mode=ver_mode, )