Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ivgo committed Sep 22, 2022
0 parents commit 8deb36f
Show file tree
Hide file tree
Showing 62 changed files with 17,236 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.1.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
7 changes: 7 additions & 0 deletions .changeset/purple-forks-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@spreadshirt/backstage-plugin-s3-viewer': patch
'@spreadshirt/backstage-plugin-s3-viewer-backend': patch
'@spreadshirt/backstage-plugin-s3-viewer-common': patch
---

Initial plugin version
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on: [push]

jobs:
build:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- run: yarn install
- run: yarn ci
env:
CI: true
- run: yarn backstage-cli versions:check
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x

- name: Install Dependencies
run: yarn

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called npm:release which does a build for your packages and calls changeset publish
publish: yarn npm:release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/upgrade-backstage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Upgrade Backstage

on:
schedule:
- cron: '0 1 1 * *' # 1 am UTC on 1st day of every month
workflow_dispatch: {}

jobs:
upgrade:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Upgrade plugins
run: |
yarn install
yarn backstage-cli versions:bump
- name: Commit changes
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git diff-index --quiet HEAD || git commit -m "chore(deps): Upgrade Backstage versions"
- name: Test changes
run: |
yarn install
yarn ci
env:
CI: true

- name: Push changes
run: |
git push
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# macOS
.DS_Store

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Coverage directory generated when running tests with coverage
coverage

# Dependencies
node_modules/

# Node version directives
.nvmrc

# dotenv environment variables file
.env
.env.test

# Build output
dist
dist-types

# Temporary change files created by Vim
*.swp

# MkDocs build output
site

# Local configuration files
*.local.yaml

# Sensitive credentials
*-credentials.yaml
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
deployment/target
dist
dist-types
coverage
.vscode
venv
*.md
*.yaml
*.yml
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# S3 plugins for Backstage

This repository contains a set of Backstage plugins for interacting with [AWS S3](https://aws.amazon.com/s3/) buckets.

The plugin provides:

- A backend plugin that exposes a bunch of endpoints that can be used by the frontend and also by end users.
- A common package containing several types shared by frontend and backend.
- A frontend page where the users can navigate through the different buckets and it's objects. As well as previewing, downloading or getting object information.

## Installation

Check the installation process for these plugins in the following links:

- [Frontend Plugin Installation](./plugins/s3-viewer/README.md)
- [Backend Plugin Installation](./plugins/s3-viewer-backend/README.md)

## Deploying new releases ( _internal_ )

- After every change made in the plugins, execute `yarn changeset` and follow the steps.
- When everything is ready, execute locally `yarn release` to update all the plugin versions, update the `CHANGELOG.md` files & update the `yarn.lock`.
- Finally, run `yarn publish-release` to publish the packages to npm.
7 changes: 7 additions & 0 deletions app-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Stub app config needed to run with yarn start
app:
title: backstage example app
baseUrl: http://localhost:3000

backend:
baseUrl: http://localhost:7007
3 changes: 3 additions & 0 deletions backstage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "1.5.1"
}
55 changes: 55 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "backstage-plugin-s3",
"description": "S3 Viewer Plugins for Backstage",
"version": "0.0.0",
"repository": {
"type": "git",
"url": "https://github.com/spreadshirt/backstage-plugin-s3"
},
"license": "Apache-2.0",
"author": {
"name": "Spreadshirt"
},
"private": true,
"workspaces": {
"packages": [
"plugins/*"
]
},
"scripts": {
"tsc": "tsc",
"tsc:full": "backstage-cli repo clean && tsc --skipLibCheck false --incremental false",
"build": "backstage-cli repo build --all",
"clean": "backstage-cli repo clean",
"test": "backstage-cli test",
"test:all": "backstage-cli test --coverage",
"lint": "backstage-cli repo lint",
"ci": "yarn install && tsc && yarn build && backstage-cli test --no-watch && yarn lint",
"start:frontend": "yarn workspace @spreadshirt/backstage-plugin-s3-viewer start",
"start:backend": "yarn workspace @spreadshirt/backstage-plugin-s3-viewer-backend start",
"release": "changeset version && yarn prettier --write 'plugins/*/{package.json,CHANGELOG.md}' '.changeset/*.json' && yarn install --no-immutable",
"publish-release": "changeset publish",
"prettier:check": "prettier --check .",
"npm:release": "yarn install && tsc && yarn build && changeset publish"
},
"devDependencies": {
"@backstage/cli": "^0.18.1",
"@changesets/cli": "^2.24.4",
"@spotify/prettier-config": "^12.0.0",
"@types/react": "^17.0.0",
"jest-junit": "^13.0.0",
"prettier": "^2.3.2",
"react": "^17.0.0",
"react-dom": "^17.0.0"
},
"prettier": "@spotify/prettier-config",
"lint-staged": {
"*.{js,jsx,ts,tsx,mjs,cjs}": [
"eslint --fix",
"prettier --write"
],
"*.{json,md}": [
"prettier --write"
]
}
}
1 change: 1 addition & 0 deletions plugins/s3-viewer-backend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
Loading

0 comments on commit 8deb36f

Please sign in to comment.