mirror of https://github.com/grafana/grafana.git
				
				
				
			CI: Use production gcom api for nightly builds (#76201)
* Use production gcom api for nightly builds * Use production package repositories * Remove unused confusing env variable * Comment out previous gcom nightly pipeline * Remove unused grafana-com-nightly pipeline * Remove unused import from cron.star
This commit is contained in:
		
							parent
							
								
									e587d4e879
								
							
						
					
					
						commit
						165b4c3f66
					
				
							
								
								
									
										70
									
								
								.drone.yml
								
								
								
								
							
							
						
						
									
										70
									
								
								.drone.yml
								
								
								
								
							|  | @ -2841,7 +2841,7 @@ steps: | ||||||
|     DOWNLOADS_DESTINATION: |     DOWNLOADS_DESTINATION: | ||||||
|       from_secret: rgm_downloads_destination |       from_secret: rgm_downloads_destination | ||||||
|     GCOM_API_KEY: |     GCOM_API_KEY: | ||||||
|       from_secret: grafana_api_key_dev |       from_secret: grafana_api_key | ||||||
|     GCP_KEY_BASE64: |     GCP_KEY_BASE64: | ||||||
|       from_secret: gcp_key_base64 |       from_secret: gcp_key_base64 | ||||||
|     GITHUB_TOKEN: |     GITHUB_TOKEN: | ||||||
|  | @ -2855,7 +2855,6 @@ steps: | ||||||
|       from_secret: packages_gpg_public_key |       from_secret: packages_gpg_public_key | ||||||
|     NPM_TOKEN: |     NPM_TOKEN: | ||||||
|       from_secret: npm_token |       from_secret: npm_token | ||||||
|     PACKAGES_DESTINATION: gs://grafana-packages-testing |  | ||||||
|     STORYBOOK_DESTINATION: |     STORYBOOK_DESTINATION: | ||||||
|       from_secret: rgm_storybook_destination |       from_secret: rgm_storybook_destination | ||||||
|   image: grafana/grafana-build:main |   image: grafana/grafana-build:main | ||||||
|  | @ -3091,7 +3090,7 @@ steps: | ||||||
|     DOWNLOADS_DESTINATION: |     DOWNLOADS_DESTINATION: | ||||||
|       from_secret: rgm_downloads_destination |       from_secret: rgm_downloads_destination | ||||||
|     GCOM_API_KEY: |     GCOM_API_KEY: | ||||||
|       from_secret: grafana_api_key_dev |       from_secret: grafana_api_key | ||||||
|     GCP_KEY_BASE64: |     GCP_KEY_BASE64: | ||||||
|       from_secret: gcp_key_base64 |       from_secret: gcp_key_base64 | ||||||
|     GITHUB_TOKEN: |     GITHUB_TOKEN: | ||||||
|  | @ -3105,7 +3104,6 @@ steps: | ||||||
|       from_secret: packages_gpg_public_key |       from_secret: packages_gpg_public_key | ||||||
|     NPM_TOKEN: |     NPM_TOKEN: | ||||||
|       from_secret: npm_token |       from_secret: npm_token | ||||||
|     PACKAGES_DESTINATION: gs://grafana-packages-testing |  | ||||||
|     STORYBOOK_DESTINATION: |     STORYBOOK_DESTINATION: | ||||||
|       from_secret: rgm_storybook_destination |       from_secret: rgm_storybook_destination | ||||||
|   image: grafana/grafana-build:main |   image: grafana/grafana-build:main | ||||||
|  | @ -3273,7 +3271,7 @@ steps: | ||||||
|     DOWNLOADS_DESTINATION: |     DOWNLOADS_DESTINATION: | ||||||
|       from_secret: rgm_downloads_destination |       from_secret: rgm_downloads_destination | ||||||
|     GCOM_API_KEY: |     GCOM_API_KEY: | ||||||
|       from_secret: grafana_api_key_dev |       from_secret: grafana_api_key | ||||||
|     GCP_KEY_BASE64: |     GCP_KEY_BASE64: | ||||||
|       from_secret: gcp_key_base64 |       from_secret: gcp_key_base64 | ||||||
|     GITHUB_TOKEN: |     GITHUB_TOKEN: | ||||||
|  | @ -3287,7 +3285,6 @@ steps: | ||||||
|       from_secret: packages_gpg_public_key |       from_secret: packages_gpg_public_key | ||||||
|     NPM_TOKEN: |     NPM_TOKEN: | ||||||
|       from_secret: npm_token |       from_secret: npm_token | ||||||
|     PACKAGES_DESTINATION: gs://grafana-packages-testing |  | ||||||
|     STORYBOOK_DESTINATION: |     STORYBOOK_DESTINATION: | ||||||
|       from_secret: rgm_storybook_destination |       from_secret: rgm_storybook_destination | ||||||
|   image: grafana/grafana-build:main |   image: grafana/grafana-build:main | ||||||
|  | @ -3504,7 +3501,7 @@ steps: | ||||||
|     DOWNLOADS_DESTINATION: |     DOWNLOADS_DESTINATION: | ||||||
|       from_secret: rgm_downloads_destination |       from_secret: rgm_downloads_destination | ||||||
|     GCOM_API_KEY: |     GCOM_API_KEY: | ||||||
|       from_secret: grafana_api_key_dev |       from_secret: grafana_api_key | ||||||
|     GCP_KEY_BASE64: |     GCP_KEY_BASE64: | ||||||
|       from_secret: gcp_key_base64 |       from_secret: gcp_key_base64 | ||||||
|     GITHUB_TOKEN: |     GITHUB_TOKEN: | ||||||
|  | @ -3518,7 +3515,6 @@ steps: | ||||||
|       from_secret: packages_gpg_public_key |       from_secret: packages_gpg_public_key | ||||||
|     NPM_TOKEN: |     NPM_TOKEN: | ||||||
|       from_secret: npm_token |       from_secret: npm_token | ||||||
|     PACKAGES_DESTINATION: gs://grafana-packages-testing |  | ||||||
|     STORYBOOK_DESTINATION: |     STORYBOOK_DESTINATION: | ||||||
|       from_secret: rgm_storybook_destination |       from_secret: rgm_storybook_destination | ||||||
|   image: grafana/grafana-build:main |   image: grafana/grafana-build:main | ||||||
|  | @ -3548,7 +3544,7 @@ steps: | ||||||
|     DOWNLOADS_DESTINATION: |     DOWNLOADS_DESTINATION: | ||||||
|       from_secret: rgm_downloads_destination |       from_secret: rgm_downloads_destination | ||||||
|     GCOM_API_KEY: |     GCOM_API_KEY: | ||||||
|       from_secret: grafana_api_key_dev |       from_secret: grafana_api_key | ||||||
|     GCP_KEY_BASE64: |     GCP_KEY_BASE64: | ||||||
|       from_secret: gcp_key_base64 |       from_secret: gcp_key_base64 | ||||||
|     GITHUB_TOKEN: |     GITHUB_TOKEN: | ||||||
|  | @ -3561,7 +3557,6 @@ steps: | ||||||
|       from_secret: packages_gpg_public_key |       from_secret: packages_gpg_public_key | ||||||
|     NPM_TOKEN: |     NPM_TOKEN: | ||||||
|       from_secret: npm_token |       from_secret: npm_token | ||||||
|     PACKAGES_DESTINATION: gs://grafana-packages-testing |  | ||||||
|     STORYBOOK_DESTINATION: |     STORYBOOK_DESTINATION: | ||||||
|       from_secret: rgm_storybook_destination |       from_secret: rgm_storybook_destination | ||||||
|   image: google/cloud-sdk:alpine |   image: google/cloud-sdk:alpine | ||||||
|  | @ -3614,7 +3609,7 @@ steps: | ||||||
|     DOWNLOADS_DESTINATION: |     DOWNLOADS_DESTINATION: | ||||||
|       from_secret: rgm_downloads_destination |       from_secret: rgm_downloads_destination | ||||||
|     GCOM_API_KEY: |     GCOM_API_KEY: | ||||||
|       from_secret: grafana_api_key_dev |       from_secret: grafana_api_key | ||||||
|     GCP_KEY_BASE64: |     GCP_KEY_BASE64: | ||||||
|       from_secret: gcp_key_base64 |       from_secret: gcp_key_base64 | ||||||
|     GITHUB_TOKEN: |     GITHUB_TOKEN: | ||||||
|  | @ -3627,7 +3622,6 @@ steps: | ||||||
|       from_secret: packages_gpg_public_key |       from_secret: packages_gpg_public_key | ||||||
|     NPM_TOKEN: |     NPM_TOKEN: | ||||||
|       from_secret: npm_token |       from_secret: npm_token | ||||||
|     PACKAGES_DESTINATION: gs://grafana-packages-testing |  | ||||||
|     STORYBOOK_DESTINATION: |     STORYBOOK_DESTINATION: | ||||||
|       from_secret: rgm_storybook_destination |       from_secret: rgm_storybook_destination | ||||||
|   image: google/cloud-sdk:alpine |   image: google/cloud-sdk:alpine | ||||||
|  | @ -3651,7 +3645,7 @@ steps: | ||||||
|     DOWNLOADS_DESTINATION: |     DOWNLOADS_DESTINATION: | ||||||
|       from_secret: rgm_downloads_destination |       from_secret: rgm_downloads_destination | ||||||
|     GCOM_API_KEY: |     GCOM_API_KEY: | ||||||
|       from_secret: grafana_api_key_dev |       from_secret: grafana_api_key | ||||||
|     GCP_KEY_BASE64: |     GCP_KEY_BASE64: | ||||||
|       from_secret: gcp_key_base64 |       from_secret: gcp_key_base64 | ||||||
|     GITHUB_TOKEN: |     GITHUB_TOKEN: | ||||||
|  | @ -3665,7 +3659,6 @@ steps: | ||||||
|       from_secret: packages_gpg_public_key |       from_secret: packages_gpg_public_key | ||||||
|     NPM_TOKEN: |     NPM_TOKEN: | ||||||
|       from_secret: npm_token |       from_secret: npm_token | ||||||
|     PACKAGES_DESTINATION: gs://grafana-packages-testing |  | ||||||
|     STORYBOOK_DESTINATION: |     STORYBOOK_DESTINATION: | ||||||
|       from_secret: rgm_storybook_destination |       from_secret: rgm_storybook_destination | ||||||
|   image: grafana/grafana-build:main |   image: grafana/grafana-build:main | ||||||
|  | @ -3693,7 +3686,7 @@ steps: | ||||||
|       from_secret: packages_secret_access_key |       from_secret: packages_secret_access_key | ||||||
|     service_account_json: |     service_account_json: | ||||||
|       from_secret: packages_service_account |       from_secret: packages_service_account | ||||||
|     target_bucket: grafana-packages-testing |     target_bucket: grafana-packages | ||||||
| - depends_on: | - depends_on: | ||||||
|   - rgm-publish |   - rgm-publish | ||||||
|   image: us.gcr.io/kubernetes-dev/package-publish:latest |   image: us.gcr.io/kubernetes-dev/package-publish:latest | ||||||
|  | @ -3713,7 +3706,7 @@ steps: | ||||||
|       from_secret: packages_secret_access_key |       from_secret: packages_secret_access_key | ||||||
|     service_account_json: |     service_account_json: | ||||||
|       from_secret: packages_service_account |       from_secret: packages_service_account | ||||||
|     target_bucket: grafana-packages-testing |     target_bucket: grafana-packages | ||||||
| trigger: | trigger: | ||||||
|   cron: |   cron: | ||||||
|     include: |     include: | ||||||
|  | @ -4475,43 +4468,6 @@ volumes: | ||||||
| - name: config | - name: config | ||||||
|   temp: {} |   temp: {} | ||||||
| --- | --- | ||||||
| clone: |  | ||||||
|   retries: 3 |  | ||||||
| kind: pipeline |  | ||||||
| name: grafana-com-nightly |  | ||||||
| platform: |  | ||||||
|   arch: amd64 |  | ||||||
|   os: linux |  | ||||||
| steps: |  | ||||||
| - commands: |  | ||||||
|   - go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd |  | ||||||
|   depends_on: [] |  | ||||||
|   environment: |  | ||||||
|     CGO_ENABLED: 0 |  | ||||||
|   image: golang:1.20.8-alpine |  | ||||||
|   name: compile-build-cmd |  | ||||||
| - commands: |  | ||||||
|   - ./bin/build publish grafana-com --edition oss |  | ||||||
|   depends_on: |  | ||||||
|   - compile-build-cmd |  | ||||||
|   environment: |  | ||||||
|     GCP_KEY: |  | ||||||
|       from_secret: gcp_key |  | ||||||
|     GRAFANA_COM_API_KEY: |  | ||||||
|       from_secret: grafana_api_key |  | ||||||
|   image: grafana/grafana-ci-deploy:1.3.3 |  | ||||||
|   name: post-to-grafana-com |  | ||||||
| trigger: |  | ||||||
|   cron: grafana-com-nightly |  | ||||||
|   event: cron |  | ||||||
| type: docker |  | ||||||
| volumes: |  | ||||||
| - host: |  | ||||||
|     path: /var/run/docker.sock |  | ||||||
|   name: docker |  | ||||||
| - name: config |  | ||||||
|   temp: {} |  | ||||||
| --- |  | ||||||
| get: | get: | ||||||
|   name: credentials.json |   name: credentials.json | ||||||
|   path: infra/data/ci/grafana-release-eng/grafanauploads |   path: infra/data/ci/grafana-release-eng/grafanauploads | ||||||
|  | @ -4530,12 +4486,6 @@ get: | ||||||
| kind: secret | kind: secret | ||||||
| name: grafana_api_key | name: grafana_api_key | ||||||
| --- | --- | ||||||
| get: |  | ||||||
|   name: api_key_dev |  | ||||||
|   path: infra/data/ci/grafana-release-eng/grafanacom |  | ||||||
| kind: secret |  | ||||||
| name: grafana_api_key_dev |  | ||||||
| --- |  | ||||||
| get: | get: | ||||||
|   name: .dockerconfigjson |   name: .dockerconfigjson | ||||||
|   path: secret/data/common/gcr |   path: secret/data/common/gcr | ||||||
|  | @ -4711,6 +4661,6 @@ kind: secret | ||||||
| name: gcr_credentials | name: gcr_credentials | ||||||
| --- | --- | ||||||
| kind: signature | kind: signature | ||||||
| hmac: 3f71fd4dab5e14bb69e9d7ba3881afc91fbac7db3207d48d11c1c66a05bae0dd | hmac: 68c3d5cfb08c1e5384f39ea57badfd6dbb46943a87d54571665ec29a1257b707 | ||||||
| 
 | 
 | ||||||
| ... | ... | ||||||
|  |  | ||||||
|  | @ -2,10 +2,6 @@ | ||||||
| This module provides functions for cronjob pipelines and steps used within. | This module provides functions for cronjob pipelines and steps used within. | ||||||
| """ | """ | ||||||
| 
 | 
 | ||||||
| load( |  | ||||||
|     "scripts/drone/steps/lib.star", |  | ||||||
|     "compile_build_cmd", |  | ||||||
| ) |  | ||||||
| load( | load( | ||||||
|     "scripts/drone/utils/images.star", |     "scripts/drone/utils/images.star", | ||||||
|     "images", |     "images", | ||||||
|  | @ -21,7 +17,6 @@ def cronjobs(): | ||||||
|         scan_docker_image_pipeline("latest-ubuntu"), |         scan_docker_image_pipeline("latest-ubuntu"), | ||||||
|         scan_docker_image_pipeline("main-ubuntu"), |         scan_docker_image_pipeline("main-ubuntu"), | ||||||
|         scan_build_test_publish_docker_image_pipeline(), |         scan_build_test_publish_docker_image_pipeline(), | ||||||
|         grafana_com_nightly_pipeline(), |  | ||||||
|     ] |     ] | ||||||
| 
 | 
 | ||||||
| def authenticate_gcr_step(): | def authenticate_gcr_step(): | ||||||
|  | @ -182,13 +177,3 @@ def post_to_grafana_com_step(): | ||||||
|         "depends_on": ["compile-build-cmd"], |         "depends_on": ["compile-build-cmd"], | ||||||
|         "commands": ["./bin/build publish grafana-com --edition oss"], |         "commands": ["./bin/build publish grafana-com --edition oss"], | ||||||
|     } |     } | ||||||
| 
 |  | ||||||
