Skip to content

Commit

Permalink
Merge branch 'main' into jmp-move-migration-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
josmperez authored Aug 9, 2023
2 parents 28887fe + 5b2d0aa commit 9f1a287
Show file tree
Hide file tree
Showing 47 changed files with 2,140 additions and 767 deletions.
11 changes: 11 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,17 @@
"contributions": [
"doc"
]
},
{
"login": "Ukochka",
"name": "Yulia Shanyrova",
"avatar_url": "https://avatars.githubusercontent.com/u/20494436?v=4",
"profile": "https://github.com/Ukochka",
"contributions": [
"doc",
"infra",
"code"
]
}
],
"contributorsPerLine": 7
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ jobs:
./packages/create-plugin/generated/node_modules
key: ${{ steps.cache-generated-deps-restore.outputs.cache-primary-key }}

- name: '@grafana/sign-plugin - sign generated plugin'
- name: '@grafana/sign-plugin - use GRAFANA_ACCESS_POLICY_TOKEN to sign generated plugin'
env:
GRAFANA_ACCESS_POLICY_TOKEN: ${{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }}
run: node ../../sign-plugin/dist/bin/run.js --rootUrls http://www.example.com --signatureType private
working-directory: ./packages/create-plugin/generated
- name: '@grafana/sign-plugin - use GRAFANA_API_KEY to sign generated plugin'
env:
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }}
run: node ../../sign-plugin/dist/bin/run.js --rootUrls http://www.example.com --signatureType private
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/deploy-to-developer-portal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy to Developer Portal Bucket

on:
push:
branches:
- main
paths:
- '.github/workflows/deploy-to-developer-portal.yml'
- 'docusaurus/**'
jobs:
deploy:
name: Deploy docs to Developer Portal Bucket
runs-on: ubuntu-latest
steps:
# - name: Generate token
# id: generate_token
# uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
# with:
# app_id: ${{ secrets.APP_ID }}
# private_key: ${{ secrets.APP_PEM }}

- name: Checkout repository
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Install dependencies
run: npm ci

#mac: sed -i '' 's/title: Get started/title: Get started\nslug:\ \//g' ./docusaurus/docs/get-started/get-started.mdx
#mac: grep -rl "](/docs/" docusaurus/docs | xargs sed -i '' 's/](\/docs\//](\//g'
#linux: sed -i 's/title: Get started/title: Get started\nslug:\ \//g' ./docusaurus/docs/get-started/get-started.mdx
#linux: grep -rl "](/docs/" docusaurus/docs | xargs sed -i 's/](\/docs\//](\//g'
- name: Make docs the homepage of this subsite
run: |
rm -f ./docusaurus/website/src/pages/index.tsx
sed -i 's/title: Get started/title: Get started\nslug:\ \//g' ./docusaurus/docs/get-started/get-started.mdx
grep -rl "](/docs/" docusaurus/docs | xargs sed -i 's/](\/docs\//](\//g'
- name: Build documentation website
run: npm run docs:build -- --config docusaurus.config.devportal.js

- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Deploy to Developer Portal Bucket
uses: google-github-actions/upload-cloud-storage@v1
with:
path: './docusaurus/website/build/'
destination: 'grafana_developer_portal/plugin-tools'
parent: false
32 changes: 32 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 4 * * *'
permissions:
issues: write
pull-requests: write
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
# Number of days of inactivity before a stale Issue or Pull Request is closed.
# Set to -1 to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
days-before-close: 14
# Number of days of inactivity before an Issue or Pull Request becomes stale
days-before-stale: 90
exempt-issue-labels: no stalebot
exempt-pr-labels: no stalebot
operations-per-run: 100
stale-issue-label: stale
stale-pr-label: stale
stale-pr-message: >
This pull request has been automatically marked as stale because it has not had
activity in the last 90 days. It will be closed in 2 weeks if no further activity occurs. Please
feel free to give a status update now, ping for review, or re-open when it's ready.
Thank you for your contributions!
close-pr-message: >
This pull request has been automatically closed because it has not had
activity in the last 2 weeks. Please feel free to give a status update now, ping for review, or re-open when it's ready.
Thank you for your contributions!
13 changes: 12 additions & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
deploy:
name: Build docs
runs-on: ubuntu-latest
env:
NX_SKIP_NX_CACHE: 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -25,5 +27,14 @@ jobs:

- name: Install dependencies
run: npm ci
- name: Build documentation website
- name: Build documentation website (GH Pages)
run: npm run docs:build
- name: Clear documentation build
run: npm run docs:clear
- name: Make docs the homepage of this subsite (Dev Portal)
run: |
rm -f ./docusaurus/website/src/pages/index.tsx
sed -i 's/title: Get started/title: Get started\nslug:\ \//g' ./docusaurus/docs/get-started/get-started.mdx
grep -rl "](/docs/" docusaurus/docs | xargs sed -i 's/](\/docs\//](\//g'
- name: Build documentation website (Dev Portal)
run: npm run docs:build -- --config docusaurus.config.devportal.js
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# (Mon Aug 07 2023)

:tada: This release contains work from a new contributor! :tada:

