Skip to content

Commit

Permalink
Re-add the route, but not in production
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmelnikow committed Feb 8, 2019
1 parent 19d2147 commit cf6e3f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ FRONTEND_TMP=${TMPDIR}shields-frontend-deploy
# pushing secrets to GitHub, this branch is configured to reject pushes.
WORKING_BRANCH=server-deploy-working-branch

all: website test

website:
npm run build
all: test

deploy: deploy-s0 deploy-s1 deploy-s2 clean-server-deploy deploy-gh-pages deploy-gh-pages-clean

deploy-s0: prepare-server-deploy push-s0
deploy-s1: prepare-server-deploy push-s1
deploy-s2: prepare-server-deploy push-s2

prepare-server-deploy: website
prepare-server-deploy:
# Ship a copy of the front end to each server for debugging.
# https://github.com/badges/shields/issues/1220
INCLUDE_DEV_PAGES=false \
npm run build
rm -rf ${SERVER_TMP}
git worktree prune
git worktree add -B ${WORKING_BRANCH} ${SERVER_TMP}
Expand Down Expand Up @@ -49,6 +48,7 @@ deploy-gh-pages:
rm -rf ${FRONTEND_TMP}
git worktree prune
GATSBY_BASE_URL=https://img.shields.io \
INCLUDE_DEV_PAGES=false \
npm run build
git worktree add -B gh-pages ${FRONTEND_TMP}
git -C ${FRONTEND_TMP} ls-files | xargs git -C ${FRONTEND_TMP} rm
Expand All @@ -67,4 +67,4 @@ deploy-gh-pages-clean:
test:
npm test

.PHONY: all website deploy prepare-server-deploy clean-server-deploy deploy-s0 deploy-s1 deploy-s2 push-s0 push-s1 push-s2 deploy-gh-pages deploy-gh-pages-clean deploy-heroku setup redis test
.PHONY: all deploy prepare-server-deploy clean-server-deploy deploy-s0 deploy-s1 deploy-s2 push-s0 push-s1 push-s2 deploy-gh-pages deploy-gh-pages-clean deploy-heroku setup redis test
10 changes: 10 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

const fs = require('fs')
const yaml = require('js-yaml')
const envFlag = require('node-env-flag')

const includeDevPages = envFlag(process.env.INCLUDE_DEV_PAGES, true)

const { categories } = yaml.safeLoad(
fs.readFileSync('./service-definitions.yml', 'utf8')
Expand All @@ -17,6 +20,13 @@ const { categories } = yaml.safeLoad(
// unnecessary complexity here, so this uses the programmatic API.
// https://www.gatsbyjs.org/docs/using-gatsby-without-graphql/#the-approach-fetch-data-and-use-gatsbys-createpages-api
async function createPages({ actions: { createPage } }) {
if (includeDevPages) {
createPage({
path: '/dev/logos',
component: require.resolve('./frontend/components/development/logo-page'),
})
}

categories.forEach(category => {
const { id } = category
createPage({
Expand Down

0 comments on commit cf6e3f5

Please sign in to comment.