Skip to content

Commit 197a17d

Browse files
Merge pull request #60 from CodeForPhilly/develop
Release: v1.1.19
2 parents 0f9f581 + 775d8e9 commit 197a17d

File tree

4 files changed

+83
-4
lines changed

4 files changed

+83
-4
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @themightychris

docs/operations/accessing-prod.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Accessing Production
2+
3+
The production instance of `codeforphilly.org` is deployed via the [`cfp-live-cluster`](https://github.com/CodeForPhilly/cfp-live-cluster) via the release configured at [`cfp-live-cluster/code-for-philly`](https://github.com/CodeForPhilly/cfp-live-cluster/tree/main/code-for-philly)
4+
5+
## Deployment process
6+
7+
1. Merge one or more PRs into `develop` under the [`codeforphilly.org`](https://github.com/CodeForPhilly/codeforphilly.org) repository
8+
- A release PR will automatically be generated with a suggested version number in the title, a template for release notes in the description, and a copyable draft changelog in the first comment
9+
- The first comment with the draft changelog will be automatically updated as additional commits/PRs are added to `develop`
10+
- The title or description will not be automatically changed after the PR is initially created, so they are safe to manually edit
11+
2. Copy bullet points from the generated changelog comment and use them to fill out the release notes template in the description, deleting any unused section. The suggested version number in the title will default to incrementing the patch number, and may be manually edited to switch to incrementing the minor number
12+
3. Merge the release PR when ready
13+
- A GitHub release+tag will automatically get created
14+
- The new release/tag will kick off automatically building and tagging a new Docker container image
15+
4. After the new image is built, edit [`code-for-philly/release-values.yaml`](https://github.com/CodeForPhilly/cfp-live-cluster/blob/main/code-for-philly/release-values.yaml) in the `cfp-live-cluster` repository to update the image tag to the new version either as a direct commit to the `main` branch or a PR (see [this example commit](https://github.com/CodeForPhilly/cfp-live-cluster/commit/67ce5a73b94ebd6e12a5aff34f2f7b02a9fd42f2))
16+
5. Ask the Code for Philly ops team to merge your version bump PR if needed
17+
- A deployment PR will automatically be generated after that, previewing the pending changes to the cluster
18+
6. Ask the Code for Philly ops team to merge the pending deployment
19+
- The cluster will automatically be updated and the new image deployed
20+
21+
## Accessing instance
22+
23+
The production database runs within the Kubernetes cluster, and is snapshotted every hour by `restic` to a Linode cloud storage bucket.
24+
25+
The database, as well as application logs and shell, can be accessed via a `KUBECONFIG` file with access to the needed resources. Ask Code for Philly ops to provide one if needed.
26+
27+
### Using admin service account
28+
29+
1. Activate the provided `KUBECONFIG` in your current terminal session:
30+
31+
```bash
32+
export KUBECONFIG=~/.kube/code-for-philly-admin.yaml
33+
```
34+
35+
2. Get the name of the currently running pods and store them in shell variables:
36+
37+
```bash
38+
POD_NAME=$(kubectl -n code-for-philly get pod -l app.kubernetes.io/name=code-for-philly -o jsonpath='{.items[0].metadata.name}')
39+
```
40+
41+
### Open interactive backend shell
42+
43+
```bash
44+
kubectl -n code-for-philly exec -it $POD_NAME -- bash
45+
```
46+
47+
### Open interactive database shell
48+
49+
```bash
50+
kubectl -n code-for-philly exec -it $POD_NAME -- hab pkg exec codeforphilly/site-composite mysql
51+
```
52+
53+
### Run an emergence-console command
54+
55+
```bash
56+
kubectl -n code-for-philly exec -it $POD_NAME -- hab pkg exec codeforphilly/site-composite emergence-console-run migrations:execute
57+
```
58+
59+
### Run an SQL query
60+
61+
```bash
62+
echo 'SELECT * FROM people' | kubectl -n code-for-philly exec -i $POD_NAME -- hab pkg exec codeforphilly/site-composite mysql
63+
```
64+
65+
### Dump the entire database
66+
67+
```bash
68+
kubectl -n code-for-philly exec -it $POD_NAME -- hab pkg exec codeforphilly/site-composite mysqldump 'codeforphilly' > /tmp/codeforphilly.sql
69+
```
70+
71+
### Forward MySQL port
72+
73+
```bash
74+
kubectl -n code-for-philly port-forward pods/$POD_NAME 3306:3306
75+
```
76+
77+
!!! tip "Database logins"
78+
Default database credentials can be found in `helm-chart/values.yaml` (typically `admin` / `admin`)

html-templates/home.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
{projectTile name="PHLASK" portfolioModal="#portfolioModal1" short="Access to Public Water" image="phlask.png" }
117117
{projectTile name="PAWS" portfolioModal="#portfolioModal2" short="Homes for all Pets" image="paws.png" }
118118
{projectTile name="PLSE" portfolioModal="#portfolioModal4" short="Legal Support and Expungement" image="plse.png" }
119-
{projectTile name="Only Plant Natives PA" portfolioModal="#portfolioModal5" short="Propagate PA Wildflowers" image="flowers.jpg" }
119+
{projectTile name="Choose Native Plants PA" portfolioModal="#portfolioModal5" short="Propagate PA Wildflowers" image="flowers.jpg" }
120120
{projectTile name="CfP Website Design" portfolioModal="#portfolioModal6" short="Homepage" image="code-for-philly.png" }
121121

122122

@@ -522,7 +522,7 @@ On July 1st, they will encounter a problem that will severely hinder their abili
522522
This project involves 'scraping' criminal history record information from a publicly-available database and storing it on secure servers only available to PLSE staff for the purpose of expungements. The data will need to be properly organized in order to easily pull up an individual's full record. This project is the only way they could continue providing quick, life-changing services to Philadelphia communities."
523523
project="prevention_point_unified_reporting_system" site="https://www.plsephilly.org/" github="https://github.com/CodeForPhilly/prevention-point" slack="preventionpoint" }
524524

525-
{projectModal name="Only Plant Natives PA" modal="portfolioModal5" image="flowers.jpg"
525+
{projectModal name="Choose Native Plants PA" modal="portfolioModal5" image="flowers.jpg"
526526
description="Native plants are really <a href='https://www.audubon.org/content/why-native-plants-matter'>important...</a><br><br>
527527
But it is a bit overwhelming to select plants (e.g. wildflowers and grasses). This google sheet + tableau solution is designed to assist as a entry point to further research.
528528
I'm seeking user experience feedback from the Code for Philly community. Also - If anyone wants to help with the database, please join the project."

html-templates/includes/site.nav-sitelinks.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<a class="dropdown-item" href="/mission">{_ "Mission"}</a>
2424
<a class="dropdown-item" href="/pages/code_of_conduct/">{_ "Code of Conduct"}</a>
2525
<a class="dropdown-item" href="/pages/leadership/">{_ "Organizing Team"}</a>
26-
<a class="dropdown-item" href="/pages/leadership-support_team_open_positions/">{_ "Join the Organizing Team"}</a>
26+
<a class="dropdown-item" href="/pages/open_leadership_positions/">{_ "Join the Organizing Team"}</a>
2727
<a class="dropdown-item" href="/contact">{_ "Contact Us"}</a>
2828
</div>
29-
</li>
29+
</li>

0 commit comments

Comments
 (0)