diff --git a/Makefile b/Makefile index cee6d132cf..0dace9771f 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,27 @@ ### -# All-in-one build command. +# All-in-one commands ### -build: build-yarn-dependencies build-protocol-definitions +init: init-secrets +install: install-homebrew-dependencies install-yarn-dependencies +start: build-protocol-definitions start-backends start-frontend +stop: stop-backends + +### +# Setup secrets +### +init-secrets: + cp secrets.env.example secrets.env + +### +# Install any Homebrew dependencies specified in Brewfile +### +install-homebrew-dependencies: + brew bundle ### # Download dependencies from the Frontend using Yarn. ### -build-yarn-dependencies: +install-yarn-dependencies: yarn --cwd ${PWD}/frontend install ### @@ -22,3 +37,18 @@ build-protocol-definitions: ### scaffold-new-frontend-plugin: ${PWD}/tools/cookiecutter/init.sh frontend/packages/plugins/_template --output-dir frontend/packages/plugins + +### +# Run the backend services +### +start-backends: + ${PWD}/docker-compose.yaml up --build --detach + +stop-backends: + ${PWD}/docker-compose.yaml down + +### +# Run the frontend services. +### +start-frontend: + yarn --pwd ${PWD}/frontend start diff --git a/README.md b/README.md index dac98d9f28..5819d80994 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,22 @@ Backstage is an open platform for building developer portals. ## Getting started +### Install Dependencies with Homebrew and Yarn + +Run the following to install relevant dependencies (such as Git, Docker, etc): + +```bash +# If you don't have Homebrew, run the following command: +# $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +$ make install +``` + ### Secrets To setup secrets, copy the `secrets.env.example` to `secrets.env` as such: ```bash -$ cp secrets.env.example secrets.env +$ make init-secrets ``` ### Protobuf Definitions @@ -28,6 +38,7 @@ See [proto/README.md](proto/README.md) for more information. ## Running Locally +<<<<<<< HEAD First step is to set up a `secrets.env` file in the root of the repo. Use the following template but fill in your own values (without quotes!): ```bash @@ -45,12 +56,12 @@ $ ./docker-compose.yaml up --build And finally install all dependencies and start serving the frontend using `yarn`: +======= + +> > > > > > > f7ec4a6... Polishes + ```bash -$ cd frontend - -$ yarn install - -$ yarn start +$ make start ``` ## Plugins diff --git a/secrets.env.example b/secrets.env.example index c83bd2158b..bac99824e0 100644 --- a/secrets.env.example +++ b/secrets.env.example @@ -1,4 +1,19 @@ +### +# The environment you want to run the frontend (running using create-react-app) in. +# In production, these should be `production` and false respectively. +### NODE_ENV=development NODE_DEBUG=true + +### +# This is the full HTTP endpoint to the GraphQL API you'll want to point to. +# For example (in development): http://localhost:8080/graphql +### REACT_APP_GRAPHQL_API="" + +### +# A valid GitHub access token. +# To create one, visit https://github.com/settings/tokens in your browser. +### +BOSS_GH_USERNAME="" BOSS_GH_ACCESS_TOKEN=""