Merge branch 'master' into alund/frontend

This commit is contained in:
Stefan Ålund
2020-03-09 10:44:06 +01:00
6 changed files with 53 additions and 24 deletions
+14
View File
@@ -0,0 +1,14 @@
## Hey, I just made a Pull Request!
<!-- Please describe what you added, and add a screenshot if possible.
That makes it easier to understand the change so we can :shipit: faster. -->
#### :heavy_check_mark: Checklist
<!--- Put an `x` in all the boxes that apply: -->
- [ ] All tests are passing `yarn test`
- [ ] Screenshots attached (for UI changes)
- [ ] Relevant documentation updated
- [ ] Prettier run on changed files
- [ ] Tests added for new functionality
- [ ] [CODEOWNERS](./CODEOWNERS) updated (for new stuff)
- [ ] Regression tests added for bug fixes
+31 -20
View File
@@ -7,20 +7,23 @@
Backstage is an open platform for building developer portals.
The philosophy behind Backstage is simple: don't expose your engineers to the full complexity of all your infrastructure tooling and services -- hide it behind a _single_ centralized, consistent user-friendly interface.
The philosophy behind Backstage is simple: Don't expose your engineers to the full complexity of your infrastructure tooling. Engineers should be shipping code — not figuring out a whole new toolset every time they want to implement the basics.
![headline](headline.png)
At Spotify we believe that a better developer experience leads to happier and more productive engineers.
At Spotify we [strongly believe](https://backstage.io/the-spotify-story) that a better developer experience leads to happier and more productive engineers.
## Overview
The Backstage platform consists of a number of different components:
- **frontend** Main web application that users interact with. It's built up by a number of different _Plugins_. Plugins all use a common set of platform API's and reusable UI components. Each plugin is treated as a self-contained web app and can include almost any type of content. Plugins can fetch data either from the _backend_ or through any RESTful API exposed through the _proxy_.
- **backend** GraphQL aggregation service that holds the model of your software ecosystem, including organisational information and what team owns what software. The backend also has a Plugin model for extending its graph.
- **proxy** Terminates HTTPS and exposes any RESTful API to Plugins.
- **identity** A backend service that holds your organisation's metadata.
- **frontend** - Main web application that users interact with. It's built up by a number of different _Plugins_.
- **plugins** - Each plugin is treated as a self-contained web app and can include almost any type of content. Plugins all use a common set of platform API's and reusable UI components. Plugins can fetch data either from the _backend_ or through any RESTful API exposed through the _proxy_.
- **backend** * - GraphQL aggregation service that holds the model of your software ecosystem, including organisational information and what team owns what software. The backend also has a Plugin model for extending its graph.
- **proxy** - Terminates HTTPS and exposes any RESTful API to Plugins.
- **identity** * - A backend service that holds your organisation's metadata.
_* not yet released_
![overview](backstage_overview.png)
@@ -28,23 +31,15 @@ The Backstage platform consists of a number of different components:
### Install Dependencies
To run the frontend, you will need to have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git), [NodeJS](https://nodejs.org/en/download/), and [yarn](https://classic.yarnpkg.com/en/docs/install#mac-stable) installed.
To run the frontend, you will need to have the following installed:
For running the backend, depending on your OS, you need [Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/install/), [Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/install/), or for Linux, [docker](https://docs.docker.com/install/) and [docker-compose](https://docs.docker.com/compose/install/#install-compose-on-linux-systems).
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* [NodeJS](https://nodejs.org/en/download/)
* [yarn](https://classic.yarnpkg.com/en/docs/install)
The above dependencies are enough to run and work on the Backstage frontend packages. To develop backend services, there are some more tools to install, see [backend/README.md](backend/README.md). To update protobuf definitions, you will need another set of tools, see [proto/README.md](proto/README.md).
## Running the frontend locally
## Running Locally
The full local system consists of a collection of backend services, as well as a web application. From the root of the project directory, run the following in a terminal to start up all backend services locally:
```bash
$ cd backend
$ docker-compose up --build
```
Once the backend services are up and running, open a separate terminal window and start the web app using the following commands from the project root:
Open a terminal window and start the web app using the following commands from the project root:
```bash
$ yarn # may take a while
@@ -68,8 +63,24 @@ This will prompt you to enter an ID for your plugin, and then create your plugin
If you have `yarn start` already running you should be able to see the default page for your new plugin at [localhost:3000/my-plugin](http://localhost:3000/my-plugin), if you called the plugin `"my-plugin"`.
## Running the backend(s) locally
For running the backend, depending on your OS, you need [Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/install/), [Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/install/), or for Linux, [docker](https://docs.docker.com/install/) and [docker-compose](https://docs.docker.com/compose/install/#install-compose-on-linux-systems).
The full local system consists of a collection of backend services, as well as a web application. From the root of the project directory, run the following in a terminal to start up all backend services locally:
```bash
$ cd backend
$ docker-compose up --build
```
To develop backend services, there are some more tools to install, see [backend/README.md](backend/README.md). To update protobuf definitions, you will need another set of tools, see [proto/README.md](proto/README.md).
## Documentation
_TODO: Add links to docs on backstage.io_
## License
Copyright 2020 Spotify AB.
+2 -2
View File
@@ -4,9 +4,9 @@
"scripts": {
"start": "yarn build && yarn workspace @spotify-backstage/app start",
"build": "lerna run build",
"test": "cross-env CI=true lerna run test --stream --parallel -- --coverage",
"test": "cross-env CI=true lerna run test -- --coverage",
"create-plugin": "backstage-cli create-plugin",
"lint": "lerna run lint --stream"
"lint": "lerna run lint"
},
"workspaces": {
"packages": [
@@ -97,7 +97,7 @@ describe('createPlugin', () => {
createTemporaryPluginFolder(tempDir);
movePlugin(tempDir, pluginDir, id);
expect(fs.existsSync(pluginDir)).toBe(true);
expect(pluginDir).toMatch(`/packages\/plugins\/${id}`);
expect(pluginDir).toMatch(`/plugins\/${id}`);
} finally {
del.sync(tempDir, { force: true });
del.sync(rootDir, { force: true });
@@ -8,6 +8,9 @@ export default async (cmd: Command) => {
if (cmd.watch) {
args.push('--watch');
}
if (cmd.coverage) {
args.push('--coverage');
}
try {
const result = spawnSync('web-scripts', args, { stdio: 'inherit' });
+2 -1
View File
@@ -6,7 +6,7 @@ import watch from './commands/watch-deps';
import pluginBuild from './commands/plugin/build';
import pluginLint from './commands/plugin/lint';
import pluginServe from './commands/plugin/serve';
import pluginTest from './commands/plugin/test';
import pluginTest from './commands/plugin/testCommand';
process.on('unhandledRejection', err => {
throw err;
@@ -41,6 +41,7 @@ const main = (argv: string[]) => {
program
.command('plugin:test')
.option('--watch', 'Enable watch mode')
.option('--coverage', 'Report test coverage')
.description('Run all tests for a plugin')
.action(pluginTest);