Skip to content

Commit

Permalink
Merge pull request #38 from CodeForPhilly/develop
Browse files Browse the repository at this point in the history
Release: v0.1.3
  • Loading branch information
themightychris authored May 10, 2023
2 parents 74f6945 + 4515da8 commit 5add95b
Show file tree
Hide file tree
Showing 29 changed files with 882 additions and 59 deletions.
3 changes: 3 additions & 0 deletions .holo/branches/helm-chart/_third-places.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[holomapping]
root = "helm-chart"
files = "**"
2 changes: 2 additions & 0 deletions .holo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[holospace]
name = "third-places"
46 changes: 39 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,57 @@
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to release number versioning.
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Set up React and Django boilerplate [#1](https://github.com/CodeForPhilly/third-places/pull/1)
- Added Docker containers with docker-compose [#10](https://github.com/CodeForPhilly/third-places/pull/10)
- Set up Leaflet React component and boiletplate homepage[#7](https://github.com/CodeForPhilly/third-places/issues/7)
- Added initial Django models & migration [#21](https://github.com/CodeForPhilly/third-places/pull/21)
- Added initial REST endpoints for Users [#23](https://github.com/CodeForPhilly/third-places/pull/23)
- Added buttons at bottom of Map [#40](https://github.com/CodeForPhilly/third-places/pull/40)
- Add location endpoints [#44](https://github.com/CodeForPhilly/third-places/pull/44)
- Add migration to populate locations from Yelp [#48](https://github.com/CodeForPhilly/third-places/pull/48)

### Changed

- Update docs with release process [#40](https://github.com/CodeForPhilly/third-places/pull/40)

### Deprecated

### Removed

### Fixed
- Issue template [#9](https://github.com/CodeForPhilly/third-places/pull/9)

## [0.1.2]

### Fixed

- Remove nonexistent target [#37](https://github.com/CodeForPhilly/third-places/pull/37)

## [0.1.1]

### Added

- Build and publish Docker container images [#36](https://github.com/CodeForPhilly/third-places/pull/36)

## [0.1.0]

### Added

- Set up React and Django boilerplate [#1](https://github.com/CodeForPhilly/third-places/pull/1)
- Added Docker containers with docker-compose [#10](https://github.com/CodeForPhilly/third-places/pull/10)
- Set up Leaflet React component and boiletplate homepage[#16](https://github.com/CodeForPhilly/third-places/issues/16)
- Added initial Django models & migration [#21](https://github.com/CodeForPhilly/third-places/pull/21)
- Add automated release workflow [#35](https://github.com/CodeForPhilly/third-places/pull/35)

### Changed

- Made Leaflet map element fullscreen and rmeoved title[#27](https://github.com/CodeForPhilly/third-places/issues/27)

### Fixed

- Issue template [#9](https://github.com/CodeForPhilly/third-places/pull/9)

[Unreleased]:
[0.1.3]: https://github.com/CodeForPhilly/third-places/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/CodeForPhilly/third-places/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/CodeForPhilly/third-places/releases/tag/v0.1.0
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,7 @@ git pull
# Delete the branch from your local machine
git branch -d <new-branch-name>
```

## Creating a release

See the [RELEASES.md](https://github.com/CodeForPhilly/third-places/blob/develop/RELEASES.md) for an explanation of this process
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@ Access the following ports from localhost to access their respective services

### Api Reference

`/api/`: Hello world!
- `/api/`: Hello world!
- `/users/`: `GET`, `POST` users
- `/users/{id}`: `GET`, `PUT` specific user details
34 changes: 34 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Releases

## Overview

Releases on this project are triggered through GitHub Actions listening for differences between our `main` and `develop` branches. A pull request for the next release is created by a github-actions bot and merging this pull request automatically delivers the changes up to production.

## Creating a release

A release pull request (PR) is created anytime something new is merged to `develop` that has not yet been merged to `main`. To execute a release and kickoff the CI process:
- Find the automated PR that was created by github-actions.
- It will always have a "Release: v#.#.#" title.
- Copy the list from the "changelog" comment
- Edit the description of the release PR
- Paste in the list of changes and distribute each item accordingly to the Improvements and Technical sections
- Update `CHANGELOG.md` as part of the release PR:
- Copy the whole "Unreleased" section and paste above it
- Replace the lower "Unreleased" title with the version in the release PR
- In the top unreleased section remove all references from each of the five lists (reset it to be blank)
- In the section covering this release's changes, remove any of the sections that have no PRs referenced (e.g. if "Removed" has no PRs in it, you can remove that section title)
- At the very bottom there is a list of the versions.
- Copy the top version list line and paste it at the top of the same list
- Change the numbers to now reflect this change
- Merge the PR to main
- This will kick off a continuous

### Note

Once more PRs are merged to `develop` a new Release PR will be created automatically. We will never have to write a release PR from scratch.

## Updating the CHANGELOG.md

Besides the [version changelog](https://github.com/CodeForPhilly/third-places/releases) that is automatically created as releases are executed, we also keep a [CHANGELOG.md](https://github.com/CodeForPhilly/third-places/blob/develop/CHANGELOG.md) that is updated with each pull request that is merged to develop to help keep track of what changes are made.

The changelog itself links to [documentation](https://keepachangelog.com/en/1.0.0/) describing the format. The essential form is a list of PR titles and links to those PRs organized by what release they go with and what category of change they are making.
23 changes: 23 additions & 0 deletions helm-chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: third-places
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: 0.1.2
62 changes: 62 additions & 0 deletions helm-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "third-places.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "third-places.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "third-places.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "third-places.labels" -}}
helm.sh/chart: {{ include "third-places.chart" . }}
{{ include "third-places.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "third-places.selectorLabels" -}}
app.kubernetes.io/name: {{ include "third-places.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "third-places.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "third-places.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
16 changes: 16 additions & 0 deletions helm-chart/templates/database/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "third-places.fullname" . }}-postgresql
labels:
{{- include "third-places.labels" . | nindent 4 }}
app.kubernetes.io/component: postgresql
spec:
selector:
{{- include "third-places.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: postgresql
type: {{ .Values.postgresql.serviceType }}
ports:
- name: postgresql
port: 5432
nodePort: 30432
95 changes: 95 additions & 0 deletions helm-chart/templates/database/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "third-places.fullname" . }}-postgresql
labels:
{{- include "third-places.labels" . | nindent 4 }}
app.kubernetes.io/component: postgresql
spec:
replicas: {{ .Values.postgresql.replicas }}
selector:
matchLabels:
{{- include "third-places.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: postgresql
serviceName: postgresql
template:
metadata:
labels:
{{- include "third-places.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: postgresql
{{- with .Values.postgresql.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.postgresql.imagePullSecrets }}
imagePullSecrets:
{{ toYaml . | nindent 6 }}
{{- end }}
containers:
- name: postgresql
image: {{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}
{{- if or .Values.postgresql.config .Values.postgresql.existingSecret }}
envFrom:
{{- if .Values.postgresql.config }}
- configMapRef:
name: {{ include "third-places.fullname" . }}-postgresql
{{- end }}
{{- if .Values.postgresql.existingSecret }}
- secretRef:
name: {{ .Values.postgresql.existingSecret }}
{{- end }}
{{- end }}
ports:
- containerPort: 5432
name: postgresql
{{- if .Values.postgresql.volumes }}
volumeMounts:
{{- if .Values.postgresql.volumes.data }}
- name: data
mountPath: /var/lib/postgresql/data
subPath: postgresql-data
{{- end }}
{{- end }}
readinessProbe:
tcpSocket:
port: 5432
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 5432
initialDelaySeconds: 15
periodSeconds: 20

{{- with .Values.postgresql.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}

{{- with .Values.postgresql.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}

{{- with .Values.postgresql.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

{{- if .Values.postgresql.volumes }}
volumeClaimTemplates:
{{- if .Values.postgresql.volumes.data }}
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.postgresql.volumes.data.storageClassName }}
storageClassName: {{ .Values.postgresql.volumes.data.storageClassName }}
{{- end }}
resources:
requests:
storage: {{ .Values.postgresql.volumes.data.size }}
{{- end }}
{{- end }}
Loading

0 comments on commit 5add95b

Please sign in to comment.