From 89ef62f163e2a821f843fb6cbb35fa0a0ecf082c Mon Sep 17 00:00:00 2001 From: Sriram <153843+yesoreyeram@users.noreply.github.com> Date: Fri, 27 Jan 2023 14:19:42 +0000 Subject: [PATCH] Chore: Removed unused grafana-plugin-ci images (#62219) removed unused grafana-plugin-ci images --- .../grafana-plugin-ci-alpine/Dockerfile | 10 -- .../docker/grafana-plugin-ci-alpine/README.md | 71 -------- .../docker/grafana-plugin-ci-alpine/build.sh | 22 --- .../docker/grafana-plugin-ci-alpine/common.sh | 8 - .../grafana-plugin-ci-alpine/install/bin/cp | 7 - .../install/bin/ginstall | 73 --------- .../install/bin/githubRelease.js | 154 ------------------ .../scripts/deploy-common.sh | 52 ------ .../scripts/deploy-user.sh | 3 - .../scripts/deploy.sh | 80 --------- .../test/docker-compose.yml | 18 -- .../grafana-plugin-ci-alpine/test/start.sh | 14 -- .../docker/grafana-plugin-ci-e2e/Dockerfile | 9 - .../docker/grafana-plugin-ci-e2e/README.md | 67 -------- .../docker/grafana-plugin-ci-e2e/build.sh | 24 --- .../docker/grafana-plugin-ci-e2e/common.sh | 10 -- .../grafana-plugin-ci-e2e/install/ginstall | 73 --------- .../scripts/deploy-common.sh | 37 ----- .../scripts/deploy-slim.sh | 27 --- .../scripts/deploy-user.sh | 3 - .../grafana-plugin-ci-e2e/scripts/deploy.sh | 65 -------- .../test/docker-compose.yml | 18 -- .../grafana-plugin-ci-e2e/test/start.sh | 14 -- .../docker/grafana-plugin-ci/Dockerfile | 8 - .../docker/grafana-plugin-ci/README.md | 71 -------- .../docker/grafana-plugin-ci/build.sh | 8 - .../docker/grafana-plugin-ci/common.sh | 8 - .../docker/grafana-plugin-ci/install/gget | 63 ------- .../scripts/deploy-common.sh | 38 ----- .../grafana-plugin-ci/scripts/deploy-user.sh | 3 - .../grafana-plugin-ci/scripts/deploy.sh | 57 ------- .../grafana-plugin-ci/test/docker-compose.yml | 10 -- .../docker/grafana-plugin-ci/test/start.sh | 10 -- 33 files changed, 1135 deletions(-) delete mode 100644 packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/Dockerfile delete mode 100644 packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/README.md delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/build.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/common.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/install/bin/cp delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/install/bin/ginstall delete mode 100644 packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/install/bin/githubRelease.js delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/scripts/deploy-common.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/scripts/deploy-user.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/scripts/deploy.sh delete mode 100644 packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/test/docker-compose.yml delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/test/start.sh delete mode 100644 packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/Dockerfile delete mode 100644 packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/README.md delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/build.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/common.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/install/ginstall delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy-common.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy-slim.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy-user.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy.sh delete mode 100644 packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/test/docker-compose.yml delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/test/start.sh delete mode 100644 packages/grafana-toolkit/docker/grafana-plugin-ci/Dockerfile delete mode 100644 packages/grafana-toolkit/docker/grafana-plugin-ci/README.md delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci/build.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci/common.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci/install/gget delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci/scripts/deploy-common.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci/scripts/deploy-user.sh delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci/scripts/deploy.sh delete mode 100644 packages/grafana-toolkit/docker/grafana-plugin-ci/test/docker-compose.yml delete mode 100755 packages/grafana-toolkit/docker/grafana-plugin-ci/test/start.sh diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/Dockerfile b/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/Dockerfile deleted file mode 100644 index 3907fe9c05a..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM alpine:3.15.6 - -USER root - -COPY scripts scripts -COPY install /usr/local - -WORKDIR scripts - -RUN ./deploy.sh diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/README.md b/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/README.md deleted file mode 100644 index 94b42aefd3d..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# Using this docker image - -Uploaded to dockerhub as grafana/grafana-plugin-ci:latest-alpine - -Based off of `circleci/node:12-browsers` - -## User - -The user will be `circleci` -The home directory will be `/home/circleci` - -## Node - -- node 12 is installed -- yarn is installed globally -- npm is installed globally - -## Go - -- Go is installed in `/usr/local/bin/go` -- golangci-lint is installed in `/usr/local/bin/golangci-lint` -- mage is installed in `/home/circleci/go/bin/mage` - -All of the above directories are in the path, so there is no need to specify fully qualified paths. - -## Grafana - -- Installed in `/home/circleci/src/grafana` -- `yarn install` has been run - -## Integration/Release Testing - -There are 4 previous versions pre-downloaded to /usr/local/grafana. These versions are: - -1. 6.6.2 -2. 6.5.3 -3. 6.4.5 -4. 6.3.7 - -To test, your CircleCI config will need a run section with something similar to the following - -``` -- run: - name: Setup Grafana (local install) - command: | - sudo dpkg -i /usr/local/grafana/deb/grafana_6.6.2_amd64.deb - sudo cp ci/grafana-test-env/custom.ini /usr/share/grafana/conf/custom.ini - sudo cp ci/grafana-test-env/custom.ini /etc/grafana/grafana.ini - sudo service grafana-server start - grafana-cli --version -``` - -# Building - -To build, cd to `/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine` - -``` -./build.sh -``` - -# Developing/Testing - -To test, you should have docker-compose installed. - -``` -cd test -./start.sh -``` - -You will be in /home/circleci/test with the buildscripts installed to the local directory. -Do your edits/run tests. When saving, your edits will be available in the container immediately. diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/build.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/build.sh deleted file mode 100755 index f024e617055..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -set -eo pipefail - -source ./common.sh - -# -# No longer required, but useful to keep just in case we want to deploy -# changes in toolkit directly to the docker image -# -if [ -n "$INCLUDE_TOOLKIT" ]; then - /bin/rm -rfv install/grafana-toolkit - mkdir -pv install/grafana-toolkit - cp -rv ../../bin install/grafana-toolkit - cp -rv ../../src install/grafana-toolkit - cp -v ../../package.json install/grafana-toolkit - cp -v ../../tsconfig.json install/grafana-toolkit -fi - -docker build -t ${DOCKER_IMAGE_NAME} . -docker push $DOCKER_IMAGE_NAME - -[ -n "$INCLUDE_TOOLKIT" ] && /bin/rm -rfv install/grafana-toolkit diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/common.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/common.sh deleted file mode 100755 index 8a99e1e649b..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/common.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -## -## Common variable declarations -## Find the latest tags on https://hub.docker.com/r/grafana/grafana-plugin-ci/tags?page=1&name=alpine -## - -DOCKER_IMAGE_NAME="grafana/grafana-plugin-ci:1.6.1-alpine" diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/install/bin/cp b/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/install/bin/cp deleted file mode 100755 index fd23c3db871..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/install/bin/cp +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if [ "$1" == "-rn" ]; then - false | busybox cp -i -r "$2" "$3" 2>/dev/null -else - busybox cp $* -fi diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/install/bin/ginstall b/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/install/bin/ginstall deleted file mode 100755 index 537305a1f72..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/install/bin/ginstall +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -## -# gget -# A script to get and install grafana versions -# for usage information see "show_help" below. -# - -latest=$(wget -O - 'https://raw.githubusercontent.com/grafana/grafana/main/latest.json' | jq -r '.stable') -canary=$(wget -O - "https://grafana.com/api/grafana/versions" | jq ".items[0].version" | tr -d '"') - -show_help() { - echo "Usage: gget " - echo "" - echo "where can be:" - echo " 1) A version from https://grafana.com/grafana/download (ex x.y.z)" - echo " 2) latest (currently $latest)" - echo " 3) canary (currently $canary)" - echo "" - echo " -h, --help: Display this help message" - echo "" - exit 0 -} - -opts=$(getopt -o h --long help -n 'gget' -- "$@") -[ $? -eq 0 ] || { - show_help -} - -eval set -- "$opts" -while true; do - case "$1" in - -h | --help) - show_help - ;; - --) - shift - break - ;; - *) - break - ;; - esac - shift -done - -[ -z "$1" ] && show_help - -# Make sure the script is being run as root -if [ $EUID -ne 0 ]; then - echo "This script must be run as root" - exit 1 -fi - -## -# MAIN -# -# Enough setup, let's actually do something -# -version=$1 -if [ "$version" == "latest" ]; then - version="$latest" - wget -O - "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz" | tar -C /opt -zxf - -elif [ "$version" == "canary" ]; then - version="$canary" - wget -O - "https://dl.grafana.com/oss/main/grafana-${version}.linux-amd64.tar.gz" | tar -C /opt -zxf - -else - wget -O - "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz" | tar -C /opt -zxf - -fi - -/bin/rm -rf /opt/grafana > /dev/null 2>&1 || true -ln -s /opt/grafana-${version} /opt/grafana - -# nohup /opt/grafana/bin/grafana-server -config /opt/grafana/conf/defaults.ini -homepath /opt/grafana >/dev/null 2>&1 & diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/install/bin/githubRelease.js b/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/install/bin/githubRelease.js deleted file mode 100644 index 849836da380..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/install/bin/githubRelease.js +++ /dev/null @@ -1,154 +0,0 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -const fs = require('fs'); -const path = require('path'); -const tslib_1 = require('tslib'); - -const getPluginId_1 = require('../../config/utils/getPluginId'); -const pluginValidation_1 = require('../../config/utils/pluginValidation'); -const env_1 = require('../../plugins/env'); -// @ts-ignore -// import execa = require('execa'); -const githubClient_1 = tslib_1.__importDefault(require('./githubClient')); -const resolveContentType = function (extension) { - if (extension.startsWith('.')) { - extension = extension.slice(1); - } - switch (extension) { - case 'zip': - return 'application/zip'; - case 'json': - return 'application/json'; - case 'sha1': - return 'text/plain'; - default: - return 'application/octet-stream'; - } -}; -const GitHubRelease = /** @class */ (function () { - function GitHubRelease(token, username, repository, releaseNotes, commitHash) { - this.token = token; - this.username = username; - this.repository = repository; - this.releaseNotes = releaseNotes; - this.commitHash = commitHash; - this.git = new githubClient_1.default({ - required: true, - repo: repository, - }); - } - GitHubRelease.prototype.publishAssets = function (srcLocation, destUrl) { - const _this = this; - // Add the assets. Loop through files in the ci/dist folder and upload each asset. - const files = fs.readdirSync(srcLocation); - return files.map(function (file) { - return tslib_1.__awaiter(_this, void 0, void 0, function () { - let fileStat, fileData; - return tslib_1.__generator(this, function (_a) { - fileStat = fs.statSync(srcLocation + '/' + file); - fileData = fs.readFileSync(srcLocation + '/' + file); - return [ - 2 /*return*/, - this.git.client.post(destUrl + '?name=' + file, fileData, { - headers: { - 'Content-Type': resolveContentType(path.extname(file)), - 'Content-Length': fileStat.size, - }, - maxContentLength: fileStat.size * 2 * 1024 * 1024, - }), - ]; - }); - }); - }); - }; - GitHubRelease.prototype.release = function () { - let _a, _b, _c, _d; - return tslib_1.__awaiter(this, void 0, void 0, function () { - let ciDir, - distDir, - distContentDir, - pluginJsonFile, - pluginInfo, - PUBLISH_DIR, - commitHash, - latestRelease, - reason_1, - newReleaseResponse, - publishPromises, - reason_2; - return tslib_1.__generator(this, function (_e) { - switch (_e.label) { - case 0: - ciDir = env_1.getCiFolder(); - distDir = path.resolve(ciDir, 'dist'); - distContentDir = path.resolve(distDir, getPluginId_1.getPluginId()); - pluginJsonFile = path.resolve(distContentDir, 'plugin.json'); - pluginInfo = pluginValidation_1.getPluginJson(pluginJsonFile).info; - PUBLISH_DIR = path.resolve(env_1.getCiFolder(), 'packages'); - commitHash = this.commitHash || ((_a = pluginInfo.build) === null || _a === void 0 ? void 0 : _a.hash); - _e.label = 1; - case 1: - _e.trys.push([1, 5, , 6]); - return [4 /*yield*/, this.git.client.get('releases/tags/v' + pluginInfo.version)]; - case 2: - latestRelease = _e.sent(); - if (!(latestRelease.data.tag_name === 'v' + pluginInfo.version)) { - return [3 /*break*/, 4]; - } - return [4 /*yield*/, this.git.client.delete('releases/' + latestRelease.data.id)]; - case 3: - _e.sent(); - _e.label = 4; - case 4: - return [3 /*break*/, 6]; - case 5: - reason_1 = _e.sent(); - if (reason_1.response.status !== 404) { - // 404 just means no release found. Not an error. Anything else though, re throw the error - throw reason_1; - } - return [3 /*break*/, 6]; - case 6: - _e.trys.push([6, 9, , 10]); - return [ - 4 /*yield*/, - this.git.client.post('releases', { - tag_name: 'v' + pluginInfo.version, - target_commitish: commitHash, - name: 'v' + pluginInfo.version, - body: this.releaseNotes, - draft: false, - prerelease: false, - }), - ]; - case 7: - newReleaseResponse = _e.sent(); - publishPromises = this.publishAssets( - PUBLISH_DIR, - 'https://uploads.github.com/repos/' + - this.username + - '/' + - this.repository + - '/releases/' + - newReleaseResponse.data.id + - '/assets' - ); - return [4 /*yield*/, Promise.all(publishPromises)]; - case 8: - _e.sent(); - return [3 /*break*/, 10]; - case 9: - reason_2 = _e.sent(); - console.log(reason_2); - // Rethrow the error so that we can trigger a non-zero exit code to circle-ci - throw reason_2; - case 10: - return [2 /*return*/]; - } - }); - }); - }; - return GitHubRelease; -})(); -exports.GitHubRelease = GitHubRelease; -//# sourceMappingURL=githubRelease.js.map7027e10521e9 diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/scripts/deploy-common.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/scripts/deploy-common.sh deleted file mode 100755 index 9263691386f..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/scripts/deploy-common.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -## -# Script to deploy a docker image. Must return exit code 0 -# -do_exit() { - message="$1" - exit_code="$2" - - echo "$message" - exit $exit_code -} - - -## -# Get file, get's a file, validates the SHA -# @param filename -# @param expected sha value -# @returns 0 if successful, -1 of checksum validation failed. -# -get_file () { - [ -n "$1" ] && url=$1 || do_exit "url required" 1 - [ -n "$2" ] && dest=$2 || do_exit "destination required" 2 - sha=$3 - file=$(basename $dest) - - curl -fL "${url}" -o "$dest" - if [ -n "$sha" ]; then - echo "$sha $dest" | sha256sum || do_exit "Checksum validation failed for $file. Exiting" 1 - fi -} - -untar_file () { - [ -n "$1" ] && src=$1 || do_exit "src required" 1 - [ -n "$2" ] && dest=$2 || dest="/usr/local" - - tar -C "$dest" -xf "$src" && /bin/rm -rf "$src" -} - -## -# WIP: Just started this and not finished. -# The intent it to download a release from a git repo, -# compile, and install -get_latest_release () { - tarsrc=$(curl -sL "https://api.github.com/repos/$1/$2/releases/latest" | jq ".tarball_url" | tr -d '"') - curl -fL -o /tmp/autoretrieved.tar.gz "$tarsrc" - origdir=$PWD - reponame=$(tar zxvf autoretrieved.tar.gz | tail -1 | awk -F / '{print $1}') - cd "/tmp/$reponame" - #perform compile - cd $origdir -} diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/scripts/deploy-user.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/scripts/deploy-user.sh deleted file mode 100755 index f8926ec4678..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/scripts/deploy-user.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -source "./deploy-common.sh" - diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/scripts/deploy.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/scripts/deploy.sh deleted file mode 100755 index 94345950078..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/scripts/deploy.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -set -eo pipefail - -source "./deploy-common.sh" - -# Make libgcc compatible -mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 - -# Replace cp with something that mocks the one that ci-package needs -rm /bin/cp -mv /usr/local/bin/cp /bin/cp - -apk add --no-cache curl npm yarn build-base openssh git-lfs perl-utils coreutils python3 - -# -# Only relevant for testing, but cypress does not work with musl/alpine. -# -# apk add --no-cache xvfb glib nss nspr gdk-pixbuf "gtk+3.0" pango atk cairo dbus-libs libxcomposite libxrender libxi libxtst libxrandr libxscrnsaver alsa-lib at-spi2-atk at-spi2-core cups-libs gcompat libc6-compat - -# Install Go -filename="go1.19.4.linux-amd64.tar.gz" -get_file "https://dl.google.com/go/$filename" "/tmp/$filename" "c9c08f783325c4cf840a94333159cc937f05f75d36a8b307951d5bd959cf2ab8" -untar_file "/tmp/$filename" - -# Install golangci-lint -GOLANGCILINT_VERSION=1.50.0 -filename="golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64" -get_file "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCILINT_VERSION}/$filename.tar.gz" \ - "/tmp/$filename.tar.gz" \ - "b4b329efcd913082c87d0e9606711ecb57415b5e6ddf233fde9e76c69d9b4e8b" -untar_file "/tmp/$filename.tar.gz" -ln -s /usr/local/${filename}/golangci-lint /usr/local/bin/golangci-lint -ln -s /usr/local/go/bin/go /usr/local/bin/go -ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt -chmod 755 /usr/local/bin/golangci-lint - -# Install dependencies -apk add --no-cache fontconfig zip jq - -# Install code climate -get_file "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64" \ - "/usr/local/bin/cc-test-reporter" \ - "20d1d4e2b399d0287d91e65faeee8ffbef08e3262b0be5eda7def7b3c2799ddd" -chmod 755 /usr/local/bin/cc-test-reporter - -curl -fL -o /usr/local/bin/grabpl "https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.9.27/grabpl" - -apk add --no-cache git -# Install Mage -mkdir -pv /tmp/mage $HOME/go/bin -git clone https://github.com/magefile/mage.git /tmp/mage -cd /tmp/mage && go run bootstrap.go -mv $HOME/go/bin/mage /usr/local/bin - -wget -O - -q https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b /usr/local/bin v2.14.0 - -source "/etc/profile" -sh -l -c "go get -u github.com/mgechev/revive" -for file in $(ls $HOME/go/bin); do - mv -v $HOME/go/bin/$file /usr/local/bin/$file -done - -# Install grafana-toolkit deps -current_dir=$PWD -cd /usr/local/grafana-toolkit && yarn install && cd $current_dir -ln -s /usr/local/grafana-toolkit/bin/grafana-toolkit.js /usr/local/bin/grafana-toolkit - -GOOGLE_SDK_VERSION=365.0.1 -GOOGLE_SDK_CHECKSUM=17003cdba67a868c2518ac16efa60dc6175533b7a9fb87304459784308e30fb0 - -curl -fLO https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GOOGLE_SDK_VERSION}-linux-x86_64.tar.gz -echo "${GOOGLE_SDK_CHECKSUM} google-cloud-sdk-${GOOGLE_SDK_VERSION}-linux-x86_64.tar.gz" | sha256sum --check --status -tar xvzf google-cloud-sdk-${GOOGLE_SDK_VERSION}-linux-x86_64.tar.gz -C /opt -rm google-cloud-sdk-${GOOGLE_SDK_VERSION}-linux-x86_64.tar.gz -ln -s /opt/google-cloud-sdk/bin/gsutil /usr/bin/gsutil -ln -s /opt/google-cloud-sdk/bin/gcloud /usr/bin/gcloud - -# Cleanup after yourself -/bin/rm -rf /tmp/mage -/bin/rm -rf $HOME/go diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/test/docker-compose.yml b/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/test/docker-compose.yml deleted file mode 100644 index 9a3e53f2cc3..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/test/docker-compose.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: '3' -services: - citest: - image: "amd64/alpine" - user: root - volumes: - - ../scripts:/home/circleci/scripts - - ../install:/home/circleci/install - - ${HOME}/.ssh:/root/.ssh - - ../../..:/home/circleci/grafana-toolkit - cibuilt: - image: "grafana/grafana-plugin-ci:latest-alpine" - user: root - volumes: - - ../scripts:/home/circleci/scripts - - ../install:/home/circleci/install - - ${HOME}/.ssh:/root/.ssh - - ../../..:/home/circleci/grafana-toolkit diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/test/start.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/test/start.sh deleted file mode 100755 index f5551eb3b6e..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-alpine/test/start.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -function finish { - echo "Exiting and cleaning up docker image" - docker-compose down -} -trap finish EXIT - -# Enter the docker container -if [ "$1" = "built" ]; then - docker-compose run cibuilt sh -c "cd /home/circleci; exec sh --login -i" -else - docker-compose run citest sh -c "cd /home/circleci; exec sh --login -i" -fi diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/Dockerfile b/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/Dockerfile deleted file mode 100644 index 6aa2682c27b..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM debian:buster-slim - -ENV DEBIAN_FRONTEND=noninteractive - -COPY scripts scripts -COPY install /usr/local - -RUN cd scripts && ./deploy.sh -ENV DEBIAN_FRONTEND=newt diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/README.md b/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/README.md deleted file mode 100644 index 1b37557a0b3..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# Using this docker image - -## User - -The user will be `circleci` -The home directory will be `/home/circleci` - -## Node - -- node 14 is installed -- yarn is installed globally -- npm is installed globally - -## Go - -- Go is installed in `/usr/local/bin/go` -- golangci-lint is installed in `/usr/local/bin/golangci-lint` -- mage is installed in `/usr/local/bin/mage` - -All of the above directories are in the path, so there is no need to specify fully qualified paths. - -## Grafana - -- Installed in `/home/circleci/src/grafana` -- `yarn install` has been run - -## Integration/Release Testing - -There are 4 previous versions pre-downloaded to /usr/local/grafana. These versions are: - -1. 6.6.2 -2. 6.5.3 -3. 6.4.5 -4. 6.3.7 - -To test, your CircleCI config will need a run section with something similar to the following - -``` -- run: - name: Setup Grafana (local install) - command: | - sudo dpkg -i /usr/local/grafana/deb/grafana_6.6.2_amd64.deb - sudo cp ci/grafana-test-env/custom.ini /usr/share/grafana/conf/custom.ini - sudo cp ci/grafana-test-env/custom.ini /etc/grafana/grafana.ini - sudo service grafana-server start - grafana-cli --version -``` - -# Building - -To build, cd to `/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e` - -``` -./build.sh -``` - -# Developing/Testing - -To test, you should have docker-compose installed. - -``` -cd test -./start.sh -``` - -You will be in /home/circleci/test with the buildscripts installed to the local directory. -Do your edits/run tests. When saving, your edits will be available in the container immediately. diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/build.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/build.sh deleted file mode 100755 index 14ca02a1dc9..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -eo pipefail - -source ./common.sh - -# -# No longer required, but useful to keep just in case we want to deploy -# changes in toolkit directly to the docker image -# -if [ -n "$INCLUDE_TOOLKIT" ]; then - /bin/rm -rfv install/grafana-toolkit - mkdir -pv install/grafana-toolkit - cp -rv ../../bin install/grafana-toolkit - cp -rv ../../src install/grafana-toolkit - cp -v ../../package.json install/grafana-toolkit - cp -v ../../tsconfig.json install/grafana-toolkit -fi - -docker build -t ${DOCKER_IMAGE_NAME} . -docker push $DOCKER_IMAGE_NAME -docker tag ${DOCKER_IMAGE_NAME} ${DOCKER_IMAGE_BASE_NAME}:latest -docker push ${DOCKER_IMAGE_BASE_NAME}:latest - -[ -n "$INCLUDE_TOOLKIT" ] && /bin/rm -rfv install/grafana-toolkit diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/common.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/common.sh deleted file mode 100755 index 29714cd5a84..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/common.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -## -## Common variable declarations -## Find the latest tag on https://hub.docker.com/r/grafana/grafana-plugin-ci-e2e/tags -## - -DOCKER_IMAGE_BASE_NAME="grafana/grafana-plugin-ci-e2e" -DOCKER_IMAGE_VERSION="1.6.1" -DOCKER_IMAGE_NAME="${DOCKER_IMAGE_BASE_NAME}:${DOCKER_IMAGE_VERSION}" diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/install/ginstall b/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/install/ginstall deleted file mode 100755 index a71019bdbef..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/install/ginstall +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -## -# gget -# A script to get and install grafana versions -# for usage information see "show_help" below. -# - -latest=$(wget -O - 'https://raw.githubusercontent.com/grafana/grafana/main/latest.json' | jq -r '.stable') -canary=$(wget -O - "https://grafana.com/api/grafana-enterprise/versions" | jq ".items[0].version" | tr -d '"') - -show_help() { - echo "Usage: gget " - echo "" - echo "where can be:" - echo " 1) A version from https://grafana.com/grafana/download (ex x.y.z)" - echo " 2) latest (currently $latest)" - echo " 3) canary (currently $canary)" - echo "" - echo " -h, --help: Display this help message" - echo "" - exit 0 -} - -opts=$(getopt -o h --long help -n 'gget' -- "$@") -[ $? -eq 0 ] || { - show_help -} - -eval set -- "$opts" -while true; do - case "$1" in - -h | --help) - show_help - ;; - --) - shift - break - ;; - *) - break - ;; - esac - shift -done - -[ -z "$1" ] && show_help - -# Make sure the script is being run as root -if [ $EUID -ne 0 ]; then - echo "This script must be run as root" - exit 1 -fi - -## -# MAIN -# -# Enough setup, let's actually do something -# -version=$1 -if [ "$version" == "latest" ]; then - version="$latest" - wget -O - "https://dl.grafana.com/enterprise/release/grafana-enterprise-${version}.linux-amd64.tar.gz" | tar -C /opt -zxf - -elif [ "$version" == "canary" ]; then - version="$canary" - wget -O - "https://dl.grafana.com/enterprise/main/grafana-enterprise-${version}.linux-amd64.tar.gz" | tar -C /opt -zxf - -else - wget -O - "https://dl.grafana.com/enterprise/release/grafana-enterprise-${version}.linux-amd64.tar.gz" | tar -C /opt -zxf - -fi - -/bin/rm -rf /opt/grafana > /dev/null 2>&1 || true -ln -s /opt/grafana-${version} /opt/grafana - -# nohup /opt/grafana/bin/grafana-server -config /opt/grafana/conf/defaults.ini -homepath /opt/grafana >/dev/null 2>&1 & diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy-common.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy-common.sh deleted file mode 100755 index af585d2eb19..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy-common.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -## -# Script to deploy a docker image. Must return exit code 0 -# -do_exit() { - message="$1" - exit_code="$2" - - echo "$message" - exit $exit_code -} - -## -# Get file, get's a file, validates the SHA -# @param filename -# @param expected sha value -# @returns 0 if successful, -1 of checksum validation failed. -# -get_file () { - [ -n "$1" ] && url=$1 || do_exit "url required" -1 - [ -n "$2" ] && dest=$2 || do_exit "destination required" -2 - sha=$3 - file=$(basename $dest) - - wget "$url" -O "$dest" - if [ -n "$sha" ]; then - echo "$sha $dest" | sha256sum --check --status || do_exit "Checksum validation failed for $file. Exiting" -1 - fi -} - -untar_file () { - [ -n "$1" ] && src=$1 || do_exit "src required" -1 - [ -n "$2" ] && dest=$2 || dest="/usr/local" - - tar -C "$dest" -xf "$src" && /bin/rm -rf "$src" -} diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy-slim.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy-slim.sh deleted file mode 100755 index 9c3c0a31e2d..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy-slim.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -source "/etc/profile" - -apt-get --allow-insecure-repositories update -apt-get install --allow-unauthenticated -y \ - build-essential \ - wget git sudo adduser \ - libfontconfig1 \ - locate \ - libnss3 libnspr4 \ - libgdk-pixbuf2.0-0 \ - libgtk-3-0 \ - libpangocairo-1.0-0 \ - libpango-1.0-0 \ - libatk1.0-0 \ - libcairo2 \ - libdbus-1-3 \ - libxcomposite1 libxrender1 libxcursor1 libxi6 libxtst6 libxrandr2 libxss1 xauth xvfb \ - libasound2 \ - libatk-bridge2.0-0 \ - libatspi2.0-0 \ - libcups2 \ - jq net-tools git-lfs unzip pkg-config zip \ - libaio1 libaio-dev \ - netcat \ - libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb - diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy-user.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy-user.sh deleted file mode 100755 index 08f2b7b950a..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy-user.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -source "./deploy-common.sh" - diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy.sh deleted file mode 100755 index 99e711aee87..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/scripts/deploy.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -set -eo pipefail - -source "/etc/profile" -source "./deploy-slim.sh" -source "./deploy-common.sh" - -NODEVER="v16.13.2" -# Install Node -wget -O - "https://nodejs.org/dist/${NODEVER}/node-${NODEVER}-linux-x64.tar.xz" | tar Jvxf - -C "/tmp" - -# Move node to /usr/local so it's in the path -pushd /tmp/node-${NODEVER}-linux-x64 -/bin/rm -f CHANGELOG.md README.md LICENSE -/bin/cp -r * /usr/local -popd -/bin/rm -rf /tmp/node-${NODEVER} - -# Resource the profile so we know our path is being honoured -source "/etc/profile" -# Install Yarn. Not in the path yet so fully qualified -npm i -g yarn - -# Install Go -filename="go1.19.4.linux-amd64.tar.gz" -get_file "https://dl.google.com/go/$filename" "/tmp/$filename" "c9c08f783325c4cf840a94333159cc937f05f75d36a8b307951d5bd959cf2ab8" -untar_file "/tmp/$filename" - -# Install golangci-lint -GOLANGCILINT_VERSION=1.50.0 -filename="golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64" -get_file "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCILINT_VERSION}/$filename.tar.gz" \ - "/tmp/$filename.tar.gz" \ - "b4b329efcd913082c87d0e9606711ecb57415b5e6ddf233fde9e76c69d9b4e8b" -untar_file "/tmp/$filename.tar.gz" -ln -s /usr/local/${filename}/golangci-lint /usr/local/bin/golangci-lint -ln -s /usr/local/go/bin/go /usr/local/bin/go -ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt -chmod 755 /usr/local/bin/golangci-lint - -# Install code climate -get_file "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64" \ - "/usr/local/bin/cc-test-reporter" \ - "20d1d4e2b399d0287d91e65faeee8ffbef08e3262b0be5eda7def7b3c2799ddd" -chmod 755 /usr/local/bin/cc-test-reporter - -wget -O /usr/local/bin/grabpl "https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.9.27/grabpl" -chmod +x /usr/local/bin/grabpl - -# Install Mage -mkdir -pv /tmp/mage $HOME/go/bin -git clone https://github.com/magefile/mage.git /tmp/mage -pushd /tmp/mage && go run bootstrap.go && popd -mv $HOME/go/bin/mage /usr/local/bin -# Cleanup after yourself -/bin/rm -rf /tmp/mage -/bin/rm -rf $HOME/go - -# add cypress -yarn global add cypress -# verify cypress install -cypress verify - -# Get the size down -/bin/rm -rf /var/lib/apt/lists diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/test/docker-compose.yml b/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/test/docker-compose.yml deleted file mode 100644 index 5d6297c4833..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/test/docker-compose.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: '3' -services: - citest: - image: "debian:buster-slim" - user: root - volumes: - - ../scripts:/root/scripts - - ../install:/root/install - - ${HOME}/.ssh:/root/.ssh - - ../../..:/root/grafana-toolkit - cibuilt: - image: "grafana/grafana-plugin-ci-e2e" - user: root - volumes: - - ../scripts:/root/scripts - - ../install:/root/install - - ${HOME}/.ssh:/root/.ssh - - ../../..:/root/grafana-toolkit diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/test/start.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/test/start.sh deleted file mode 100755 index 2552c964a85..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci-e2e/test/start.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -function finish { - echo "Exiting and cleaning up docker image" - docker-compose down -} -trap finish EXIT - -# Enter the docker container -if [ "$1" = "built" ]; then - docker-compose run cibuilt sh -c "cd /root; exec bash --login -i" -else - docker-compose run citest sh -c "cd /root; exec bash --login -i" -fi diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci/Dockerfile b/packages/grafana-toolkit/docker/grafana-plugin-ci/Dockerfile deleted file mode 100644 index 46228193273..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM debian:testing-20210111-slim -USER root -COPY scripts scripts -WORKDIR scripts -RUN apt-get update && \ - apt-get install -y wget && \ - ./deploy.sh -COPY install/gget /usr/local/bin/gget diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci/README.md b/packages/grafana-toolkit/docker/grafana-plugin-ci/README.md deleted file mode 100644 index 18bc1aec592..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# Using this docker image - -Currently tagged and uploaded to dockerhub as srclosson/integrations-ci-build - -Based off of `circleci/node:12-browsers` - -## User - -The user will be `circleci` -The home directory will be `/home/circleci` - -## Node - -- node 12 is installed -- yarn is installed globally -- npm is installed globally - -## Go - -- Go is installed in `/usr/local/bin/go` -- golangci-lint is installed in `/usr/local/bin/golangci-lint` -- mage is installed in `/home/circleci/go/bin/mage` - -All of the above directories are in the path, so there is no need to specify fully qualified paths. - -## Grafana - -- Installed in `/home/circleci/src/grafana` -- `yarn install` has been run - -## Integration/Release Testing - -There are 4 previous versions pre-downloaded to /usr/local/grafana. These versions are: - -1. 6.6.2 -2. 6.5.3 -3. 6.4.5 -4. 6.3.7 - -To test, your CircleCI config will need a run section with something similar to the following - -``` -- run: - name: Setup Grafana (local install) - command: | - sudo dpkg -i /usr/local/grafana/deb/grafana_6.6.2_amd64.deb - sudo cp ci/grafana-test-env/custom.ini /usr/share/grafana/conf/custom.ini - sudo cp ci/grafana-test-env/custom.ini /etc/grafana/grafana.ini - sudo service grafana-server start - grafana-cli --version -``` - -# Building - -To build, cd to `/packages/grafana-toolkit/docker/grafana-plugin-ci` - -``` -./build.sh -``` - -# Developing/Testing - -To test, you should have docker-compose installed. - -``` -cd test -./start.sh -``` - -You will be in /home/circleci/test with the buildscripts installed to the local directory. -Do your edits/run tests. When saving, your edits will be available in the container immediately. diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci/build.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci/build.sh deleted file mode 100755 index 3d8d3d7110a..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -eo pipefail - -source ./common.sh - -docker build -t ${DOCKER_IMAGE_NAME} . -docker push $DOCKER_IMAGE_NAME - diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci/common.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci/common.sh deleted file mode 100755 index 47d2b068d8d..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci/common.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -## -## Common variable declarations -## Find the latest tags on https://hub.docker.com/r/grafana/grafana-plugin-ci/tags -## - -DOCKER_IMAGE_NAME="grafana/grafana-plugin-ci:1.6.1" diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci/install/gget b/packages/grafana-toolkit/docker/grafana-plugin-ci/install/gget deleted file mode 100755 index 3e38e2d5911..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci/install/gget +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -## -# gget -# A script to get and install grafana versions -# for usage information see "show_help" below. -# - -latest=$(curl -s 'https://raw.githubusercontent.com/grafana/grafana/main/latest.json' | jq -r '.stable') -canary=$(curl -s "https://grafana.com/api/grafana/versions" | jq ".items[0].version" | tr -d '"') - -show_help() { - echo "Usage: gget " - echo "" - echo "where can be:" - echo " 1) A version from https://grafana.com/grafana/download (ex x.y.z)" - echo " 2) latest (currently $latest)" - echo " 3) canary (currently $canary)" - echo "" - echo " -h, --help: Display this help message" - echo "" - exit 0 -} - -opts=$(getopt -o h --long help -n 'gget' -- "$@") -[ $? -eq 0 ] || { - show_help -} - -eval set -- "$opts" -while true; do - case "$1" in - -h | --help) - show_help - ;; - --) - shift - break - ;; - *) - break - ;; - esac - shift -done - -[ -z "$1" ] && show_help - -# Make sure the script is being run as root -if [ $EUID -ne 0 ]; then - echo "This script must be run as root" - exit 1 -fi - -## -# MAIN -# -# Enough setup, let's actually do something -# -version=$1 -[ "$version" == "latest" ] && version="$latest" -[ "$version" == "canary" ] && version="$canary" -wget "https://dl.grafana.com/oss/release/grafana_${version}_amd64.deb" -O "/tmp/grafana_${version}_amd64.deb" -dpkg -i "/tmp/grafana_${version}_amd64.deb" && /bin/rm -rfv "/tmp/grafana_${version}_amd64.deb" diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci/scripts/deploy-common.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci/scripts/deploy-common.sh deleted file mode 100755 index 524bb5e4ec6..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci/scripts/deploy-common.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -## -# Script to deploy a docker image. Must return exit code 0 -# -do_exit() { - message="$1" - exit_code="$2" - - echo "$message" - exit $exit_code -} - - -## -# Get file, get's a file, validates the SHA -# @param filename -# @param expected sha value -# @returns 0 if successful, -1 of checksum validation failed. -# -get_file () { - [ -n "$1" ] && url=$1 || do_exit "url required" -1 - [ -n "$2" ] && dest=$2 || do_exit "destination required" -2 - sha=$3 - file=$(basename $dest) - - wget "$url" -O "$dest" - if [ -n "$sha" ]; then - echo "$sha $dest" | sha256sum --check --status || do_exit "Checksum validation failed for $file. Exiting" -1 - fi -} - -untar_file () { - [ -n "$1" ] && src=$1 || do_exit "src required" -1 - [ -n "$2" ] && dest=$2 || dest="/usr/local" - - tar -C "$dest" -xf "$src" && /bin/rm -rf "$src" -} \ No newline at end of file diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci/scripts/deploy-user.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci/scripts/deploy-user.sh deleted file mode 100755 index 08f2b7b950a..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci/scripts/deploy-user.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -source "./deploy-common.sh" - diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci/scripts/deploy.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci/scripts/deploy.sh deleted file mode 100755 index 3ee0bff1e16..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci/scripts/deploy.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -source "./deploy-common.sh" - -# Install Go -filename="go1.19.4.linux-amd64.tar.gz" -get_file "https://dl.google.com/go/$filename" "/tmp/$filename" "c9c08f783325c4cf840a94333159cc937f05f75d36a8b307951d5bd959cf2ab8" -untar_file "/tmp/$filename" - -# Install golangci-lint -GOLANGCILINT_VERSION=1.50.0 -filename="golangci-lint-${GOLANGCILINT_VERSION}-linux-amd64" -get_file "https://github.com/golangci/golangci-lint/releases/download/v${GOLANGCILINT_VERSION}/$filename.tar.gz" \ - "/tmp/$filename.tar.gz" \ - "b4b329efcd913082c87d0e9606711ecb57415b5e6ddf233fde9e76c69d9b4e8b" -untar_file "/tmp/$filename.tar.gz" -ln -s /usr/local/${filename}/golangci-lint /usr/local/bin/golangci-lint -ln -s /usr/local/go/bin/go /usr/local/bin/go -ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt -chmod 755 /usr/local/bin/golangci-lint - -# Install dependencies -apt-get update -y && apt-get install -y adduser libfontconfig1 locate && /bin/rm -rf /var/lib/apt/lists/* - -# Install code climate -get_file "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64" \ - "/usr/local/bin/cc-test-reporter" \ - "20d1d4e2b399d0287d91e65faeee8ffbef08e3262b0be5eda7def7b3c2799ddd" -chmod 755 /usr/local/bin/cc-test-reporter - -wget -O /usr/local/bin/grabpl "https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.9.27/grabpl" -chmod +x /usr/local/bin/grabpl - -# Install Mage -mkdir -pv /tmp/mage $HOME/go/bin -git clone https://github.com/magefile/mage.git /tmp/mage -pushd /tmp/mage && go run bootstrap.go && popd -mv $HOME/go/bin/mage /usr/local/bin - -GOOGLE_SDK_VERSION=365.0.1 -GOOGLE_SDK_CHECKSUM=17003cdba67a868c2518ac16efa60dc6175533b7a9fb87304459784308e30fb0 - -curl -fLO https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GOOGLE_SDK_VERSION}-linux-x86_64.tar.gz -echo "${GOOGLE_SDK_CHECKSUM} google-cloud-sdk-${GOOGLE_SDK_VERSION}-linux-x86_64.tar.gz" | sha256sum --check --status -tar xvzf google-cloud-sdk-${GOOGLE_SDK_VERSION}-linux-x86_64.tar.gz -C /opt -rm google-cloud-sdk-${GOOGLE_SDK_VERSION}-linux-x86_64.tar.gz -ln -s /opt/google-cloud-sdk/bin/gsutil /usr/bin/gsutil -ln -s /opt/google-cloud-sdk/bin/gcloud /usr/bin/gcloud - -# Cleanup after yourself -/bin/rm -rf /tmp/mage -/bin/rm -rf $HOME/go - -# Perform user specific initialization -sudo -u circleci ./deploy-user.sh - -# Get the size down -/bin/rm -rf /var/lib/apt/lists diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci/test/docker-compose.yml b/packages/grafana-toolkit/docker/grafana-plugin-ci/test/docker-compose.yml deleted file mode 100644 index d734b3a38e6..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci/test/docker-compose.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: '3' -services: - citest: - image: "circleci/node:12-browsers" - user: root - volumes: - - ../scripts:/home/circleci/scripts - - ../install:/home/circleci/install - - ${HOME}/.ssh:/root/.ssh - - ../../..:/home/circleci/grafana-toolkit diff --git a/packages/grafana-toolkit/docker/grafana-plugin-ci/test/start.sh b/packages/grafana-toolkit/docker/grafana-plugin-ci/test/start.sh deleted file mode 100755 index af3d91cb4a0..00000000000 --- a/packages/grafana-toolkit/docker/grafana-plugin-ci/test/start.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -function finish { - echo "Exiting and cleaning up docker image" - docker-compose down -} -trap finish EXIT - -# Enter the docker container -docker-compose run citest bash -c "cd /home/circleci; exec bash --login -i"