Skip to content

Instantly share code, notes, and snippets.

View padupe's full-sized avatar
🏠
Working from home

Paulo Eduardo Peixoto padupe

🏠
Working from home
View GitHub Profile
@padupe
padupe / catalog.ts
Last active February 25, 2023 18:51
[Backstage] Getting Started GitHub Integration on a Backstage Instance
// packages/backend/src/plugins/catalog.ts
import { CatalogBuilder } from '@backstage/plugin-catalog-backend';
import { ScaffolderEntitiesProcessor } from '@backstage/plugin-scaffolder-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
import { GithubEntityProvider, GithubOrgEntityProvider } from '@backstage/plugin-catalog-backend-module-github';
export default async function createPlugin(
env: PluginEnvironment,
@padupe
padupe / app-config-ghintegration.md
Created February 25, 2023 18:47
[Backstage] Getting Started GitHub Integration on a Backstage Instance
# app-config.yaml

[...]
+ integrations:
+   github:
+     - host: github.com
+       apps:
+         - $include: github-app-backstage-tutorial-medium-credentials.yaml
[...]
@padupe
padupe / App.tsx
Last active February 25, 2023 18:23
[Backstage] Getting Started GitHub Authentication on a Backstage Instance - Config at Front
// packages/app/src/App.tsx
// Há um import do pacote @backstage/core-components, que atualizaremos de maneira que fique:
import { AlertDisplay, OAuthRequestDialog, SignInProviderConfig, SignInPage } from '@backstage/core-components';
[...]
// Realizaremos ainda o import de um novo pacote:
import { githubAuthApiRef } from '@backstage/core-plugin-api';
[...]
@padupe
padupe / app-config-ghauth.md
Created February 25, 2023 18:15
[Backstage] Getting Started GitHub Authentication on a Backstage Instance
# app-config.yaml
[...]

+ auth:
+   environment: development
+   providers:
+     github:
+       development:
+ clientId: ${GITHUB_AUTH_CLIENT_ID}
@padupe
padupe / docker-compose.yaml
Created November 16, 2022 19:36
[Backstage] Simple PostgreSQL Docker container example
version: '3.7'
services:
postgresql:
image: postgres:alpine
restart: always
container_name: backstage-studies
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_USER=${POSTGRES_USER}
@padupe
padupe / app-config-postgresql.md
Created November 16, 2022 19:33
[Backstage] Getting Started with PostgreSQL on a Backstage Instance
# app-config.yaml
[...]

backend:
  database:
-    client: better-sqlite3
-    connection: ':memory:'
+    # config options: https://node-postgres.com/api/client
+ client: pg
@padupe
padupe / script-backstage-integration-catalog.sh
Created October 13, 2022 20:55
[Backstage] Catalog Software Integration
#!/bin/bash
## Running this script will do following for all passed repos:
## - Create a branch `backstage-integration`
## - Add catalog-info.yaml
## - Creates a PullRequest
##
## Inspired at: https://gist.github.com/axdotl/8231abd46793ea23160662c3d81f4ba9
## - User: @axdotl
##
@padupe
padupe / settings.json
Created May 16, 2022 23:09
VS Code | settings.json
{
"editor.fontSize": 14,
"editor.fontFamily": "monospace",
"workbench.iconTheme": "material-icon-theme",
"todo-tree.general.tags": [
"BUG",
"HACK",
"FIXME",
"TODO",
"XXX",