Skip to content

Commit ef3461b

Browse files
tunethewebibnesayeedrviscomi
authored
Remove generated content from being tracked in Git (#1230)
* Remove generated content * Add deploy script * Linting fixes * Linting and README fixes * Linting fixes * Check branch is clean before deploying * Uncapitalise non-default * Linting fixes * Improved deploy method * Add PDFs back in * Linting issues * Uncomment commands * Increment patch instead of major by default * Fix typo * Review feedback and other cleanups * Fix typo * Update src/tools/scripts/deploy.sh Co-authored-by: Sawood Alam <[email protected]> * Update src/tools/scripts/deploy.sh Co-authored-by: Sawood Alam <[email protected]> * Update src/tools/scripts/deploy.sh Co-authored-by: Sawood Alam <[email protected]> * Review feedback * Update src/.gcloudignore Co-authored-by: Rick Viscomi <[email protected]> * README updates * Make deploy.zip smaller * Cleanup Co-authored-by: Sawood Alam <[email protected]> Co-authored-by: Rick Viscomi <[email protected]>
1 parent 68cd099 commit ef3461b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+152
-55140
lines changed

src/.gcloudignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
# For more information, run:
77
# $ gcloud topic gcloudignore
88
#
9+
# Note we are also using this for zip ignore in deploy.sh, so have to be a little
10+
# bit more verbose than gcloud demands, to exclude items
11+
912
.gcloudignore
13+
1014
# If you would like to upload your .git directory, .gitignore file or files
1115
# from your .gitignore file, remove the corresponding line
1216
# below:
@@ -16,8 +20,24 @@
1620
# Python pycache:
1721
__pycache__/
1822
.pytest_cache/
23+
__pycache__/*
24+
.pytest_cache/*
25+
**/__pycache__/*
26+
**/.pytest_cache/*
27+
*.pyc
28+
**/*.pyc
29+
1930
# Ignored by the build system
2031
/setup.cfg
2132

2233
env/
34+
env/*
2335
node_modules/
36+
node_modules/*
37+
static/html
38+
static/html/*
39+
.DS_Store
40+
**/.DS_Store
41+
Dockerfile
42+
.dockerignore
43+
deployed.zip

src/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
.idea/
22
.vscode/
33
node_modules/
4+
templates/*/*/chapters/
5+
templates/*/*/ebook.html
6+
templates/sitemap.xml
47
static/html/
8+
deployed.zip

src/README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ptw
5050

5151
The chapter generation is dependent on nodejs, so you will need to have [nodejs](https://nodejs.org/en/) installed as well. All of the following commands must be run from within the `src` directory by executing `cd src` first.
5252

53-
Note this is run automatically by a GitHub Action on merges to main, so does not need to be run manually.
53+
Note this is run automatically by a GitHub Action on merges to main, so does not need to be run manually unless you want to run the site locally.
5454

5555
Install the dependencies:
5656

@@ -152,28 +152,27 @@ _Make sure you have generated the ebooks PDFs first in the main branch, by runni
152152
gcloud init
153153
```
154154

155-
3. Stage the changes locally:
156-
157-
```
158-
git checkout production
159-
git status
160-
git pull
161-
git pull origin main
162-
git push
163-
```
164-
165-
- Check out the `production` branch
166-
- Run `git status` to ensure you don't have any uncommitted changes locally
167-
- Merge any remote changes (both origin/production and origin/main branches)
168-
- Push the merge-commit back up to origin/production
169-
170-
4. Browse the website locally as one final QA test, then deploy the changes live:
155+
3. Deploy the site:
171156

172157
```
173158
npm run deploy
174159
```
175160

176-
5. Browse the website in production to verify that the new changes have taken effect
161+
The deploy script will do the following:
162+
- Ask you to confirm you've updated the eBooks via GitHub Actions
163+
- Switch to the production branch
164+
- Merge changes from main
165+
- Do a clean install
166+
- Run the tests
167+
- Ask you to complete any local tests and confirm good to deploy
168+
- Ask for a version number (suggesing the last verision tagged and incrementing the patch)
169+
- Tag the release (after asking you for the version number to use)
170+
- Generate a `deploy.zip` file of what has been deployed
171+
- Deploy to GCP
172+
- Push changes to `production` branch on GitHub
173+
- Ask you to update the release section of GitHub
174+
175+
4. Browse the website in production to verify that the new changes have taken effect. Not we have 3 hour caching so add random query params to pages to ensure you get latest version.
177176

178177
## Developing in Docker
179178

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"test": "node ./tools/test",
1818
"generate": "node ./tools/generate",
1919
"ebooks": "node ./tools/generate/generate_ebook_pdfs",
20-
"deploy": "echo \"Y\" | gcloud app deploy --project webalmanac --stop-previous-version"
20+
"deploy": "./tools/scripts/deploy.sh"
2121
},
2222
"devDependencies": {
2323
"ejs": "^3.1.5",

src/templates/en/2019/chapters/accessibility.html

Lines changed: 0 additions & 381 deletions
This file was deleted.

src/templates/en/2019/chapters/caching.html

Lines changed: 0 additions & 684 deletions
This file was deleted.

src/templates/en/2019/chapters/cdn.html

Lines changed: 0 additions & 1587 deletions
This file was deleted.

src/templates/en/2019/chapters/cms.html

Lines changed: 0 additions & 691 deletions
This file was deleted.

src/templates/en/2019/chapters/compression.html

Lines changed: 0 additions & 330 deletions
This file was deleted.

src/templates/en/2019/chapters/css.html

Lines changed: 0 additions & 807 deletions
This file was deleted.

0 commit comments

Comments
 (0)