mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CI: Provide a Drone promotion to build the build-container (#71133)
This commit is contained in:
@@ -9,11 +9,16 @@ load(
|
||||
load(
|
||||
"scripts/drone/vault.star",
|
||||
"from_secret",
|
||||
"gcp_download_build_container_assets_key",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/utils/windows_images.star",
|
||||
"windows_images",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/utils/images.star",
|
||||
"images",
|
||||
)
|
||||
|
||||
def publish_ci_windows_test_image_pipeline():
|
||||
trigger = {
|
||||
@@ -65,3 +70,51 @@ def publish_ci_windows_test_image_pipeline():
|
||||
}
|
||||
|
||||
return [pl]
|
||||
|
||||
def publish_ci_build_container_image_pipeline():
|
||||
trigger = {
|
||||
"event": ["promote"],
|
||||
"target": ["ci-build-container-image"],
|
||||
}
|
||||
pl = pipeline(
|
||||
name = "publish-ci-build-container-image",
|
||||
trigger = trigger,
|
||||
edition = "",
|
||||
steps = [
|
||||
{
|
||||
"name": "validate-version",
|
||||
"image": images["alpine_image"],
|
||||
"commands": [
|
||||
"if [ -z \"${BUILD_CONTAINER_VERSION}\" ]; then echo Missing BUILD_CONTAINER_VERSION; false; fi",
|
||||
],
|
||||
},
|
||||
{
|
||||
"name": "download-macos-sdk",
|
||||
"image": images["cloudsdk_image"],
|
||||
"environment": {
|
||||
"GCP_KEY": from_secret(gcp_download_build_container_assets_key),
|
||||
},
|
||||
"commands": [
|
||||
"printenv GCP_KEY > /tmp/key.json",
|
||||
"gcloud auth activate-service-account --key-file=/tmp/key.json",
|
||||
"gsutil cp gs://grafana-private-downloads/MacOSX10.15.sdk.tar.xz ./scripts/build/ci-build/MacOSX10.15.sdk.tar.xz",
|
||||
],
|
||||
},
|
||||
{
|
||||
"name": "build-and-publish", # Consider splitting the build and the upload task.
|
||||
"image": images["cloudsdk_image"],
|
||||
"volumes": [{"name": "docker", "path": "/var/run/docker.sock"}],
|
||||
"environment": {
|
||||
"DOCKER_USERNAME": from_secret("docker_username"),
|
||||
"DOCKER_PASSWORD": from_secret("docker_password"),
|
||||
},
|
||||
"commands": [
|
||||
"printenv DOCKER_PASSWORD | docker login -u \"$DOCKER_USERNAME\" --password-stdin",
|
||||
"docker build -t \"grafana/build-container:${BUILD_CONTAINER_VERSION}\" ./scripts/build/ci-build",
|
||||
"docker push \"grafana/build-container:${BUILD_CONTAINER_VERSION}\"",
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
|
||||
return [pl]
|
||||
|
||||
@@ -5,6 +5,7 @@ pull_secret = "dockerconfigjson"
|
||||
drone_token = "drone_token"
|
||||
prerelease_bucket = "prerelease_bucket"
|
||||
gcp_upload_artifacts_key = "gcp_upload_artifacts_key"
|
||||
gcp_download_build_container_assets_key = "gcp_download_build_container_assets_key"
|
||||
azure_sp_app_id = "azure_sp_app_id"
|
||||
azure_sp_app_pw = "azure_sp_app_pw"
|
||||
azure_tenant = "azure_tenant"
|
||||
@@ -38,6 +39,11 @@ def secrets():
|
||||
"infra/data/ci/grafana/releng/artifacts-uploader-service-account",
|
||||
"credentials.json",
|
||||
),
|
||||
vault_secret(
|
||||
gcp_download_build_container_assets_key,
|
||||
"infra/data/ci/grafana/assets-downloader-build-container-service-account",
|
||||
"credentials.json",
|
||||
),
|
||||
vault_secret(
|
||||
azure_sp_app_id,
|
||||
"infra/data/ci/datasources/cpp-azure-resourcemanager-credentials",
|
||||
|
||||
Reference in New Issue
Block a user