CDN: Add CDN upload step to enterprise and release pipelines (#31058)

* CDN: Fixing drone CI config

* was in wrong dir when I executed command

* removed whitespace

* Update path

* Update Drone master and enterprise piplelines with CDN Upload

* Update test

* removed whitespace

* Go back to public folder defined

* updated build-pipeline

* Updated drone

* wrong version
This commit is contained in:
Torkel Ödegaard
2021-02-10 08:58:41 +01:00
committed by GitHub
parent 9679b15ef9
commit d6e8e47698
8 changed files with 125 additions and 26 deletions

View File

@@ -17,7 +17,7 @@ steps:
image: grafana/build-container:1.3.2
commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl
- chmod +x bin/grabpl
- ./bin/grabpl verify-drone
- curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz
@@ -259,7 +259,7 @@ steps:
image: grafana/build-container:1.3.2
commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl
- chmod +x bin/grabpl
- ./bin/grabpl verify-drone
- curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz
@@ -591,7 +591,7 @@ steps:
image: grafana/ci-wix:0.1.1
commands:
- $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/windows/grabpl.exe -OutFile grabpl.exe
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/windows/grabpl.exe -OutFile grabpl.exe
- .\grabpl.exe verify-drone
- name: build-windows-installer
@@ -641,7 +641,7 @@ steps:
image: grafana/build-container:1.3.2
commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl
- chmod +x bin/grabpl
- ./bin/grabpl verify-drone
environment:
@@ -726,7 +726,7 @@ steps:
image: grafana/build-container:1.3.2
commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl
- chmod +x bin/grabpl
- ./bin/grabpl verify-drone
- ./bin/grabpl verify-version ${DRONE_TAG}
@@ -944,6 +944,16 @@ steps:
- test-backend
- test-frontend
- name: upload-cdn-assets
image: grafana/grafana-ci-deploy:1.3.1
commands:
- ./bin/grabpl upload-cdn --edition oss --bucket "grafana-static-assets"
environment:
GCP_GRAFANA_UPLOAD_KEY:
from_secret: gcp_key
depends_on:
- package
- name: upload-packages
image: grafana/grafana-ci-deploy:1.3.1
commands:
@@ -1023,7 +1033,7 @@ steps:
image: grafana/ci-wix:0.1.1
commands:
- $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/windows/grabpl.exe -OutFile grabpl.exe
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/windows/grabpl.exe -OutFile grabpl.exe
- .\grabpl.exe verify-drone
- name: build-windows-installer
@@ -1074,7 +1084,7 @@ steps:
image: grafana/build-container:1.3.2
commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl
- chmod +x bin/grabpl
- git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
- cd grafana-enterprise
@@ -1335,6 +1345,16 @@ steps:
- test-backend
- test-frontend
- name: upload-cdn-assets
image: grafana/grafana-ci-deploy:1.3.1
commands:
- ./bin/grabpl upload-cdn --edition enterprise --bucket "grafana-static-assets"
environment:
GCP_GRAFANA_UPLOAD_KEY:
from_secret: gcp_key
depends_on:
- package
- name: upload-packages
image: grafana/grafana-ci-deploy:1.3.1
commands:
@@ -1366,6 +1386,16 @@ steps:
depends_on:
- gen-version
- name: upload-cdn-assets-enterprise2
image: grafana/grafana-ci-deploy:1.3.1
commands:
- ./bin/grabpl upload-cdn --edition enterprise2 --bucket "grafana-static-assets"
environment:
GCP_GRAFANA_UPLOAD_KEY:
from_secret: gcp_key
depends_on:
- package-enterprise2
- name: end-to-end-tests-server-enterprise2
image: grafana/build-container:1.3.2
detach: true
@@ -1444,7 +1474,7 @@ steps:
image: grafana/ci-wix:0.1.1
commands:
- $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/windows/grabpl.exe -OutFile grabpl.exe
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/windows/grabpl.exe -OutFile grabpl.exe
- git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git"
- cd grafana-enterprise
- git checkout ${DRONE_TAG}
@@ -1510,7 +1540,7 @@ steps:
image: grafana/build-container:1.3.2
commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl
- chmod +x bin/grabpl
- ./bin/grabpl verify-drone
- ./bin/grabpl verify-version ${DRONE_TAG}
@@ -1615,7 +1645,7 @@ steps:
image: grafana/build-container:1.3.2
commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl
- chmod +x bin/grabpl
- ./bin/grabpl verify-drone
- ./bin/grabpl verify-version v7.3.0-test
@@ -1827,6 +1857,16 @@ steps:
- test-backend
- test-frontend
- name: upload-cdn-assets
image: grafana/grafana-ci-deploy:1.3.1
commands:
- ./bin/grabpl upload-cdn --edition oss --bucket "grafana-static-assets"
environment:
GCP_GRAFANA_UPLOAD_KEY:
from_secret: gcp_key
depends_on:
- package
- name: upload-packages
image: grafana/grafana-ci-deploy:1.3.1
commands:
@@ -1901,7 +1941,7 @@ steps:
image: grafana/ci-wix:0.1.1
commands:
- $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/windows/grabpl.exe -OutFile grabpl.exe
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/windows/grabpl.exe -OutFile grabpl.exe
- .\grabpl.exe verify-drone
- name: build-windows-installer
@@ -1952,7 +1992,7 @@ steps:
image: grafana/build-container:1.3.2
commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl
- chmod +x bin/grabpl
- git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
- cd grafana-enterprise
@@ -2207,6 +2247,16 @@ steps:
- test-backend
- test-frontend
- name: upload-cdn-assets
image: grafana/grafana-ci-deploy:1.3.1
commands:
- ./bin/grabpl upload-cdn --edition enterprise --bucket "grafana-static-assets"
environment:
GCP_GRAFANA_UPLOAD_KEY:
from_secret: gcp_key
depends_on:
- package
- name: upload-packages
image: grafana/grafana-ci-deploy:1.3.1
commands:
@@ -2238,6 +2288,16 @@ steps:
depends_on:
- gen-version
- name: upload-cdn-assets-enterprise2
image: grafana/grafana-ci-deploy:1.3.1
commands:
- ./bin/grabpl upload-cdn --edition enterprise2 --bucket "grafana-static-assets"
environment:
GCP_GRAFANA_UPLOAD_KEY:
from_secret: gcp_key
depends_on:
- package-enterprise2
- name: end-to-end-tests-server-enterprise2
image: grafana/build-container:1.3.2
detach: true
@@ -2316,7 +2376,7 @@ steps:
image: grafana/ci-wix:0.1.1
commands:
- $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/windows/grabpl.exe -OutFile grabpl.exe
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/windows/grabpl.exe -OutFile grabpl.exe
- git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git"
- cd grafana-enterprise
- git checkout master
@@ -2382,7 +2442,7 @@ steps:
image: grafana/build-container:1.3.2
commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl
- chmod +x bin/grabpl
- ./bin/grabpl verify-drone
- ./bin/grabpl verify-version v7.3.0-test
@@ -2487,7 +2547,7 @@ steps:
image: grafana/build-container:1.3.2
commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl
- chmod +x bin/grabpl
- ./bin/grabpl verify-drone
- curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz
@@ -2695,6 +2755,16 @@ steps:
- test-backend
- test-frontend
- name: upload-cdn-assets
image: grafana/grafana-ci-deploy:1.3.1
commands:
- ./bin/grabpl upload-cdn --edition oss --bucket "grafana-static-assets"
environment:
GCP_GRAFANA_UPLOAD_KEY:
from_secret: gcp_key
depends_on:
- package
- name: upload-packages
image: grafana/grafana-ci-deploy:1.3.1
commands:
@@ -2748,7 +2818,7 @@ steps:
image: grafana/ci-wix:0.1.1
commands:
- $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/windows/grabpl.exe -OutFile grabpl.exe
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/windows/grabpl.exe -OutFile grabpl.exe
- .\grabpl.exe verify-drone
- name: build-windows-installer
@@ -2795,7 +2865,7 @@ steps:
image: grafana/build-container:1.3.2
commands:
- mkdir -p bin
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl
- chmod +x bin/grabpl
- git clone "https://$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
- cd grafana-enterprise
@@ -3053,6 +3123,16 @@ steps:
- test-backend
- test-frontend
- name: upload-cdn-assets
image: grafana/grafana-ci-deploy:1.3.1
commands:
- ./bin/grabpl upload-cdn --edition enterprise --bucket "grafana-static-assets"
environment:
GCP_GRAFANA_UPLOAD_KEY:
from_secret: gcp_key
depends_on:
- package
- name: upload-packages
image: grafana/grafana-ci-deploy:1.3.1
commands:
@@ -3084,6 +3164,16 @@ steps:
depends_on:
- gen-version
- name: upload-cdn-assets-enterprise2
image: grafana/grafana-ci-deploy:1.3.1
commands:
- ./bin/grabpl upload-cdn --edition enterprise2 --bucket "grafana-static-assets"
environment:
GCP_GRAFANA_UPLOAD_KEY:
from_secret: gcp_key
depends_on:
- package-enterprise2
- name: end-to-end-tests-server-enterprise2
image: grafana/build-container:1.3.2
detach: true
@@ -3162,7 +3252,7 @@ steps:
image: grafana/ci-wix:0.1.1
commands:
- $$ProgressPreference = "SilentlyContinue"
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/windows/grabpl.exe -OutFile grabpl.exe
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/windows/grabpl.exe -OutFile grabpl.exe
- git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-enterprise.git"
- cd grafana-enterprise
- git checkout $$env:DRONE_BRANCH

View File

@@ -43,7 +43,7 @@ get_file "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-l
"b4138199aa755ebfe171b57cc46910b13258ace5fbc4eaa099c42607cd0bff32"
chmod +x /usr/local/bin/cc-test-reporter
curl -fL -o /usr/local/bin/grabpl "https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl"
curl -fL -o /usr/local/bin/grabpl "https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl"
apk add --no-cache git
# Install Mage

View File

@@ -44,7 +44,7 @@ get_file "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-l
"e1be1930379bd169d3a8e82135cf57216ad52ecfaf520b5804f269721e4dcc3d"
chmod 755 /usr/local/bin/cc-test-reporter
wget -O /usr/local/bin/grabpl "https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl"
wget -O /usr/local/bin/grabpl "https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl"
chmod +x /usr/local/bin/grabpl
# Install Mage

View File

@@ -27,7 +27,7 @@ get_file "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-l
"b4138199aa755ebfe171b57cc46910b13258ace5fbc4eaa099c42607cd0bff32"
chmod +x /usr/local/bin/cc-test-reporter
wget -O /usr/local/bin/grabpl "https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.37/grabpl"
wget -O /usr/local/bin/grabpl "https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.5.38/grabpl"
chmod +x /usr/local/bin/grabpl
# Install Mage

View File

@@ -1,4 +1,4 @@
grabpl_version = '0.5.37'
grabpl_version = '0.5.38'
build_image = 'grafana/build-container:1.3.2'
publish_image = 'grafana/grafana-ci-deploy:1.3.1'
grafana_docker_image = 'grafana/drone-grafana-docker:0.3.2'
@@ -310,11 +310,15 @@ def publish_storybook_step(edition, ver_mode):
}
def upload_cdn(edition):
sfx = ''
if edition == 'enterprise2':
sfx = '-{}'.format(edition)
return {
'name': 'upload-cdn-assets',
'name': 'upload-cdn-assets' + sfx,
'image': publish_image,
'depends_on': [
'package',
'package' + sfx,
],
'environment': {
'GCP_GRAFANA_UPLOAD_KEY': {

View File

@@ -80,7 +80,7 @@ def get_steps(edition, is_downstream=False):
release_canary_npm_packages_step(edition),
upload_packages_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream),
deploy_to_kubernetes_step(edition=edition, is_downstream=is_downstream),
upload_cdn(edition)
upload_cdn(edition=edition)
])
if include_enterprise2:
@@ -90,6 +90,7 @@ def get_steps(edition, is_downstream=False):
e2e_tests_server_step(edition=edition2, port=3002),
e2e_tests_step(edition=edition2, port=3002),
upload_packages_step(edition=edition2, ver_mode=ver_mode, is_downstream=is_downstream),
upload_cdn(edition=edition2)
])
windows_steps = get_windows_steps(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream)

View File

@@ -31,6 +31,7 @@ load(
'notify_pipeline',
'integration_test_services',
'publish_packages_step',
'upload_cdn'
)
def release_npm_packages_step(edition, ver_mode):
@@ -99,7 +100,9 @@ def get_steps(edition, ver_mode):
postgres_integration_tests_step(),
mysql_integration_tests_step(),
])
if should_upload:
steps.append(upload_cdn(edition=edition))
steps.append(upload_packages_step(edition=edition, ver_mode=ver_mode))
if should_publish:
steps.extend([
@@ -112,6 +115,7 @@ def get_steps(edition, ver_mode):
edition2 = 'enterprise2'
steps.extend([
package_step(edition=edition2, ver_mode=ver_mode, variants=['linux-x64']),
upload_cdn(edition=edition2),
e2e_tests_server_step(edition=edition2, port=3002),
e2e_tests_step(edition=edition2, port=3002),
])