| def grafana_com_nightly_pipeline(): |  | ||||||
|     return cron_job_pipeline( |  | ||||||
|         cronName = "grafana-com-nightly", |  | ||||||
|         name = "grafana-com-nightly", |  | ||||||
|         steps = [ |  | ||||||
|             compile_build_cmd(), |  | ||||||
|             post_to_grafana_com_step(), |  | ||||||
|         ], |  | ||||||
|     ) |  | ||||||
|  |  | ||||||
|  | @ -103,7 +103,6 @@ def rgm_env_secrets(env): | ||||||
|     env["STORYBOOK_DESTINATION"] = from_secret(rgm_storybook_destination) |     env["STORYBOOK_DESTINATION"] = from_secret(rgm_storybook_destination) | ||||||
|     env["CDN_DESTINATION"] = from_secret(rgm_cdn_destination) |     env["CDN_DESTINATION"] = from_secret(rgm_cdn_destination) | ||||||
|     env["DOWNLOADS_DESTINATION"] = from_secret(rgm_downloads_destination) |     env["DOWNLOADS_DESTINATION"] = from_secret(rgm_downloads_destination) | ||||||
|     env["PACKAGES_DESTINATION"] = "gs://grafana-packages-testing" |  | ||||||
| 
 | 
 | ||||||
