Skip to content

Commit

Permalink
Fix environment setup in new structure
Browse files Browse the repository at this point in the history
The GITHUB TOKEN's environment name has changed recently but this was not reflected in the readme and the .env configs. This change also makes sure that the .env file values are proeprly picked up, and that the README is updated to help new users be able to set up their local dev environment quicker
  • Loading branch information
sztupy committed Jan 25, 2024
1 parent a2a507b commit 519b5f5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Allow accessing a GitHub bearer token to avoid rate limits when doing HTTP fetches to the GitHub API.
# This can be generated at https://github.com/settings/tokens?type=beta and needs read-only access to all public CYF GitHub repos.
CYF_CURRICULUM_GITHUB_BEARER_TOKEN=""
HUGO_CURRICULUM_GITHUB_BEARER_TOKEN=""
# Client ID and secret for the GitHub OAuth app used to authenticate users.
GITHUB_CLIENT_ID="clientid"
GITHUB_CLIENT_SECRET="clientsecret"
# The domain of the site, used for generating redirect URLs.
DOMAIN="http://localhost:8888"
DOMAIN="http://localhost:8888"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ For each module you import, add a `replace` directive to your `go.mod` file - if

## To locally develop your site

`cd` into the site you wish to develop, and run `hugo server` to get a live preview.
Check [org-cyf/README.md](/org-cyf/README.md) on how to set up your local environment. Once that is done you can `cd` into the site you wish to develop, and run `npm run start:dev` to get a live preview.
2 changes: 1 addition & 1 deletion org-cyf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The "Repository access" you need is "Public repositories (read-only)", and you d

#### Set up `.env`

Copy the `.env.example` file over and name it `.env`. Edit the file and then change the line that says `CYF_CURRICULUM_GITHUB_BEARER_TOKEN` to contain the token that you have generated earlier.
Copy the `.env.example` file over and name it `.env`. Edit the file and then change the line that says `HUGO_CURRICULUM_GITHUB_BEARER_TOKEN` to contain the token that you have generated earlier.

#### Run this command

Expand Down
3 changes: 2 additions & 1 deletion org-cyf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start:dev": "dotenv -- hugo server -p 3000 -D"
"start:dev": "dotenv -e ../.env -- hugo server --environment issues-are-cached-and-incomplete",
"build:dev": "dotenv -e ../.env -- hugo --environment issues-are-cached-and-incomplete"
},
"keywords": [],
"author": "",
Expand Down
4 changes: 2 additions & 2 deletions org-mcb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start:dev": "dotenv -- hugo server --environment issues-are-cached-and-incomplete",
"build:dev": "dotenv -- hugo --environment issues-are-cached-and-incomplete"
"start:dev": "dotenv -e ../.env -- hugo server --environment issues-are-cached-and-incomplete",
"build:dev": "dotenv -e ../.env -- hugo --environment issues-are-cached-and-incomplete"
},
"keywords": [],
"author": "",
Expand Down

0 comments on commit 519b5f5

Please sign in to comment.