Skip to content

Commit

Permalink
feat: roll init into database (#1422)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Sep 17, 2023
1 parent a7d7ea8 commit 57a92e1
Show file tree
Hide file tree
Showing 23 changed files with 57 additions and 243 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ jobs:
issues: write
strategy:
matrix:
name: [init, database, backend, frontend]
name: [database, backend, frontend]
include:
- name: init
file: common/openshift.init.yml
overwrite: false
- name: database
file: database/openshift.deploy.yml
overwrite: false
Expand Down Expand Up @@ -139,11 +136,8 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
name: [init, database, backend, frontend]
name: [database, backend, frontend]
include:
- name: init
file: common/openshift.init.yml
overwrite: false
- name: database
file: database/openshift.deploy.yml
overwrite: false
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,8 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
name: [init, database, backend, frontend]
name: [database, backend, frontend]
include:
- name: init
file: common/openshift.init.yml
overwrite: false
- name: database
file: database/openshift.deploy.yml
overwrite: false
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Runs on pull request submission.
- Deployment includes curl checks and optional penetration tests
- Other checks and updates as required

![](common/graphics/pr-open.png)
![](.graphics/pr-open.png)

## Pull Request Closed

Expand All @@ -79,7 +79,7 @@ Runs on pull request close or merge.
- Cleans up OpenShift objects/artifacts
- Merge promotes successful build images to TEST

![](common/graphics/pr-close.png)
![](.graphics/pr-close.png)

## Merge to Main

Expand All @@ -93,7 +93,7 @@ Runs on merge to main branch.

\* excludes database changes

![](common/graphics/merge-main.png)
![](.graphics/merge-main.png)

## Unit Tests

Expand All @@ -102,7 +102,7 @@ Runs on pull request submission or merge to main.
- Unit tests (should include coverage)
- Optionally, report results to Sonarcloud

![](common/graphics/unit-tests.png)
![](.graphics/unit-tests.png)


# Starter Application
Expand Down Expand Up @@ -150,7 +150,7 @@ Create a new repository using this repository as a template.
* Check Codecov | Code Coverage to grant access
* Jira cannot be unchecked (I try every time!)

![](./common/graphics/template.png)
![](./.graphics/template.png)


## GitHub Secrets, Variables and Environments
Expand Down Expand Up @@ -293,7 +293,7 @@ This is required to prevent direct pushes and merges to the default branch. The
* `[check] Require conversation resolution before merging`
* `[check] Include administrators` (optional)

![](./common/graphics/branch-protection.png)
![](./.graphics/branch-protection.png)

### Adding Team Members

Expand Down
23 changes: 0 additions & 23 deletions common/charts/.helmignore

This file was deleted.

25 changes: 0 additions & 25 deletions common/charts/Chart.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions common/charts/templates/NOTES.txt

This file was deleted.

77 changes: 0 additions & 77 deletions common/charts/templates/_helpers.tpl

This file was deleted.

16 changes: 0 additions & 16 deletions common/charts/values.schema.json

This file was deleted.

15 changes: 0 additions & 15 deletions common/charts/values.yaml

This file was deleted.

57 changes: 0 additions & 57 deletions common/openshift.init.yml

This file was deleted.

File renamed without changes.
51 changes: 48 additions & 3 deletions database/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ parameters:
- name: REGISTRY
description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000)
value: ghcr.io
- name: PROMOTE
description: Image (namespace/name:tag) to promote/import
required: true
- name: PG_DATABASE
description: Postgres database name
value: database
- name: DB_PASSWORD
description: Password for the PostgreSQL connection user.
from: "[a-zA-Z0-9]{16}"
generate: expression
### Backup-Container starts here ###
- name: BACKUP_COMPONENT
description: BACKUP_COMPONENT name
Expand Down Expand Up @@ -78,10 +88,45 @@ parameters:
description: Random number, 0-60, for scheduling cronjobs
from: "[0-5]{1}[0-9]{1}"
generate: expression
- name: PROMOTE
description: Image (namespace/name:tag) to promote/import
required: true
objects:
- apiVersion: v1
kind: Secret
metadata:
name: "${NAME}-${ZONE}-${PG_DATABASE}"
labels:
app: "${NAME}-${ZONE}"
stringData:
database-name: "${NAME}"
database-password: "${DB_PASSWORD}"
database-user: "${NAME}"
- apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-from-openshift-ingress
labels:
template: openshift-test
spec:
podSelector: {}
ingress:
- from:
- namespaceSelector:
matchLabels:
network.openshift.io/policy-group: ingress
policyTypes:
- Ingress
- apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-same-namespace
labels:
template: quickstart-network-security-policy
spec:
podSelector: {}
ingress:
- from:
- podSelector: {}
policyTypes:
- Ingress
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
Expand Down

0 comments on commit 57a92e1

Please sign in to comment.