|     env["GCP_KEY_BASE64"] = from_secret(rgm_gcp_key_base64) |     env["GCP_KEY_BASE64"] = from_secret(rgm_gcp_key_base64) | ||||||
|     env["GITHUB_TOKEN"] = from_secret(rgm_github_token) |     env["GITHUB_TOKEN"] = from_secret(rgm_github_token) | ||||||
|  | @ -114,7 +113,7 @@ def rgm_env_secrets(env): | ||||||
|     env["DOCKER_USERNAME"] = from_secret("docker_username") |     env["DOCKER_USERNAME"] = from_secret("docker_username") | ||||||
|     env["DOCKER_PASSWORD"] = from_secret("docker_password") |     env["DOCKER_PASSWORD"] = from_secret("docker_password") | ||||||
|     env["NPM_TOKEN"] = from_secret(npm_token) |     env["NPM_TOKEN"] = from_secret(npm_token) | ||||||
|     env["GCOM_API_KEY"] = from_secret("grafana_api_key_dev") |     env["GCOM_API_KEY"] = from_secret("grafana_api_key") | ||||||
|     return env |     return env | ||||||
| 
 | 
 | ||||||
| def rgm_run(name, script): | def rgm_run(name, script): | ||||||
|  | @ -282,7 +281,7 @@ def rgm_nightly_publish(): | ||||||
|     dst = "$${DRONE_WORKSPACE}/dist" |     dst = "$${DRONE_WORKSPACE}/dist" | ||||||
| 
 | 
 | ||||||
