From 3d70b117cf65e7f5168246df5211409de6117ced Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Fri, 7 Feb 2020 13:49:10 +0100 Subject: [PATCH 1/7] Added a Brewfile --- Brewfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Brewfile diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000000..d5319ac17c --- /dev/null +++ b/Brewfile @@ -0,0 +1,21 @@ +### +# This will download all Homebrew dependencies. +### + +# Shared +brew "git" +brew "docker" +brew "docker-compose" +brew "protobuf" +brew "prototool" +cask "docker" + +# Frontend +brew "node@12" +brew "yarn" + +# Backend +brew "go" + + + From 0d1842658c9a61eccc07921d1539ad005cd39c38 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Fri, 7 Feb 2020 14:36:12 +0100 Subject: [PATCH 2/7] Fixed merge conflict --- Makefile | 36 +++++++++++++++++++++++++++++++++--- README.md | 23 +++++++++++++++++------ secrets.env.example | 15 +++++++++++++++ 3 files changed, 65 insertions(+), 9 deletions(-) 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="" From fdaa0538d8d3d118ee5c544528b9d617fc53a54c Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Fri, 7 Feb 2020 14:10:36 +0100 Subject: [PATCH 3/7] Removed newlines --- Brewfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Brewfile b/Brewfile index d5319ac17c..8e43ffdd88 100644 --- a/Brewfile +++ b/Brewfile @@ -16,6 +16,3 @@ brew "yarn" # Backend brew "go" - - - From 779559b4a5febf91b97760dc350657cb6ef67fb2 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Fri, 7 Feb 2020 14:15:06 +0100 Subject: [PATCH 4/7] fix typo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0dace9771f..e8f709ad74 100644 --- a/Makefile +++ b/Makefile @@ -51,4 +51,4 @@ stop-backends: # Run the frontend services. ### start-frontend: - yarn --pwd ${PWD}/frontend start + yarn --cwd ${PWD}/frontend start From a84004f00ac5eb0ec093498414e72e7d73eca56c Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Fri, 7 Feb 2020 14:27:23 +0100 Subject: [PATCH 5/7] Added forego --- Brewfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Brewfile b/Brewfile index 8e43ffdd88..9dd655cee3 100644 --- a/Brewfile +++ b/Brewfile @@ -8,6 +8,7 @@ brew "docker" brew "docker-compose" brew "protobuf" brew "prototool" +brew "forego" cask "docker" # Frontend From deda60b8434206a136f4b7fafd98f1f801b44675 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Fri, 7 Feb 2020 14:33:25 +0100 Subject: [PATCH 6/7] Updated to use forego --- Brewfile | 1 - Makefile | 27 +++++++++------------------ 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/Brewfile b/Brewfile index 9dd655cee3..8e43ffdd88 100644 --- a/Brewfile +++ b/Brewfile @@ -8,7 +8,6 @@ brew "docker" brew "docker-compose" brew "protobuf" brew "prototool" -brew "forego" cask "docker" # Frontend diff --git a/Makefile b/Makefile index e8f709ad74..125f74565e 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,9 @@ # All-in-one commands ### init: init-secrets -install: install-homebrew-dependencies install-yarn-dependencies -start: build-protocol-definitions start-backends start-frontend -stop: stop-backends +install: install-homebrew-dependencies install-yarn-dependencies install-forego +start: build-protocol-definitions + forego start ### # Setup secrets @@ -24,6 +24,12 @@ install-homebrew-dependencies: install-yarn-dependencies: yarn --cwd ${PWD}/frontend install +### +# Install Forego for running both frontend and backend in a single command. +### +install-forego: + go get -u github.com/ddollar/forego + ### # Protobuf Definitions. # This will generate Protobuf definitions from ./proto to both Go and JS/TypeScript. @@ -37,18 +43,3 @@ 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 --cwd ${PWD}/frontend start From a3077d4c89b27f521b4f453c035c713bd81b1523 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Fri, 7 Feb 2020 14:37:53 +0100 Subject: [PATCH 7/7] Cleanup README --- README.md | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/README.md b/README.md index 5819d80994..75bbf2a0a7 100644 --- a/README.md +++ b/README.md @@ -38,27 +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 -# GitHub username -BOSS_GH_USERNAME= -# GitHub Access token with repo scope, created at https://github.com/settings/tokens -BOSS_GH_ACCESS_TOKEN= -``` - -Then run start all backend services using `docker-compose`: - -```bash -$ ./docker-compose.yaml up --build -``` - -And finally install all dependencies and start serving the frontend using `yarn`: - -======= - -> > > > > > > f7ec4a6... Polishes +Once you've installed all dependencies, start serving the frontend using `yarn`: ```bash $ make start