Thank you, Yulia Shanyrova ([@Ukochka](https://github.com/Ukochka)), for all your work!

#### 🚀 Enhancement

- `@grafana/[email protected]`, `@grafana/[email protected]`
- sign-plugin: GRAFANA_ACESS_POLICY_TOKEN has been added instead of GRAFANA_API_KEY [#331](https://github.com/grafana/plugin-tools/pull/331) ([@Ukochka](https://github.com/Ukochka))

#### 🐛 Bug Fix

- Chore/fix dev portal deployment [#332](https://github.com/grafana/plugin-tools/pull/332) ([@tolzhabayev](https://github.com/tolzhabayev))
- Adding gcs pipeline [#295](https://github.com/grafana/plugin-tools/pull/295) ([@tolzhabayev](https://github.com/tolzhabayev))

#### Authors: 2

- Timur Olzhabayev ([@tolzhabayev](https://github.com/tolzhabayev))
- Yulia Shanyrova ([@Ukochka](https://github.com/Ukochka))

---

# (Wed Aug 02 2023)

#### 🐛 Bug Fix
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://github.com/josmperez"><img src="https://avatars.githubusercontent.com/u/45749060?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Joseph Perez</b></sub></a><br /><a href="https://github.com/grafana/plugin-tools/commits?author=josmperez" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/sd2k"><img src="https://avatars.githubusercontent.com/u/5464991?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ben Sully</b></sub></a><br /><a href="https://github.com/grafana/plugin-tools/commits?author=sd2k" title="Documentation">📖</a></td>
<td align="center"><a href="https://slorello.com/"><img src="https://avatars.githubusercontent.com/u/42971704?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Steve Lorello</b></sub></a><br /><a href="https://github.com/grafana/plugin-tools/commits?author=slorello89" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/Ukochka"><img src="https://avatars.githubusercontent.com/u/20494436?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yulia Shanyrova</b></sub></a><br /><a href="https://github.com/grafana/plugin-tools/commits?author=Ukochka" title="Documentation">📖</a> <a href="#infra-Ukochka" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/grafana/plugin-tools/commits?author=Ukochka" title="Code">💻</a></td>
</tr>
</table>

Expand Down
145 changes: 145 additions & 0 deletions docusaurus/website/docusaurus.config.base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
const path = require('path');
const remarkFigureCaption = require('gridsome-remark-figure-caption');
const { grafanaPrismTheme } = require('./src/theme/prism');

/** @type {import('@docusaurus/types').Config} */
const generalConfig = {
title: 'Grafana Plugin Tools',
tagline: 'Scaffold a Grafana plugin with one command',
baseUrl: 'plugin-tools/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.png',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'grafana', // Usually your GitHub org/user name.
projectName: 'plugin-tools', // Usually your repo name.

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
};

const plugins = [
[
'./plugins/docusaurus-custom-webpack-plugin',
{
resolve: {
alias: {
'@snippets': path.resolve(__dirname, '..', 'docs', 'snippets'),
'@shared': path.resolve(__dirname, '..', 'docs', 'shared'),
},
},
},
],
];

const presetsDocs = {
path: '../docs',
exclude: ['**/snippets/**', '**/shared/**', '**/drafts/**'],
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: 'https://github.com/grafana/plugin-tools/edit/main/docusaurus/website',
beforeDefaultRemarkPlugins: [
[
remarkFigureCaption,
{
figureClassName: 'md-figure-block',
imageClassName: 'md-figure-image',
captionClassName: 'md-figure-caption',
},
],
],
};
const presetsTheme = {
customCss: require.resolve('./src/css/custom.css'),
};

const themeConfigNavbar = {
title: 'Grafana Plugin Tools',
logo: {
alt: 'Grafana Logo',
src: 'img/logo.svg',
},
items: [
{
type: 'doc',
docId: 'get-started/get-started',
position: 'right',
label: 'Docs',
},
{ href: 'https://community.grafana.com/c/plugin-development/30', label: 'Help', position: 'right' },
{
href: 'https://www.github.com/grafana/plugin-tools',
label: 'GitHub',
position: 'right',
},
],
};

const themeConfigFooter = {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Get Started',
to: '/docs/get-started',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/grafana',
},
{
label: 'Github Discussions',
href: 'https://www.github.com/grafana/plugin-tools/discussions',
},
{
label: 'Grafana Community Forums',
href: 'https://community.grafana.com/c/plugin-development/30',
},
],
},
{
title: 'Social',
items: [
{
label: 'GitHub',
href: 'https://www.github.com/grafana/plugin-tools',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Grafana Labs. Built with Docusaurus.`,
};

const themeConfigPrism = {
theme: grafanaPrismTheme,
};
const themeConfigColorMode = {
defaultMode: 'dark',
disableSwitch: true,
respectPrefersColorScheme: false,
};

module.exports = {
generalConfig,
plugins,
presetsDocs,
presetsTheme,
themeConfigNavbar,
themeConfigFooter,
themeConfigPrism,
themeConfigColorMode,
};
66 changes: 66 additions & 0 deletions docusaurus/website/docusaurus.config.devportal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const {
generalConfig,
plugins,
presetsDocs,
presetsTheme,
themeConfigNavbar,
themeConfigFooter,
themeConfigPrism,
themeConfigColorMode,
} = require('./docusaurus.config.base');


// Replace docs link in footer so builds don't have broken links.
const [docs, ...rest] = themeConfigFooter.links;
const footerConfig = {
...themeConfigFooter,
links: [
{
title: 'Docs',
items: [
{
label: 'Get Started',
to: '/',
},
],
},
...rest,
],
};

/** @type {import('@docusaurus/types').Config} */
const config = {
...generalConfig,
url: 'https://devportal.grafana-dev.net/',

plugins: plugins,

presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
...presetsDocs,
routeBasePath: '/',
},
theme: presetsTheme,
blog: false,
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: themeConfigNavbar,
footer: footerConfig,
prism: themeConfigPrism,
colorMode: themeConfigColorMode,
}),
};

module.exports = config;
Loading

0 comments on commit 9f1a287

Please sign in to comment.