From fb76f41a15e5ee52bbb3b58229da12adcf3bf817 Mon Sep 17 00:00:00 2001 From: ijin08 Date: Wed, 9 Jan 2019 09:42:30 +0100 Subject: [PATCH 01/15] changed light theme page background gradient --- public/sass/_variables.light.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/sass/_variables.light.scss b/public/sass/_variables.light.scss index 16bb341ba27..6ad07011b68 100644 --- a/public/sass/_variables.light.scss +++ b/public/sass/_variables.light.scss @@ -76,8 +76,7 @@ $textShadow: none; // gradients $brand-gradient: linear-gradient(to right, rgba(255, 213, 0, 1) 0%, rgba(255, 68, 0, 1) 99%, rgba(255, 68, 0, 1) 100%); -$page-gradient: linear-gradient(-60deg, $gray-7, #f5f6f9 70%, $gray-7 98%); -//$page-gradient: linear-gradient(180deg, $white 10px, $gray-7 100px); +$page-gradient: linear-gradient(180deg, $white 10px, $gray-7 100px); $edit-gradient: linear-gradient(-60deg, $gray-7, #f5f6f9 70%, $gray-7 98%); // Links From 6ac25d41fa29f02ba6437da365aa8d2b5b5d2a25 Mon Sep 17 00:00:00 2001 From: Johannes Schill Date: Tue, 8 Jan 2019 16:59:16 +0100 Subject: [PATCH 02/15] chore: Move CustomScrollbar to @grafana/ui #14759 --- package.json | 4 +-- packages/grafana-ui/package.json | 8 +++-- .../CustomScrollbar/CustomScrollbar.test.tsx | 0 .../CustomScrollbar/CustomScrollbar.tsx | 2 +- .../CustomScrollbar.test.tsx.snap | 0 packages/grafana-ui/src/components/index.ts | 1 + public/app/core/components/Select/Select.tsx | 2 +- .../dashboard/dashgrid/EditorTabBody.tsx | 2 +- .../app/plugins/panel/graph/Legend/Legend.tsx | 2 +- yarn.lock | 34 +++++++++++++++++-- 10 files changed, 44 insertions(+), 11 deletions(-) rename {public/app/core => packages/grafana-ui/src}/components/CustomScrollbar/CustomScrollbar.test.tsx (100%) rename {public/app/core => packages/grafana-ui/src}/components/CustomScrollbar/CustomScrollbar.tsx (96%) rename {public/app/core => packages/grafana-ui/src}/components/CustomScrollbar/__snapshots__/CustomScrollbar.test.tsx.snap (100%) diff --git a/package.json b/package.json index eefe2cbbe53..c8d891b91bc 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "@types/jquery": "^1.10.35", "@types/node": "^8.0.31", "@types/react": "^16.7.6", - "@types/react-custom-scrollbars": "^4.0.5", "@types/react-dom": "^16.0.9", "@types/react-select": "^2.0.4", "angular-mocks": "1.6.6", @@ -72,8 +71,8 @@ "ng-annotate-loader": "^0.6.1", "ng-annotate-webpack-plugin": "^0.3.0", "ngtemplate-loader": "^2.0.1", - "npm": "^5.4.2", "node-sass": "^4.11.0", + "npm": "^5.4.2", "optimize-css-assets-webpack-plugin": "^4.0.2", "phantomjs-prebuilt": "^2.1.15", "postcss-browser-reporter": "^0.5.0", @@ -167,7 +166,6 @@ "prop-types": "^15.6.2", "rc-cascader": "^0.14.0", "react": "^16.6.3", - "react-custom-scrollbars": "^4.2.1", "react-dom": "^16.6.3", "react-grid-layout": "0.16.6", "react-highlight-words": "0.11.0", diff --git a/packages/grafana-ui/package.json b/packages/grafana-ui/package.json index 2fb210e3b46..594faa57b0a 100644 --- a/packages/grafana-ui/package.json +++ b/packages/grafana-ui/package.json @@ -16,6 +16,7 @@ "lodash": "^4.17.10", "moment": "^2.22.2", "react": "^16.6.3", + "react-custom-scrollbars": "^4.2.1", "react-dom": "^16.6.3", "react-highlight-words": "0.11.0", "react-popper": "^1.3.0", @@ -23,11 +24,14 @@ "react-virtualized": "^9.21.0" }, "devDependencies": { + "@types/classnames": "^2.2.6", "@types/jest": "^23.3.2", + "@types/jquery": "^1.10.35", "@types/lodash": "^4.14.119", "@types/react": "^16.7.6", - "@types/classnames": "^2.2.6", - "@types/jquery": "^1.10.35", + "@types/react-custom-scrollbars": "^4.0.5", + "@types/react-test-renderer": "^16.0.3", + "react-test-renderer": "^16.7.0", "typescript": "^3.2.2" } } diff --git a/public/app/core/components/CustomScrollbar/CustomScrollbar.test.tsx b/packages/grafana-ui/src/components/CustomScrollbar/CustomScrollbar.test.tsx similarity index 100% rename from public/app/core/components/CustomScrollbar/CustomScrollbar.test.tsx rename to packages/grafana-ui/src/components/CustomScrollbar/CustomScrollbar.test.tsx diff --git a/public/app/core/components/CustomScrollbar/CustomScrollbar.tsx b/packages/grafana-ui/src/components/CustomScrollbar/CustomScrollbar.tsx similarity index 96% rename from public/app/core/components/CustomScrollbar/CustomScrollbar.tsx rename to packages/grafana-ui/src/components/CustomScrollbar/CustomScrollbar.tsx index 977892c637d..cf1657e1c83 100644 --- a/public/app/core/components/CustomScrollbar/CustomScrollbar.tsx +++ b/packages/grafana-ui/src/components/CustomScrollbar/CustomScrollbar.tsx @@ -12,7 +12,7 @@ interface Props { /** * Wraps component into component from `react-custom-scrollbars` */ -class CustomScrollbar extends PureComponent { +export class CustomScrollbar extends PureComponent { static defaultProps: Partial = { customClassName: 'custom-scrollbars', autoHide: true, diff --git a/public/app/core/components/CustomScrollbar/__snapshots__/CustomScrollbar.test.tsx.snap b/packages/grafana-ui/src/components/CustomScrollbar/__snapshots__/CustomScrollbar.test.tsx.snap similarity index 100% rename from public/app/core/components/CustomScrollbar/__snapshots__/CustomScrollbar.test.tsx.snap rename to packages/grafana-ui/src/components/CustomScrollbar/__snapshots__/CustomScrollbar.test.tsx.snap diff --git a/packages/grafana-ui/src/components/index.ts b/packages/grafana-ui/src/components/index.ts index b57b9bcfdb7..7423ce2a93a 100644 --- a/packages/grafana-ui/src/components/index.ts +++ b/packages/grafana-ui/src/components/index.ts @@ -1 +1,2 @@ export { DeleteButton } from './DeleteButton/DeleteButton'; +export { CustomScrollbar } from './CustomScrollbar/CustomScrollbar'; diff --git a/public/app/core/components/Select/Select.tsx b/public/app/core/components/Select/Select.tsx index 893eb1a6655..f66e07c9ed6 100644 --- a/public/app/core/components/Select/Select.tsx +++ b/public/app/core/components/Select/Select.tsx @@ -11,7 +11,7 @@ import OptionGroup from './OptionGroup'; import IndicatorsContainer from './IndicatorsContainer'; import NoOptionsMessage from './NoOptionsMessage'; import ResetStyles from './ResetStyles'; -import CustomScrollbar from '../CustomScrollbar/CustomScrollbar'; +import { CustomScrollbar } from '@grafana/ui'; export interface SelectOptionItem { label?: string; diff --git a/public/app/features/dashboard/dashgrid/EditorTabBody.tsx b/public/app/features/dashboard/dashgrid/EditorTabBody.tsx index b7da81a23f8..b159cb30a4b 100644 --- a/public/app/features/dashboard/dashgrid/EditorTabBody.tsx +++ b/public/app/features/dashboard/dashgrid/EditorTabBody.tsx @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react'; // Components -import CustomScrollbar from 'app/core/components/CustomScrollbar/CustomScrollbar'; +import { CustomScrollbar } from '@grafana/ui'; import { FadeIn } from 'app/core/components/Animations/FadeIn'; import { PanelOptionSection } from './PanelOptionSection'; diff --git a/public/app/plugins/panel/graph/Legend/Legend.tsx b/public/app/plugins/panel/graph/Legend/Legend.tsx index 7af61fde4e9..b83cd7bd88c 100644 --- a/public/app/plugins/panel/graph/Legend/Legend.tsx +++ b/public/app/plugins/panel/graph/Legend/Legend.tsx @@ -1,7 +1,7 @@ import _ from 'lodash'; import React, { PureComponent } from 'react'; import { TimeSeries } from 'app/core/core'; -import CustomScrollbar from 'app/core/components/CustomScrollbar/CustomScrollbar'; +import { CustomScrollbar } from '@grafana/ui'; import { LegendItem, LEGEND_STATS } from './LegendSeriesItem'; interface LegendProps { diff --git a/yarn.lock b/yarn.lock index 78300be233e..0f7cf0fab92 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1091,6 +1091,13 @@ "@types/react-dom" "*" "@types/react-transition-group" "*" +"@types/react-test-renderer@^16.0.3": + version "16.0.3" + resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-16.0.3.tgz#cce5c983d66cc5c3582e7c2f44b274ab635a8acc" + integrity sha512-NWOAxVQeJxpXuNKgw83Hah0nquiw1nUexM9qY/Hk3a+XhZwgMtaa6GLA9E1TKMT75Odb3/KE/jiBO4enTuEJjQ== + dependencies: + "@types/react" "*" + "@types/react-transition-group@*": version "2.0.14" resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-2.0.14.tgz#afd0cd785a97f070b55765e9f9d76ff568269001" @@ -1098,7 +1105,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@16.7.6", "@types/react@^16.1.0", "@types/react@^16.7.6": +"@types/react@*", "@types/react@^16.1.0", "@types/react@^16.7.6": version "16.7.6" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.7.6.tgz#80e4bab0d0731ad3ae51f320c4b08bdca5f03040" integrity sha512-QBUfzftr/8eg/q3ZRgf/GaDP6rTYc7ZNem+g4oZM38C9vXyV8AWRWaTQuW5yCoZTsfHrN7b3DeEiUnqH9SrnpA== @@ -3161,7 +3168,7 @@ caniuse-api@^1.5.2: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-db@1.0.30000772, caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: +caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: version "1.0.30000772" resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000772.tgz#51aae891768286eade4a3d8319ea76d6a01b512b" integrity sha1-UarokXaChureSj2DGep21qAbUSs= @@ -12061,6 +12068,11 @@ react-is@^16.5.2: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.5.2.tgz#e2a7b7c3f5d48062eb769fcb123505eb928722e3" integrity sha512-hSl7E6l25GTjNEZATqZIuWOgSnpXb3kD0DVCujmg46K5zLxsbiKaaT6VO9slkSBDPZfYs30lwfJwbOFOnoEnKQ== +react-is@^16.7.0: + version "16.7.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.7.0.tgz#c1bd21c64f1f1364c6f70695ec02d69392f41bfa" + integrity sha512-Z0VRQdF4NPDoI0tsXVMLkJLiwEBa+RP66g0xDHxgxysxSoCUccSten4RTF/UFvZF1dZvZ9Zu1sx+MDXwcOR34g== + react-lifecycles-compat@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" @@ -12134,6 +12146,16 @@ react-test-renderer@^16.0.0-0, react-test-renderer@^16.5.0: react-is "^16.5.2" schedule "^0.5.0" +react-test-renderer@^16.7.0: + version "16.7.0" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.7.0.tgz#1ca96c2b450ab47c36ba92cd8c03fcefc52ea01c" + integrity sha512-tFbhSjknSQ6+ttzmuGdv+SjQfmvGcq3PFKyPItohwhhOBmRoTf1We3Mlt3rJtIn85mjPXOkKV+TaKK4irvk9Yg== + dependencies: + object-assign "^4.1.1" + prop-types "^15.6.2" + react-is "^16.7.0" + scheduler "^0.12.0" + react-transition-group@^2.2.1: version "2.5.0" resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.5.0.tgz#70bca0e3546102c4dc5cf3f5f57f73447cce6874" @@ -12977,6 +12999,14 @@ scheduler@^0.11.2: loose-envify "^1.1.0" object-assign "^4.1.1" +scheduler@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.12.0.tgz#8ab17699939c0aedc5a196a657743c496538647b" + integrity sha512-t7MBR28Akcp4Jm+QoR63XgAi9YgCUmgvDHqf5otgAj4QvdoBE4ImCX0ffehefePPG+aitiYHp0g/mW6s4Tp+dw== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + schema-utils@^0.4.0, schema-utils@^0.4.4, schema-utils@^0.4.5: version "0.4.7" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187" From 702e1b01bbaabf2ad7638afb068ba49281888808 Mon Sep 17 00:00:00 2001 From: Johannes Schill Date: Wed, 9 Jan 2019 10:35:03 +0100 Subject: [PATCH 03/15] chore: Move sass code related to custom scrollbar into @grafana/ui #14759 --- .../CustomScrollbar/_CustomScrollbar.scss | 40 +++++++++++++++++ packages/grafana-ui/src/components/index.scss | 1 + public/sass/components/_scrollbar.scss | 44 ------------------- 3 files changed, 41 insertions(+), 44 deletions(-) create mode 100644 packages/grafana-ui/src/components/CustomScrollbar/_CustomScrollbar.scss diff --git a/packages/grafana-ui/src/components/CustomScrollbar/_CustomScrollbar.scss b/packages/grafana-ui/src/components/CustomScrollbar/_CustomScrollbar.scss new file mode 100644 index 00000000000..c0a8077fb63 --- /dev/null +++ b/packages/grafana-ui/src/components/CustomScrollbar/_CustomScrollbar.scss @@ -0,0 +1,40 @@ +.custom-scrollbars { + // Fix for Firefox. For some reason sometimes .view container gets a height of its content, but in order to + // make scroll working it should fit outer container size (scroll appears only when inner container size is + // greater than outer one). + display: flex; + flex-grow: 1; + + .view { + display: flex; + flex-grow: 1; + flex-direction: column; + } + + .track-vertical { + border-radius: 3px; + width: 6px !important; + right: 2px; + bottom: 2px; + top: 2px; + } + + .track-horizontal { + border-radius: 3px; + height: 6px !important; + + right: 2px; + bottom: 2px; + left: 2px; + } + + .thumb-vertical { + @include gradient-vertical($scrollbarBackground, $scrollbarBackground2); + border-radius: 6px; + } + + .thumb-horizontal { + @include gradient-horizontal($scrollbarBackground, $scrollbarBackground2); + border-radius: 6px; + } +} \ No newline at end of file diff --git a/packages/grafana-ui/src/components/index.scss b/packages/grafana-ui/src/components/index.scss index d52508c946c..0e18eaf018c 100644 --- a/packages/grafana-ui/src/components/index.scss +++ b/packages/grafana-ui/src/components/index.scss @@ -1 +1,2 @@ +@import 'CustomScrollbar/CustomScrollbar'; @import 'DeleteButton/DeleteButton'; diff --git a/public/sass/components/_scrollbar.scss b/public/sass/components/_scrollbar.scss index 5dbb4518d52..a7ecb73b786 100644 --- a/public/sass/components/_scrollbar.scss +++ b/public/sass/components/_scrollbar.scss @@ -295,50 +295,6 @@ } } -// Custom styles for 'react-custom-scrollbars' - -.custom-scrollbars { - // Fix for Firefox. For some reason sometimes .view container gets a height of its content, but in order to - // make scroll working it should fit outer container size (scroll appears only when inner container size is - // greater than outer one). - display: flex; - flex-grow: 1; - - .view { - display: flex; - flex-grow: 1; - flex-direction: column; - } - - .track-vertical { - border-radius: 3px; - width: 6px !important; - - right: 2px; - bottom: 2px; - top: 2px; - } - - .track-horizontal { - border-radius: 3px; - height: 6px !important; - - right: 2px; - bottom: 2px; - left: 2px; - } - - .thumb-vertical { - @include gradient-vertical($scrollbarBackground, $scrollbarBackground2); - border-radius: 6px; - } - - .thumb-horizontal { - @include gradient-horizontal($scrollbarBackground, $scrollbarBackground2); - border-radius: 6px; - } -} - .scroll-margin-helper { margin-right: 12px; } From 7fea1f84c0f5a206ba393e1406b35e82b2163a35 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Fri, 14 Dec 2018 16:10:16 +0100 Subject: [PATCH 04/15] build: release of debs to our debian repo. --- .circleci/config.yml | 12 +++++++- scripts/build/load-signing-key.sh | 7 +++++ scripts/build/update_repo/aptly.conf | 27 ++++++++++++++++++ scripts/build/update_repo/sign-repo.sh | 7 +++++ scripts/build/update_repo/update-deb.sh | 38 +++++++++++++++++++++++++ scripts/build/update_repo/update-rpm.sh | 1 + 6 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 scripts/build/load-signing-key.sh create mode 100644 scripts/build/update_repo/aptly.conf create mode 100755 scripts/build/update_repo/sign-repo.sh create mode 100755 scripts/build/update_repo/update-deb.sh create mode 100755 scripts/build/update_repo/update-rpm.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index dba6c5f8bd0..1a1617ed407 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -398,8 +398,9 @@ jobs: deploy-release: docker: - - image: grafana/grafana-ci-deploy:1.0.0 + - image: xlson/aptly-ci:0.1 steps: + - checkout - attach_workspace: at: . - run: @@ -417,6 +418,15 @@ jobs: - run: name: Deploy to Grafana.com command: './scripts/build/publish.sh' + - run: + name: Load GPG private key + comand: './scripts/build/load-signing-key.sh' + - run: + name: Update Debian repository + command: './scripts/build/update_repo/update-deb.sh "oss" "$GPG_KEY_PASSWORD"' + - run: + name: Update RPM repository + command: 'ls' workflows: version: 2 diff --git a/scripts/build/load-signing-key.sh b/scripts/build/load-signing-key.sh new file mode 100644 index 00000000000..aa70d289443 --- /dev/null +++ b/scripts/build/load-signing-key.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +git clone git@github.com:torkelo/private.git ~/private-repo +gpg --batch --allow-secret-key-import --import ~/private-repo/signing/private.key +pkill gpg-agent \ No newline at end of file diff --git a/scripts/build/update_repo/aptly.conf b/scripts/build/update_repo/aptly.conf new file mode 100644 index 00000000000..5d2a64cd88d --- /dev/null +++ b/scripts/build/update_repo/aptly.conf @@ -0,0 +1,27 @@ +{ + "rootDir": "/deb-repo/db", + "downloadConcurrency": 4, + "downloadSpeedLimit": 0, + "architectures": [], + "dependencyFollowSuggests": false, + "dependencyFollowRecommends": false, + "dependencyFollowAllVariants": false, + "dependencyFollowSource": false, + "dependencyVerboseResolve": false, + "gpgDisableSign": false, + "gpgDisableVerify": false, + "gpgProvider": "gpg2", + "downloadSourcePackages": false, + "skipLegacyPool": true, + "ppaDistributorID": "ubuntu", + "ppaCodename": "", + "skipContentsPublishing": false, + "FileSystemPublishEndpoints": { + "repo": { + "rootDir": "/deb-repo/repo", + "linkMethod": "copy" + } + }, + "S3PublishEndpoints": {}, + "SwiftPublishEndpoints": {} +} diff --git a/scripts/build/update_repo/sign-repo.sh b/scripts/build/update_repo/sign-repo.sh new file mode 100755 index 00000000000..eb2922104fe --- /dev/null +++ b/scripts/build/update_repo/sign-repo.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env expect + +set password [lindex $argv 0] +spawn aptly publish repo grafana filesystem:repo:grafana +expect "Enter passphrase: " +send -- "$password\r" +expect eof diff --git a/scripts/build/update_repo/update-deb.sh b/scripts/build/update_repo/update-deb.sh new file mode 100755 index 00000000000..08f5bd7ef6f --- /dev/null +++ b/scripts/build/update_repo/update-deb.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +RELEASE_TYPE="${1:-}" +GPG_PASS="${2:-}" + +if [ -z "$RELEASE_TYPE" -o -z "$GPG_PASS" ]; then + exit 1 +fi + +set -e + +# Setup environment +cp scripts/build/update_repo/aptly.conf /etc/aptly.conf +mkdir -p /deb-repo/db +mkdir -p /deb-repo/repo + +# Download the database +gsutil -m rsync -r gs://grafana-aptly-db/repo-db /deb-repo/db + +# Add the new release to the repo +set +e +aptly publish drop squeeze filesystem:repo:grafana +set -e +aptly repo add grafana ./dist + +# Setup signing and sign the repo + +echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf +echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf + +./scripts/build/update_repo/sign-repo.sh "$GPG_PASS" + +# Update the repo and db on gcp +gsutil -m rsync -r -d /deb-repo/db gs://grafana-aptly-db/repo-db +gsutil -m rsync -r -d /deb-repo/repo/grafana "gs://grafana-repo/$RELEASE_TYPE/deb" + +# usage: +# deb https://grafana-repo.storage.googleapis.com/oss/deb squeeze main \ No newline at end of file diff --git a/scripts/build/update_repo/update-rpm.sh b/scripts/build/update_repo/update-rpm.sh new file mode 100755 index 00000000000..212c4ba239e --- /dev/null +++ b/scripts/build/update_repo/update-rpm.sh @@ -0,0 +1 @@ +#!/usr/bin/env bash \ No newline at end of file From a26a10cfd1ea2b0e571953aef1ca893746989cc9 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Mon, 17 Dec 2018 11:09:35 +0100 Subject: [PATCH 05/15] build: repo update input error. --- scripts/build/update_repo/update-deb.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/build/update_repo/update-deb.sh b/scripts/build/update_repo/update-deb.sh index 08f5bd7ef6f..d1694f0fee0 100755 --- a/scripts/build/update_repo/update-deb.sh +++ b/scripts/build/update_repo/update-deb.sh @@ -4,6 +4,7 @@ RELEASE_TYPE="${1:-}" GPG_PASS="${2:-}" if [ -z "$RELEASE_TYPE" -o -z "$GPG_PASS" ]; then + echo "Both RELEASE_TYPE (arg 1) and GPG_PASS (arg 2) has to be set" exit 1 fi @@ -35,4 +36,7 @@ gsutil -m rsync -r -d /deb-repo/db gs://grafana-aptly-db/repo-db gsutil -m rsync -r -d /deb-repo/repo/grafana "gs://grafana-repo/$RELEASE_TYPE/deb" # usage: -# deb https://grafana-repo.storage.googleapis.com/oss/deb squeeze main \ No newline at end of file +# deb https://grafana-repo.storage.googleapis.com/oss/deb squeeze main +# +# later: +# deb https://repo.grafana.com/oss/deb squeeze main From c3e23d7574face9ef72747faca1b1e92da9bc9d2 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Mon, 17 Dec 2018 17:19:55 +0100 Subject: [PATCH 06/15] build: rpm repo deploy. --- .circleci/config.yml | 2 +- .../{sign-repo.sh => sign-deb-repo.sh} | 0 scripts/build/update_repo/sign-rpm-repo.sh | 7 +++ scripts/build/update_repo/update-deb.sh | 2 +- scripts/build/update_repo/update-rpm.sh | 44 ++++++++++++++++++- 5 files changed, 52 insertions(+), 3 deletions(-) rename scripts/build/update_repo/{sign-repo.sh => sign-deb-repo.sh} (100%) create mode 100755 scripts/build/update_repo/sign-rpm-repo.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 1a1617ed407..b5c123bad58 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -426,7 +426,7 @@ jobs: command: './scripts/build/update_repo/update-deb.sh "oss" "$GPG_KEY_PASSWORD"' - run: name: Update RPM repository - command: 'ls' + command: './scripts/build/update_repo/update-rpm.sh "oss" "$GPG_KEY_PASSWORD"' workflows: version: 2 diff --git a/scripts/build/update_repo/sign-repo.sh b/scripts/build/update_repo/sign-deb-repo.sh similarity index 100% rename from scripts/build/update_repo/sign-repo.sh rename to scripts/build/update_repo/sign-deb-repo.sh diff --git a/scripts/build/update_repo/sign-rpm-repo.sh b/scripts/build/update_repo/sign-rpm-repo.sh new file mode 100755 index 00000000000..f7e80756127 --- /dev/null +++ b/scripts/build/update_repo/sign-rpm-repo.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env expect + +set password [lindex $argv 0] +spawn gpg --detach-sign --armor /rpm-repo/repodata/repomd.xml +expect "Enter passphrase: " +send -- "$password\r" +expect eof diff --git a/scripts/build/update_repo/update-deb.sh b/scripts/build/update_repo/update-deb.sh index d1694f0fee0..f2eb2f0dfd3 100755 --- a/scripts/build/update_repo/update-deb.sh +++ b/scripts/build/update_repo/update-deb.sh @@ -29,7 +29,7 @@ aptly repo add grafana ./dist echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf -./scripts/build/update_repo/sign-repo.sh "$GPG_PASS" +./scripts/build/update_repo/sign-deb-repo.sh "$GPG_PASS" # Update the repo and db on gcp gsutil -m rsync -r -d /deb-repo/db gs://grafana-aptly-db/repo-db diff --git a/scripts/build/update_repo/update-rpm.sh b/scripts/build/update_repo/update-rpm.sh index 212c4ba239e..ca943957fe4 100755 --- a/scripts/build/update_repo/update-rpm.sh +++ b/scripts/build/update_repo/update-rpm.sh @@ -1 +1,43 @@ -#!/usr/bin/env bash \ No newline at end of file +#!/usr/bin/env bash + +RELEASE_TYPE="${1:-}" +GPG_PASS="${2:-}" + +if [ -z "$RELEASE_TYPE" -o -z "$GPG_PASS" ]; then + echo "Both RELEASE_TYPE (arg 1) and GPG_PASS (arg 2) has to be set" + exit 1 +fi + +set -e + +# Setup environment +mkdir -p /rpm-repo + +# Download the database +gsutil -m rsync -r "gs://grafana-repo/$RELEASE_TYPE/rpm" /rpm-repo + +# Add the new release to the repo +cp ./dist/*.rpm /rpm-repo +cd /rpm-repo +createrepo . + +# Setup signing and sign the repo + +echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf +echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf + +./scripts/build/update_repo/sign-rpm-repo.sh "$GPG_PASS" + +# Update the repo and db on gcp +gsutil -m rsync -r -d /rpm-repo "gs://grafana-repo/$RELEASE_TYPE/rpm" + +# usage: +# [grafana] +# name=grafana +# baseurl=https://grafana-repo.storage.googleapis.com/oss/rpm +# repo_gpgcheck=1 +# enabled=1 +# gpgcheck=1 +# gpgkey=https://grafana-repo.storage.googleapis.com/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana +# sslverify=1 +# sslcacert=/etc/pki/tls/certs/ca-bundle.crt# later: From 919617ef963037c44c223c8e1ed8240c87392608 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Tue, 18 Dec 2018 15:30:51 +0100 Subject: [PATCH 07/15] build: only adds the correct packages to the repo. --- scripts/build/update_repo/update-deb.sh | 7 ++++--- scripts/build/update_repo/update-rpm.sh | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/build/update_repo/update-deb.sh b/scripts/build/update_repo/update-deb.sh index f2eb2f0dfd3..15c555d3426 100755 --- a/scripts/build/update_repo/update-deb.sh +++ b/scripts/build/update_repo/update-deb.sh @@ -14,14 +14,15 @@ set -e cp scripts/build/update_repo/aptly.conf /etc/aptly.conf mkdir -p /deb-repo/db mkdir -p /deb-repo/repo +mkdir -p /deb-repo/tmp # Download the database gsutil -m rsync -r gs://grafana-aptly-db/repo-db /deb-repo/db # Add the new release to the repo -set +e -aptly publish drop squeeze filesystem:repo:grafana -set -e +aptly publish drop squeeze filesystem:repo:grafana || true +cp ./dist/*.deb /deb-repo/tmp +rm /deb-repo/tmp/grafana_latest*.deb || true aptly repo add grafana ./dist # Setup signing and sign the repo diff --git a/scripts/build/update_repo/update-rpm.sh b/scripts/build/update_repo/update-rpm.sh index ca943957fe4..b89468938a6 100755 --- a/scripts/build/update_repo/update-rpm.sh +++ b/scripts/build/update_repo/update-rpm.sh @@ -18,6 +18,7 @@ gsutil -m rsync -r "gs://grafana-repo/$RELEASE_TYPE/rpm" /rpm-repo # Add the new release to the repo cp ./dist/*.rpm /rpm-repo +rm /rpm-repo/grafana-latest-1*.rpm || true cd /rpm-repo createrepo . From 31066aebb423ad5935d20449df85ef138ae1d772 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Thu, 20 Dec 2018 11:11:20 +0100 Subject: [PATCH 08/15] build: handles unexpected cases. --- scripts/build/update_repo/update-deb.sh | 5 +++-- scripts/build/update_repo/update-rpm.sh | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/build/update_repo/update-deb.sh b/scripts/build/update_repo/update-deb.sh index 15c555d3426..9184ed0369b 100755 --- a/scripts/build/update_repo/update-deb.sh +++ b/scripts/build/update_repo/update-deb.sh @@ -33,11 +33,12 @@ echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf ./scripts/build/update_repo/sign-deb-repo.sh "$GPG_PASS" # Update the repo and db on gcp -gsutil -m rsync -r -d /deb-repo/db gs://grafana-aptly-db/repo-db +gsutil -m rsync -r -d /deb-repo/db gs://grafana-aptly-db/repo-db # TODO: support separate enterprise db gsutil -m rsync -r -d /deb-repo/repo/grafana "gs://grafana-repo/$RELEASE_TYPE/deb" # usage: # deb https://grafana-repo.storage.googleapis.com/oss/deb squeeze main # # later: -# deb https://repo.grafana.com/oss/deb squeeze main +# curl https://packages.grafana.com/gpg.key | apt-key add - +# deb https://packages.grafana.com/oss/deb squeeze main diff --git a/scripts/build/update_repo/update-rpm.sh b/scripts/build/update_repo/update-rpm.sh index b89468938a6..a98d00a108d 100755 --- a/scripts/build/update_repo/update-rpm.sh +++ b/scripts/build/update_repo/update-rpm.sh @@ -27,6 +27,8 @@ createrepo . echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf +rm /rpm-repo/repodata/repomd.xml.asc || true +pkill gpg-agent || true ./scripts/build/update_repo/sign-rpm-repo.sh "$GPG_PASS" # Update the repo and db on gcp From a98c75121f7d30c5fda3ae8b6e0070501faf7e99 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Fri, 21 Dec 2018 12:26:31 +0100 Subject: [PATCH 09/15] build: adds aptly and createrepo to deploy tools. --- scripts/build/ci-deploy/Dockerfile | 26 ++++++++++++++++++++++--- scripts/build/ci-deploy/build-deploy.sh | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/scripts/build/ci-deploy/Dockerfile b/scripts/build/ci-deploy/Dockerfile index deef612e761..f6683f9663c 100644 --- a/scripts/build/ci-deploy/Dockerfile +++ b/scripts/build/ci-deploy/Dockerfile @@ -1,5 +1,25 @@ +FROM circleci/golang:1.11 + +RUN git clone https://github.com/aptly-dev/aptly $GOPATH/src/github.com/aptly-dev/aptly && \ + cd $GOPATH/src/github.com/aptly-dev/aptly && \ + # pin aptly to a specific commit after 1.3.0 that contains gpg2 support + git reset --hard a64807efdaf5e380bfa878c71bc88eae10d62be1 && \ + make install + FROM circleci/python:2.7-stretch -RUN sudo pip install awscli && \ - curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-222.0.0-linux-x86_64.tar.gz | \ - sudo tar xvzf - -C /opt +ENV PATH=$PATH:/opt/google-cloud-sdk/bin + +USER root + +RUN pip install awscli && \ + curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-222.0.0-linux-x86_64.tar.gz | \ + tar xvzf - -C /opt && \ + apt update && \ + apt install -y createrepo expect && \ + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/* + +COPY --from=0 /go/bin/aptly /usr/local/bin/aptly + +USER circleci diff --git a/scripts/build/ci-deploy/build-deploy.sh b/scripts/build/ci-deploy/build-deploy.sh index c9ce805b30b..818f91013ac 100755 --- a/scripts/build/ci-deploy/build-deploy.sh +++ b/scripts/build/ci-deploy/build-deploy.sh @@ -1,6 +1,6 @@ #!/bin/bash -_version="1.0.0" +_version="1.1.0" _tag="grafana/grafana-ci-deploy:${_version}" docker build -t $_tag . From 89956a6a41f1d31c7a57fe46cb9da65dbfe1f6e7 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Fri, 21 Dec 2018 12:32:01 +0100 Subject: [PATCH 10/15] build: uses official deployment image. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b5c123bad58..8cbb124d7c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -398,7 +398,7 @@ jobs: deploy-release: docker: - - image: xlson/aptly-ci:0.1 + - image: grafana/grafana-ci-deploy:1.1.0 steps: - checkout - attach_workspace: From bbbeb78c17480c5f002c1f61cdb0bc4875495d96 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Fri, 4 Jan 2019 10:18:44 +0100 Subject: [PATCH 11/15] build: makes repo update enterprise compatible. --- scripts/build/update_repo/update-deb.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/build/update_repo/update-deb.sh b/scripts/build/update_repo/update-deb.sh index 9184ed0369b..92b0940d396 100755 --- a/scripts/build/update_repo/update-deb.sh +++ b/scripts/build/update_repo/update-deb.sh @@ -17,7 +17,7 @@ mkdir -p /deb-repo/repo mkdir -p /deb-repo/tmp # Download the database -gsutil -m rsync -r gs://grafana-aptly-db/repo-db /deb-repo/db +gsutil -m rsync -r "gs://grafana-aptly-db/$RELEASE_TYPE" /deb-repo/db # Add the new release to the repo aptly publish drop squeeze filesystem:repo:grafana || true @@ -33,12 +33,9 @@ echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf ./scripts/build/update_repo/sign-deb-repo.sh "$GPG_PASS" # Update the repo and db on gcp -gsutil -m rsync -r -d /deb-repo/db gs://grafana-aptly-db/repo-db # TODO: support separate enterprise db +gsutil -m rsync -r -d /deb-repo/db "gs://grafana-aptly-db/$RELEASE_TYPE" gsutil -m rsync -r -d /deb-repo/repo/grafana "gs://grafana-repo/$RELEASE_TYPE/deb" # usage: -# deb https://grafana-repo.storage.googleapis.com/oss/deb squeeze main -# -# later: # curl https://packages.grafana.com/gpg.key | apt-key add - -# deb https://packages.grafana.com/oss/deb squeeze main +# deb https://packages.grafana.com/oss/deb stable main From 8f5886e6d444a2933c3d9912ed5cc0b8bd4b26f1 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Fri, 4 Jan 2019 16:35:17 +0100 Subject: [PATCH 12/15] refactoring --- scripts/build/update_repo/update-deb.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build/update_repo/update-deb.sh b/scripts/build/update_repo/update-deb.sh index 92b0940d396..bc6833d07f2 100755 --- a/scripts/build/update_repo/update-deb.sh +++ b/scripts/build/update_repo/update-deb.sh @@ -12,9 +12,9 @@ set -e # Setup environment cp scripts/build/update_repo/aptly.conf /etc/aptly.conf -mkdir -p /deb-repo/db -mkdir -p /deb-repo/repo -mkdir -p /deb-repo/tmp +mkdir -p /deb-repo/db \ + /deb-repo/repo \ + /deb-repo/tmp # Download the database gsutil -m rsync -r "gs://grafana-aptly-db/$RELEASE_TYPE" /deb-repo/db From b9c4eb70b13a4ee9a5eae150ee8ef02480ed2ad7 Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Tue, 8 Jan 2019 16:20:26 +0100 Subject: [PATCH 13/15] build: publishes beta releases to separate repos. --- .circleci/config.yml | 4 ++-- .../{sign-deb-repo.sh => unlock-gpg-key.sh} | 2 +- scripts/build/update_repo/update-deb.sh | 23 +++++++++++++++---- scripts/build/update_repo/update-rpm.sh | 17 ++++++++++++-- 4 files changed, 37 insertions(+), 9 deletions(-) rename scripts/build/update_repo/{sign-deb-repo.sh => unlock-gpg-key.sh} (66%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8cbb124d7c3..58357c1d490 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -423,10 +423,10 @@ jobs: comand: './scripts/build/load-signing-key.sh' - run: name: Update Debian repository - command: './scripts/build/update_repo/update-deb.sh "oss" "$GPG_KEY_PASSWORD"' + command: './scripts/build/update_repo/update-deb.sh "oss" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG"' - run: name: Update RPM repository - command: './scripts/build/update_repo/update-rpm.sh "oss" "$GPG_KEY_PASSWORD"' + command: './scripts/build/update_repo/update-rpm.sh "oss" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG"' workflows: version: 2 diff --git a/scripts/build/update_repo/sign-deb-repo.sh b/scripts/build/update_repo/unlock-gpg-key.sh similarity index 66% rename from scripts/build/update_repo/sign-deb-repo.sh rename to scripts/build/update_repo/unlock-gpg-key.sh index eb2922104fe..82f981809c2 100755 --- a/scripts/build/update_repo/sign-deb-repo.sh +++ b/scripts/build/update_repo/unlock-gpg-key.sh @@ -1,7 +1,7 @@ #!/usr/bin/env expect set password [lindex $argv 0] -spawn aptly publish repo grafana filesystem:repo:grafana +spawn gpg --detach-sign --armor /tmp/sign-this expect "Enter passphrase: " send -- "$password\r" expect eof diff --git a/scripts/build/update_repo/update-deb.sh b/scripts/build/update_repo/update-deb.sh index bc6833d07f2..b08ff36149f 100755 --- a/scripts/build/update_repo/update-deb.sh +++ b/scripts/build/update_repo/update-deb.sh @@ -2,12 +2,23 @@ RELEASE_TYPE="${1:-}" GPG_PASS="${2:-}" +RELEASE_TAG="${3:-}" +REPO="grafana" if [ -z "$RELEASE_TYPE" -o -z "$GPG_PASS" ]; then echo "Both RELEASE_TYPE (arg 1) and GPG_PASS (arg 2) has to be set" exit 1 fi +if [[ "$RELEASE_TYPE" != "oss" && "$RELEASE_TYPE" != "enterprise" ]]; then + echo "RELEASE_TYPE (arg 1) must be either oss or enterprise." + exit 1 +fi + +if echo "$RELEASE_TAG" | grep -q "beta"; then + REPO="beta" +fi + set -e # Setup environment @@ -20,22 +31,26 @@ mkdir -p /deb-repo/db \ gsutil -m rsync -r "gs://grafana-aptly-db/$RELEASE_TYPE" /deb-repo/db # Add the new release to the repo -aptly publish drop squeeze filesystem:repo:grafana || true +aptly publish drop grafana filesystem:repo:grafana || true +aptly publish drop beta filesystem:repo:grafana || true cp ./dist/*.deb /deb-repo/tmp rm /deb-repo/tmp/grafana_latest*.deb || true -aptly repo add grafana ./dist +aptly repo add "$REPO" ./dist # Setup signing and sign the repo echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf -./scripts/build/update_repo/sign-deb-repo.sh "$GPG_PASS" +./scripts/build/update_repo/unlock-gpg-key.sh "$GPG_PASS" + +aptly publish repo grafana filesystem:repo:grafana +aptly publish repo beta filesystem:repo:grafana # Update the repo and db on gcp gsutil -m rsync -r -d /deb-repo/db "gs://grafana-aptly-db/$RELEASE_TYPE" gsutil -m rsync -r -d /deb-repo/repo/grafana "gs://grafana-repo/$RELEASE_TYPE/deb" # usage: -# curl https://packages.grafana.com/gpg.key | apt-key add - +# # deb https://packages.grafana.com/oss/deb stable main diff --git a/scripts/build/update_repo/update-rpm.sh b/scripts/build/update_repo/update-rpm.sh index a98d00a108d..26eb2c5b329 100755 --- a/scripts/build/update_repo/update-rpm.sh +++ b/scripts/build/update_repo/update-rpm.sh @@ -3,18 +3,31 @@ RELEASE_TYPE="${1:-}" GPG_PASS="${2:-}" +RELEASE_TAG="${3:-}" +REPO="rpm" + if [ -z "$RELEASE_TYPE" -o -z "$GPG_PASS" ]; then echo "Both RELEASE_TYPE (arg 1) and GPG_PASS (arg 2) has to be set" exit 1 fi +if [[ "$RELEASE_TYPE" != "oss" && "$RELEASE_TYPE" != "enterprise" ]]; then + echo "RELEASE_TYPE (arg 1) must be either oss or enterprise." + exit 1 +fi + +if echo "$RELEASE_TAG" | grep -q "beta"; then + REPO="rpm-beta" +fi + set -e # Setup environment +BUCKET="gs://grafana-repo/$RELEASE_TYPE/$REPO" mkdir -p /rpm-repo # Download the database -gsutil -m rsync -r "gs://grafana-repo/$RELEASE_TYPE/rpm" /rpm-repo +gsutil -m rsync -r "$BUCKET" /rpm-repo # Add the new release to the repo cp ./dist/*.rpm /rpm-repo @@ -32,7 +45,7 @@ pkill gpg-agent || true ./scripts/build/update_repo/sign-rpm-repo.sh "$GPG_PASS" # Update the repo and db on gcp -gsutil -m rsync -r -d /rpm-repo "gs://grafana-repo/$RELEASE_TYPE/rpm" +gsutil -m rsync -r -d /rpm-repo "$BUCKET" # usage: # [grafana] From 76e9607b25bfde8562c66550430474544339bb6c Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Tue, 8 Jan 2019 16:34:59 +0100 Subject: [PATCH 14/15] build: inline docs --- scripts/build/update_repo/update-rpm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build/update_repo/update-rpm.sh b/scripts/build/update_repo/update-rpm.sh index 26eb2c5b329..caed3918216 100755 --- a/scripts/build/update_repo/update-rpm.sh +++ b/scripts/build/update_repo/update-rpm.sh @@ -50,10 +50,10 @@ gsutil -m rsync -r -d /rpm-repo "$BUCKET" # usage: # [grafana] # name=grafana -# baseurl=https://grafana-repo.storage.googleapis.com/oss/rpm +# baseurl=https://packages.grafana.com/oss/rpm # repo_gpgcheck=1 # enabled=1 # gpgcheck=1 -# gpgkey=https://grafana-repo.storage.googleapis.com/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana +# gpgkey=https://packages.grafana.com/gpg.key # sslverify=1 -# sslcacert=/etc/pki/tls/certs/ca-bundle.crt# later: +# sslcacert=/etc/pki/tls/certs/ca-bundle.crt \ No newline at end of file From ad61bff3779b9079baeb01d56c00f51f73a6bcda Mon Sep 17 00:00:00 2001 From: Leonard Gram Date: Wed, 9 Jan 2019 11:17:21 +0100 Subject: [PATCH 15/15] build: deploys enterprise to its own repo. --- .circleci/config.yml | 16 +++++++++++++--- scripts/build/update_repo/update-deb.sh | 2 ++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 58357c1d490..236d5aec398 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -323,7 +323,7 @@ jobs: deploy-enterprise-master: docker: - - image: grafana/grafana-ci-deploy:1.0.0 + - image: grafana/grafana-ci-deploy:1.1.0 steps: - attach_workspace: at: . @@ -346,7 +346,7 @@ jobs: deploy-enterprise-release: docker: - - image: grafana/grafana-ci-deploy:1.0.0 + - image: grafana/grafana-ci-deploy:1.1.0 steps: - attach_workspace: at: . @@ -365,10 +365,20 @@ jobs: - run: name: Deploy to Grafana.com command: './scripts/build/publish.sh --enterprise' + - run: + name: Load GPG private key + comand: './scripts/build/load-signing-key.sh' + - run: + name: Update Debian repository + command: './scripts/build/update_repo/update-deb.sh "enterprise" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG"' + - run: + name: Update RPM repository + command: './scripts/build/update_repo/update-rpm.sh "enterprise" "$GPG_KEY_PASSWORD" "$CIRCLE_TAG"' + deploy-master: docker: - - image: grafana/grafana-ci-deploy:1.0.0 + - image: grafana/grafana-ci-deploy:1.1.0 steps: - attach_workspace: at: . diff --git a/scripts/build/update_repo/update-deb.sh b/scripts/build/update_repo/update-deb.sh index b08ff36149f..89c5937b064 100755 --- a/scripts/build/update_repo/update-deb.sh +++ b/scripts/build/update_repo/update-deb.sh @@ -42,7 +42,9 @@ aptly repo add "$REPO" ./dist echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf +touch /tmp/sign-this ./scripts/build/update_repo/unlock-gpg-key.sh "$GPG_PASS" +rm /tmp/sign-this /tmp/sign-this.asc aptly publish repo grafana filesystem:repo:grafana aptly publish repo beta filesystem:repo:grafana