CI: Add aws-marketplace pipeline (#60484)

* Add aws marketplace automation

# Conflicts:
#	.drone.yml

* Fix secret paths

# Conflicts:
#	.drone.yml

* Add docker socket

# Conflicts:
#	.drone.yml

# Conflicts:
#	.drone.yml

* s/enterprise2/enterprise

* Add dependency on the enterprise docker publish

# Conflicts:
#	.drone.yml

* Replace testing args with prod args

# Conflicts:
#	.drone.yml

* Fix path

# Conflicts:
#	.drone.yml
This commit is contained in:
Dimitris Sotirakis
2022-12-19 18:25:48 +02:00
committed by GitHub
parent c25fe34ac0
commit 158502572e
4 changed files with 144 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
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_aws_marketplace_step():
return {
'name': 'publish-aws-marketplace',
'image': publish_image,
'commands': ['./bin/build publish aws --image grafana/grafana-enterprise --repo grafana-labs/grafanaenterprise --product 422b46fb-bea6-4f27-8bcc-832117bd627e'],
'depends_on': ['fetch-images-enterprise'],
'environment': {
'AWS_REGION': from_secret('aws_region'),
'AWS_ACCESS_KEY_ID': from_secret('aws_access_key_id'),
'AWS_SECRET_ACCESS_KEY': from_secret('aws_secret_access_key'),
},
'volumes': [{'name': 'docker', 'path': '/var/run/docker.sock'}],
}
def publish_aws_marketplace_pipeline(mode):
trigger = {
'event': ['promote'],
'target': [mode],
}
return [pipeline(
name='publish-aws-marketplace-{}'.format(mode), trigger=trigger, steps=[compile_build_cmd(), fetch_images_step('enterprise'), publish_aws_marketplace_step()], edition="", depends_on = ['publish-docker-enterprise-public'], environment = {'EDITION': 'enterprise2'}
),]

View File

@@ -79,4 +79,19 @@ def secrets():
'infra/data/ci/packages-publish/bucket-credentials',
'Secret',
),
vault_secret(
'aws_region',
'secret/data/common/aws-marketplace',
'aws_region',
),
vault_secret(
'aws_access_key_id',
'secret/data/common/aws-marketplace',
'aws_access_key_id',
),
vault_secret(
'aws_secret_access_key',
'secret/data/common/aws-marketplace',
'aws_secret_access_key',
),
]