|
|
@ -40,6 +40,19 @@ executors: |
|
|
|
docker: |
|
|
|
docker: |
|
|
|
- image: grafana/wix-toolset-ci:v3 |
|
|
|
- image: grafana/wix-toolset-ci:v3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commands: |
|
|
|
|
|
|
|
install-google-cloud-sdk: |
|
|
|
|
|
|
|
description: "Install Google Cloud SDK" |
|
|
|
|
|
|
|
steps: |
|
|
|
|
|
|
|
- run: |
|
|
|
|
|
|
|
name: "Install Google Cloud SDK" |
|
|
|
|
|
|
|
command: | |
|
|
|
|
|
|
|
VERSION=286.0.0 |
|
|
|
|
|
|
|
CHECKSUM=f199e38c988d53a913fc780b6f57ebda72db5f3848073cea805b39fe3e8e34fd |
|
|
|
|
|
|
|
curl -fLO https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${VERSION}-linux-x86_64.tar.gz |
|
|
|
|
|
|
|
echo $CHECKSUM google-cloud-sdk-${VERSION}-linux-x86_64.tar.gz | sha256sum --check --status |
|
|
|
|
|
|
|
tar xf google-cloud-sdk-${VERSION}-linux-x86_64.tar.gz |
|
|
|
|
|
|
|
|
|
|
|
jobs: |
|
|
|
jobs: |
|
|
|
install-grabpl: |
|
|
|
install-grabpl: |
|
|
|
description: Install the Grafana Build Pipeline tool |
|
|
|
description: Install the Grafana Build Pipeline tool |
|
|
@ -48,7 +61,7 @@ jobs: |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Install Grafana Build Pipeline |
|
|
|
name: Install Grafana Build Pipeline |
|
|
|
command: | |
|
|
|
command: | |
|
|
|
curl -fLO https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.2.5/grabpl |
|
|
|
curl -fLO https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v0.2.7/grabpl |
|
|
|
chmod +x grabpl |
|
|
|
chmod +x grabpl |
|
|
|
mkdir bin |
|
|
|
mkdir bin |
|
|
|
mv grabpl bin/ |
|
|
|
mv grabpl bin/ |
|
|
@ -129,6 +142,13 @@ jobs: |
|
|
|
- attach_workspace: |
|
|
|
- attach_workspace: |
|
|
|
at: /tmp/workspace |
|
|
|
at: /tmp/workspace |
|
|
|
- checkout |
|
|
|
- checkout |
|
|
|
|
|
|
|
- restore_cache: |
|
|
|
|
|
|
|
keys: |
|
|
|
|
|
|
|
# Use own cache for front-end builds, since for some reason it can't be unpacked for parts of the |
|
|
|
|
|
|
|
# pipeline |
|
|
|
|
|
|
|
- v1-yarn-build-{{ checksum "yarn.lock" }} |
|
|
|
|
|
|
|
# Used if checksum fails |
|
|
|
|
|
|
|
- v1-yarn-build- |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Increase node memory |
|
|
|
name: Increase node memory |
|
|
|
command: | |
|
|
|
command: | |
|
|
@ -136,6 +156,13 @@ jobs: |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: CI job started |
|
|
|
name: CI job started |
|
|
|
command: ./scripts/ci-job-started.sh |
|
|
|
command: ./scripts/ci-job-started.sh |
|
|
|
|
|
|
|
- run: |
|
|
|
|
|
|
|
name: Install dependencies |
|
|
|
|
|
|
|
command: yarn install --frozen-lockfile --no-progress |
|
|
|
|
|
|
|
- save_cache: |
|
|
|
|
|
|
|
key: v1-yarn-build-{{ checksum "yarn.lock" }} |
|
|
|
|
|
|
|
paths: |
|
|
|
|
|
|
|
- node_modules |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Build Grafana frontend |
|
|
|
name: Build Grafana frontend |
|
|
|
command: /tmp/workspace/bin/grabpl build-frontend --edition << parameters.edition >> |
|
|
|
command: /tmp/workspace/bin/grabpl build-frontend --edition << parameters.edition >> |
|
|
@ -212,20 +239,29 @@ jobs: |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: CI job started |
|
|
|
name: CI job started |
|
|
|
command: ./scripts/ci-job-started.sh |
|
|
|
command: ./scripts/ci-job-started.sh |
|
|
|
|
|
|
|
- install-google-cloud-sdk |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Copy artifacts from workspace |
|
|
|
name: Download packages from GCS |
|
|
|
command: cp -r /tmp/workspace/oss/dist . |
|
|
|
command: | |
|
|
|
|
|
|
|
# Work around an issue with the gsutil installation |
|
|
|
|
|
|
|
export BOTO_CONFIG=/dev/null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json |
|
|
|
|
|
|
|
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json |
|
|
|
|
|
|
|
mkdir dist |
|
|
|
|
|
|
|
./google-cloud-sdk/bin/gsutil -m rsync -d -r gs://grafana-build-pipeline/oss/packages/${CIRCLE_WORKFLOW_ID}/ dist/ |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Build Windows installer |
|
|
|
name: Build Windows installer |
|
|
|
command: ./scripts/build/ci-msi-build/ci-msi-build-oss.sh |
|
|
|
command: ./scripts/build/ci-msi-build/ci-msi-build-oss.sh |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Move artifacts |
|
|
|
name: Upload installer to GCS |
|
|
|
command: mkdir oss && mv dist oss/ |
|
|
|
command: | |
|
|
|
- persist_to_workspace: |
|
|
|
# Work around an issue with the gsutil installation |
|
|
|
root: . |
|
|
|
export BOTO_CONFIG=/dev/null |
|
|
|
paths: |
|
|
|
|
|
|
|
- oss/dist/grafana-*.msi |
|
|
|
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json |
|
|
|
- oss/dist/grafana-*.msi.sha256 |
|
|
|
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json |
|
|
|
|
|
|
|
./google-cloud-sdk/bin/gsutil -m cp dist/grafana-*.msi* gs://grafana-build-pipeline/oss/packages/${CIRCLE_WORKFLOW_ID}/ |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: CI job failed |
|
|
|
name: CI job failed |
|
|
|
command: ./scripts/ci-job-failed.sh |
|
|
|
command: ./scripts/ci-job-failed.sh |
|
|
@ -251,20 +287,29 @@ jobs: |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: CI job started |
|
|
|
name: CI job started |
|
|
|
command: "./scripts/ci-job-started.sh" |
|
|
|
command: "./scripts/ci-job-started.sh" |
|
|
|
|
|
|
|
- install-google-cloud-sdk |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Copy artifacts from workspace |
|
|
|
name: Download packages from GCS |
|
|
|
command: cp -r /tmp/workspace/enterprise/dist enterprise-dist |
|
|
|
command: | |
|
|
|
|
|
|
|
# Work around an issue with the gsutil installation |
|
|
|
|
|
|
|
export BOTO_CONFIG=/dev/null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json |
|
|
|
|
|
|
|
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json |
|
|
|
|
|
|
|
mkdir enterprise-dist |
|
|
|
|
|
|
|
./google-cloud-sdk/bin/gsutil -m rsync -d -r gs://grafana-build-pipeline/enterprise/packages/${CIRCLE_WORKFLOW_ID}/ enterprise-dist/ |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Build Windows installer |
|
|
|
name: Build Windows installer |
|
|
|
command: ./scripts/build/ci-msi-build/ci-msi-build-ee.sh |
|
|
|
command: ./scripts/build/ci-msi-build/ci-msi-build-ee.sh |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Move artifacts |
|
|
|
name: Upload installer to GCS |
|
|
|
command: mkdir enterprise && mv enterprise-dist enterprise/dist |
|
|
|
command: | |
|
|
|
- persist_to_workspace: |
|
|
|
# Work around an issue with the gsutil installation |
|
|
|
root: . |
|
|
|
export BOTO_CONFIG=/dev/null |
|
|
|
paths: |
|
|
|
|
|
|
|
- enterprise/dist/grafana-*.msi |
|
|
|
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json |
|
|
|
- enterprise/dist/grafana-*.msi.sha256 |
|
|
|
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json |
|
|
|
|
|
|
|
./google-cloud-sdk/bin/gsutil -m cp enterprise-dist/grafana-*.msi* gs://grafana-build-pipeline/enterprise/packages/${CIRCLE_WORKFLOW_ID}/ |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: CI job failed |
|
|
|
name: CI job failed |
|
|
|
command: "./scripts/ci-job-failed.sh" |
|
|
|
command: "./scripts/ci-job-failed.sh" |
|
|
@ -317,6 +362,7 @@ jobs: |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: CI job started |
|
|
|
name: CI job started |
|
|
|
command: ./scripts/ci-job-started.sh |
|
|
|
command: ./scripts/ci-job-started.sh |
|
|
|
|
|
|
|
- install-google-cloud-sdk |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Copy artifacts from workspace |
|
|
|
name: Copy artifacts from workspace |
|
|
|
command: cp -r /tmp/workspace/oss/* . |
|
|
|
command: cp -r /tmp/workspace/oss/* . |
|
|
@ -343,14 +389,14 @@ jobs: |
|
|
|
linux-x64,linux-x64-musl,osx64,win64 |
|
|
|
linux-x64,linux-x64-musl,osx64,win64 |
|
|
|
fi |
|
|
|
fi |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Move artifacts |
|
|
|
name: Upload packages to GCS |
|
|
|
command: | |
|
|
|
command: | |
|
|
|
mkdir -p oss |
|
|
|
# Work around an issue with the gsutil installation |
|
|
|
mv dist oss/ |
|
|
|
export BOTO_CONFIG=/dev/null |
|
|
|
- persist_to_workspace: |
|
|
|
|
|
|
|
root: . |
|
|
|
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json |
|
|
|
paths: |
|
|
|
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json |
|
|
|
- oss/dist/* |
|
|
|
./google-cloud-sdk/bin/gsutil -m rsync -r dist gs://grafana-build-pipeline/oss/packages/${CIRCLE_WORKFLOW_ID} |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: CI job failed |
|
|
|
name: CI job failed |
|
|
|
command: ./scripts/ci-job-failed.sh |
|
|
|
command: ./scripts/ci-job-failed.sh |
|
|
@ -376,6 +422,7 @@ jobs: |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: CI job started |
|
|
|
name: CI job started |
|
|
|
command: ./scripts/ci-job-started.sh |
|
|
|
command: ./scripts/ci-job-started.sh |
|
|
|
|
|
|
|
- install-google-cloud-sdk |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Copy artifacts from workspace |
|
|
|
name: Copy artifacts from workspace |
|
|
|
command: cp -r /tmp/workspace/enterprise/* . |
|
|
|
command: cp -r /tmp/workspace/enterprise/* . |
|
|
@ -397,14 +444,14 @@ jobs: |
|
|
|
linux-x64,linux-x64-musl,osx64,win64 |
|
|
|
linux-x64,linux-x64-musl,osx64,win64 |
|
|
|
fi |
|
|
|
fi |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Move artifacts |
|
|
|
name: Upload packages to GCS |
|
|
|
command: | |
|
|
|
command: | |
|
|
|
mkdir -p enterprise |
|
|
|
# Work around an issue with the gsutil installation |
|
|
|
mv dist enterprise/ |
|
|
|
export BOTO_CONFIG=/dev/null |
|
|
|
- persist_to_workspace: |
|
|
|
|
|
|
|
root: . |
|
|
|
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json |
|
|
|
paths: |
|
|
|
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json |
|
|
|
- enterprise/dist/* |
|
|
|
./google-cloud-sdk/bin/gsutil -m rsync -r dist gs://grafana-build-pipeline/enterprise/packages/${CIRCLE_WORKFLOW_ID} |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: CI job failed |
|
|
|
name: CI job failed |
|
|
|
command: ./scripts/ci-job-failed.sh |
|
|
|
command: ./scripts/ci-job-failed.sh |
|
|
@ -434,10 +481,20 @@ jobs: |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: CI job started |
|
|
|
name: CI job started |
|
|
|
command: ./scripts/ci-job-started.sh |
|
|
|
command: ./scripts/ci-job-started.sh |
|
|
|
|
|
|
|
- install-google-cloud-sdk |
|
|
|
|
|
|
|
- run: |
|
|
|
|
|
|
|
name: Download packages from GCS |
|
|
|
|
|
|
|
command: | |
|
|
|
|
|
|
|
# Work around an issue with the gsutil installation |
|
|
|
|
|
|
|
export BOTO_CONFIG=/dev/null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json |
|
|
|
|
|
|
|
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json |
|
|
|
|
|
|
|
mkdir dist |
|
|
|
|
|
|
|
./google-cloud-sdk/bin/gsutil -m rsync -d -r gs://grafana-build-pipeline/<< parameters.edition >>/packages/${CIRCLE_WORKFLOW_ID}/ dist/ |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Publish packages |
|
|
|
name: Publish packages |
|
|
|
command: | |
|
|
|
command: | |
|
|
|
cp -r /tmp/workspace/<< parameters.edition >>/dist . |
|
|
|
|
|
|
|
if [[ $CIRCLE_BRANCH == "chore/test-release-pipeline" ]]; then |
|
|
|
if [[ $CIRCLE_BRANCH == "chore/test-release-pipeline" ]]; then |
|
|
|
# We're testing the release pipeline |
|
|
|
# We're testing the release pipeline |
|
|
|
/tmp/workspace/bin/grabpl publish-packages --edition << parameters.edition >> \ |
|
|
|
/tmp/workspace/bin/grabpl publish-packages --edition << parameters.edition >> \ |
|
|
@ -518,13 +575,20 @@ jobs: |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: CI job started |
|
|
|
name: CI job started |
|
|
|
command: ./scripts/ci-job-started.sh |
|
|
|
command: ./scripts/ci-job-started.sh |
|
|
|
|
|
|
|
- install-google-cloud-sdk |
|
|
|
|
|
|
|
- run: |
|
|
|
|
|
|
|
name: Download packages from GCS |
|
|
|
|
|
|
|
command: | |
|
|
|
|
|
|
|
# Work around an issue with the gsutil installation |
|
|
|
|
|
|
|
export BOTO_CONFIG=/dev/null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json |
|
|
|
|
|
|
|
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json |
|
|
|
|
|
|
|
mkdir dist |
|
|
|
|
|
|
|
./google-cloud-sdk/bin/gsutil -m rsync -d -r gs://grafana-build-pipeline/<< parameters.edition >>/packages/${CIRCLE_WORKFLOW_ID}/ dist/ |
|
|
|
- run: docker info |
|
|
|
- run: docker info |
|
|
|
# XXX: Is this necessary? |
|
|
|
# XXX: Is this necessary? |
|
|
|
- run: docker run --privileged linuxkit/binfmt:v0.6 |
|
|
|
- run: docker run --privileged linuxkit/binfmt:v0.6 |
|
|
|
- run: |
|
|
|
|
|
|
|
name: Copy Grafana archives |
|
|
|
|
|
|
|
command: | |
|
|
|
|
|
|
|
cp -r /tmp/workspace/<< parameters.edition >>/dist . |
|
|
|
|
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: Build Docker images |
|
|
|
name: Build Docker images |
|
|
|
command: | |
|
|
|
command: | |
|
|
@ -569,14 +633,28 @@ jobs: |
|
|
|
- attach_workspace: |
|
|
|
- attach_workspace: |
|
|
|
at: /tmp/workspace |
|
|
|
at: /tmp/workspace |
|
|
|
- checkout |
|
|
|
- checkout |
|
|
|
|
|
|
|
- install-google-cloud-sdk |
|
|
|
|
|
|
|
- run: |
|
|
|
|
|
|
|
name: Download packages from GCS |
|
|
|
|
|
|
|
command: | |
|
|
|
|
|
|
|
# Work around an issue with the gsutil installation |
|
|
|
|
|
|
|
export BOTO_CONFIG=/dev/null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json |
|
|
|
|
|
|
|
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json |
|
|
|
|
|
|
|
mkdir dist |
|
|
|
|
|
|
|
./google-cloud-sdk/bin/gsutil -m rsync -d -r gs://grafana-build-pipeline/oss/packages/${CIRCLE_WORKFLOW_ID}/ dist/ |
|
|
|
- restore_cache: |
|
|
|
- restore_cache: |
|
|
|
key: dependency-cache-{{ checksum "yarn.lock" }} |
|
|
|
keys: |
|
|
|
|
|
|
|
- v2-yarn-{{ checksum "yarn.lock" }} |
|
|
|
|
|
|
|
# Used if checksum fails |
|
|
|
|
|
|
|
- v2-yarn- |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: yarn install |
|
|
|
name: yarn install |
|
|
|
command: yarn install --pure-lockfile --no-progress |
|
|
|
command: yarn install --frozen-lockfile --no-progress |
|
|
|
no_output_timeout: 5m |
|
|
|
no_output_timeout: 5m |
|
|
|
- save_cache: |
|
|
|
- save_cache: |
|
|
|
key: dependency-cache-{{ checksum "yarn.lock" }} |
|
|
|
key: v2-yarn-{{ checksum "yarn.lock" }} |
|
|
|
paths: |
|
|
|
paths: |
|
|
|
- node_modules |
|
|
|
- node_modules |
|
|
|
- run: |
|
|
|
- run: |
|
|
@ -718,13 +796,16 @@ jobs: |
|
|
|
name: CI job started |
|
|
|
name: CI job started |
|
|
|
command: "./scripts/ci-job-started.sh" |
|
|
|
command: "./scripts/ci-job-started.sh" |
|
|
|
- restore_cache: |
|
|
|
- restore_cache: |
|
|
|
key: dependency-cache-{{ checksum "yarn.lock" }} |
|
|
|
keys: |
|
|
|
|
|
|
|
- v2-yarn-{{ checksum "yarn.lock" }} |
|
|
|
|
|
|
|
# Used if checksum fails |
|
|
|
|
|
|
|
- v2-yarn- |
|
|
|
- run: |
|
|
|
- run: |
|
|
|
name: yarn install |
|
|
|
name: yarn install |
|
|
|
command: "yarn install --frozen-lockfile --no-progress" |
|
|
|
command: "yarn install --frozen-lockfile --no-progress" |
|
|
|
no_output_timeout: 15m |
|
|
|
no_output_timeout: 15m |
|
|
|
- save_cache: |
|
|
|
- save_cache: |
|
|
|
key: dependency-cache-{{ checksum "yarn.lock" }} |
|
|
|
key: v2-yarn-{{ checksum "yarn.lock" }} |
|
|
|
paths: |
|
|
|
paths: |
|
|
|
- node_modules |
|
|
|
- node_modules |
|
|
|
- run: |
|
|
|
- run: |
|
|
|