grafana/scripts/drone/pipelines/publish_images.star
Dimitris Sotirakis b13939b9af
[WIP] CI: Removes enterprise specific pipelines and steps (#70815)
* Removes enterprise specific pipelines and steps (#123)

* Comment out enterprise related pipelines and steps

* Suppress unused variable warning

* Removes all edition arguments

* Remove leftover comments

* Remove redundant oss on pipelines and steps names

* Remove leftover unused variable

* Remove leftovers

* Remove pipeline dependencies

* Rename pipelines

* Fix starlark

---------

Co-authored-by: dsotirakis <dimitrios.sotirakis@grafana.com>
(cherry picked from commit 642a81ba75e79138246797302aba5c35575f030d)

# Conflicts:
#	.drone.yml
#	scripts/drone/steps/lib.star

# Conflicts:
#	.drone.yml

* Add editions for static assets

# Conflicts:
#	.drone.yml

# Conflicts:
#	.drone.yml
2023-07-14 14:18:09 +03:00

58 lines
1.3 KiB
Plaintext

"""
This module returns the pipeline used for publishing Docker images and its steps.
"""
load(
"scripts/drone/steps/lib.star",
"compile_build_cmd",
"download_grabpl_step",
"fetch_images_step",
"identify_runner_step",
"publish_images_step",
)
load(
"scripts/drone/utils/utils.star",
"pipeline",
)
def publish_image_steps(docker_repo):
"""Generates the steps used for publising Docker images using grabpl.
Args:
docker_repo: the Docker image name.
It is combined with the 'grafana/' library prefix.
Returns:
List of Drone steps.
"""
steps = [
identify_runner_step(),
download_grabpl_step(),
compile_build_cmd(),
fetch_images_step(),
publish_images_step("release", docker_repo),
publish_images_step("release", "grafana-oss"),
]
return steps
def publish_image_pipelines_public():
"""Generates the pipeline used for publising public Docker images.
Returns:
Drone pipeline
"""
mode = "public"
trigger = {
"event": ["promote"],
"target": [mode],
}
return [
pipeline(
name = "publish-docker-{}".format(mode),
trigger = trigger,
steps = publish_image_steps(docker_repo = "grafana"),
environment = {"EDITION": "oss"},
),
]