|     publish_steps = with_deps(rgm_run("rgm-publish", "drone_publish_nightly_grafana.sh"), ["rgm-copy"]) |     publish_steps = with_deps(rgm_run("rgm-publish", "drone_publish_nightly_grafana.sh"), ["rgm-copy"]) | ||||||
|     package_steps = with_deps(rgm_publish_packages("grafana-packages-testing"), ["rgm-publish"]) |     package_steps = with_deps(rgm_publish_packages(), ["rgm-publish"]) | ||||||
| 
 | 
 | ||||||
|     return pipeline( |     return pipeline( | ||||||
|         name = "rgm-nightly-publish", |         name = "rgm-nightly-publish", | ||||||
|  |  | ||||||
|  | @ -43,7 +43,6 @@ def secrets(): | ||||||
|         vault_secret(gcp_grafanauploads, "infra/data/ci/grafana-release-eng/grafanauploads", "credentials.json"), |         vault_secret(gcp_grafanauploads, "infra/data/ci/grafana-release-eng/grafanauploads", "credentials.json"), | ||||||
|         vault_secret(gcp_grafanauploads_base64, "infra/data/ci/grafana-release-eng/grafanauploads", "credentials_base64"), |         vault_secret(gcp_grafanauploads_base64, "infra/data/ci/grafana-release-eng/grafanauploads", "credentials_base64"), | ||||||
|         vault_secret("grafana_api_key", "infra/data/ci/grafana-release-eng/grafanacom", "api_key"), |         vault_secret("grafana_api_key", "infra/data/ci/grafana-release-eng/grafanacom", "api_key"), | ||||||
|         vault_secret("grafana_api_key_dev", "infra/data/ci/grafana-release-eng/grafanacom", "api_key_dev"), |  | ||||||
|         vault_secret(pull_secret, "secret/data/common/gcr", ".dockerconfigjson"), |         vault_secret(pull_secret, "secret/data/common/gcr", ".dockerconfigjson"), | ||||||
|         vault_secret("github_token", "infra/data/ci/github/grafanabot", "pat"), |         vault_secret("github_token", "infra/data/ci/github/grafanabot", "pat"), | ||||||
|         vault_secret(drone_token, "infra/data/ci/drone", "machine-user-token"), |         vault_secret(drone_token, "infra/data/ci/drone", "machine-user-token"), | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue