Commit 3cf82df8 by Arve Knudsen Committed by GitHub

CircleCI: Revert to using shared workspace instead of GCS (#23190)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent 8103c3e2
...@@ -44,18 +44,6 @@ executors: ...@@ -44,18 +44,6 @@ executors:
- image: grafana/wix-toolset-ci:v3 - image: grafana/wix-toolset-ci:v3
commands: 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
install-grabpl: install-grabpl:
description: "Install Grafana build pipeline tool" description: "Install Grafana build pipeline tool"
steps: steps:
...@@ -233,33 +221,26 @@ jobs: ...@@ -233,33 +221,26 @@ jobs:
build-oss-windows-installer: build-oss-windows-installer:
executor: windows-installer executor: windows-installer
steps: steps:
- attach_workspace:
at: /tmp/workspace
- checkout - checkout
- 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: Download packages from GCS name: Copy artifacts from workspace
command: | command: cp -r /tmp/workspace/oss/dist .
# 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: Upload installer to GCS name: Move artifacts
command: | command: mkdir oss && mv dist oss/
# Work around an issue with the gsutil installation - persist_to_workspace:
export BOTO_CONFIG=/dev/null root: .
paths:
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json - oss/dist/grafana-*.msi
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json - oss/dist/grafana-*.msi.sha256
./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
...@@ -279,33 +260,26 @@ jobs: ...@@ -279,33 +260,26 @@ jobs:
echo "Nothing to do for forked PRs, so marking this step successful" echo "Nothing to do for forked PRs, so marking this step successful"
circleci step halt circleci step halt
fi fi
- attach_workspace:
at: /tmp/workspace
- checkout - checkout
- 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: Download packages from GCS name: Copy artifacts from workspace
command: | command: cp -r /tmp/workspace/enterprise/dist enterprise-dist
# 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: Upload installer to GCS name: Move artifacts
command: | command: mkdir enterprise && mv enterprise-dist enterprise/dist
# Work around an issue with the gsutil installation - persist_to_workspace:
export BOTO_CONFIG=/dev/null root: .
paths:
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json - enterprise/dist/grafana-*.msi
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json - enterprise/dist/grafana-*.msi.sha256
./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"
...@@ -357,7 +331,6 @@ jobs: ...@@ -357,7 +331,6 @@ jobs:
name: CI job started name: CI job started
command: ./scripts/ci-job-started.sh command: ./scripts/ci-job-started.sh
- install-grabpl - install-grabpl
- 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/* .
...@@ -384,14 +357,14 @@ jobs: ...@@ -384,14 +357,14 @@ jobs:
linux-x64,linux-x64-musl,osx64,win64 linux-x64,linux-x64-musl,osx64,win64
fi fi
- run: - run:
name: Upload packages to GCS name: Move artifacts
command: | command: |
# Work around an issue with the gsutil installation mkdir -p oss
export BOTO_CONFIG=/dev/null mv dist oss/
- persist_to_workspace:
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json root: .
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json paths:
./google-cloud-sdk/bin/gsutil -m rsync -r dist gs://grafana-build-pipeline/oss/packages/${CIRCLE_WORKFLOW_ID} - oss/dist/*
- run: - run:
name: CI job failed name: CI job failed
command: ./scripts/ci-job-failed.sh command: ./scripts/ci-job-failed.sh
...@@ -417,7 +390,6 @@ jobs: ...@@ -417,7 +390,6 @@ 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
- install-grabpl - install-grabpl
- run: - run:
name: Copy artifacts from workspace name: Copy artifacts from workspace
...@@ -440,14 +412,14 @@ jobs: ...@@ -440,14 +412,14 @@ jobs:
linux-x64,linux-x64-musl,osx64,win64 linux-x64,linux-x64-musl,osx64,win64
fi fi
- run: - run:
name: Upload packages to GCS name: Move artifacts
command: | command: |
# Work around an issue with the gsutil installation mkdir -p enterprise
export BOTO_CONFIG=/dev/null mv dist enterprise/
- persist_to_workspace:
echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json root: .
./google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=/tmp/gcpkey.json paths:
./google-cloud-sdk/bin/gsutil -m rsync -r dist gs://grafana-build-pipeline/enterprise/packages/${CIRCLE_WORKFLOW_ID} - enterprise/dist/*
- run: - run:
name: CI job failed name: CI job failed
command: ./scripts/ci-job-failed.sh command: ./scripts/ci-job-failed.sh
...@@ -464,10 +436,6 @@ jobs: ...@@ -464,10 +436,6 @@ jobs:
type: string type: string
executor: grafana-publish executor: grafana-publish
steps: steps:
# Have to attach the workspace, because grabpl publish-packages uses
# /tmp/workspace/scripts/build/release_publisher/release_publisher
- attach_workspace:
at: /tmp/workspace
- run: - run:
name: Exit if forked PR name: Exit if forked PR
command: | command: |
...@@ -475,25 +443,17 @@ jobs: ...@@ -475,25 +443,17 @@ jobs:
echo "Nothing to do for forked PRs, so marking this step successful" echo "Nothing to do for forked PRs, so marking this step successful"
circleci step halt circleci step halt
fi fi
- attach_workspace:
at: /tmp/workspace
- checkout - checkout
- 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
- install-grabpl - install-grabpl
- run: - 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:
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/grabpl publish-packages --edition << parameters.edition >> \ /tmp/grabpl publish-packages --edition << parameters.edition >> \
...@@ -571,6 +531,8 @@ jobs: ...@@ -571,6 +531,8 @@ jobs:
echo "Nothing to do for forked PRs, so marking this step successful" echo "Nothing to do for forked PRs, so marking this step successful"
circleci step halt circleci step halt
fi fi
- attach_workspace:
at: /tmp/workspace
- checkout - checkout
- run: - run:
name: CI job started name: CI job started
...@@ -578,21 +540,14 @@ jobs: ...@@ -578,21 +540,14 @@ jobs:
- setup_remote_docker: - setup_remote_docker:
# This version is necessary for building cross-platform images # This version is necessary for building cross-platform images
version: 18.09.3 version: 18.09.3
- install-google-cloud-sdk
- install-grabpl - install-grabpl
- 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/
# 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: - run:
name: Copy Grafana archives
command: |
cp -r /tmp/workspace/<< parameters.edition >>/dist .
- run:
name: Build Docker images name: Build Docker images
command: | command: |
if [[ -n $CIRCLE_TAG || $CIRCLE_BRANCH == "chore/test-release-pipeline" || $CIRCLE_BRANCH == "master" ]]; then if [[ -n $CIRCLE_TAG || $CIRCLE_BRANCH == "chore/test-release-pipeline" || $CIRCLE_BRANCH == "master" ]]; then
...@@ -633,18 +588,9 @@ jobs: ...@@ -633,18 +588,9 @@ jobs:
docker: docker:
- image: circleci/node:12-browsers - image: circleci/node:12-browsers
steps: steps:
- attach_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:
keys: keys:
- v2-yarn-{{ checksum "yarn.lock" }} - v2-yarn-{{ checksum "yarn.lock" }}
...@@ -659,6 +605,11 @@ jobs: ...@@ -659,6 +605,11 @@ jobs:
paths: paths:
- node_modules - node_modules
- run: - run:
name: Copy artifacts from workspace
command: |
mkdir -p dist
cp -r /tmp/workspace/oss/dist/*.tar.gz dist/
- run:
name: Start grafana-server name: Start grafana-server
command: ./e2e/start-server command: ./e2e/start-server
background: true background: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment