Skip to content

Commit

Permalink
💾 ./deploy db (#39)
Browse files Browse the repository at this point in the history
# Deploy database
Adds `./deploy -d [TAG]` option.
- `--db` long form
- Deploys postgres database version tag to `db` via `kubectl`
- Only runs single update step, no build / push

Closes #38

## Labels
Changed labels to use emojis directly, instead of github's `:emoji:`
syntax.

This fixes the labels on the Zenhub board.

## milestones
Added [v0.2.1 Upgrade
🔨](https://github.com/WGBH-MLA/ov-deploy/milestone/6) Milestone

## submodules
- Updates [`ov-wag` to
v0.2.1](https://github.com/WGBH-MLA/ov-wag/releases/tag/v0.2.1)
- Updates [`ov-frontend` to
v0.2.1](https://github.com/WGBH-MLA/ov-frontend/releases/tag/v0.2.1)
  • Loading branch information
mrharpo committed Sep 9, 2022
1 parent 4003c87 commit bc7ec62
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 45 deletions.
16 changes: 8 additions & 8 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ changelog:
categories:
- title: Breaking Changes 🪅
labels:
- 'breaking :broken_heart:'
- 'breaking 💔'

- title: New Features 🎉
labels:
- 'enhancement :heavy_plus_sign:'
- 'enhancement '

- title: 'Bugfixes :bug:'
- title: 'Bugfixes 🐛'
labels:
- 'bug :bug:'
- 'bug 🐛'

- title: 'Maintenance :nut_and_bolt:'
- title: 'Maintenance 🔩'
labels:
- 'maintenance :wrench:'
- 'CI :test_tube:'
- 'CD :building_construction:'
- 'maintenance 🔧'
- 'CI 🦾'
- 'CD 🏗️'

- title: Other Changes
labels:
Expand Down
8 changes: 8 additions & 0 deletions cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ def cli():
help='version of the ov-wag headless CMS backend to be deployed',
)

parser.add_argument(
'-d',
'--db',
type=str,
metavar='TAG',
help='version of the database to be deployed',
)

parser.add_argument(
'-f',
'--ov-frontend',
Expand Down
7 changes: 6 additions & 1 deletion deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Deployer(BaseModel):
"""

context: str
db: str = None
ov_wag: str = None
ov_wag_env: str = None
ov_wag_secrets: str = None
Expand Down Expand Up @@ -66,7 +67,9 @@ def deploy(self):
Run the full deployer process using the current context"""
print(f'Starting deployment using context "{self.context}"')

if not any([self.ov_wag, self.ov_frontend, self.ov_nginx, self.jumpbox]):
if not any(
[self.ov_wag, self.ov_frontend, self.ov_nginx, self.jumpbox, self.db]
):
raise Exception(f'Nothing specified for deployment.')
if self.ov_wag:
self._deploy('ov-wag', self.ov_wag, src=f'{OV_WAG_URL}#{self.ov_wag}')
Expand All @@ -80,5 +83,7 @@ def deploy(self):
self._deploy('ov-nginx', self.ov_nginx)
if self.jumpbox:
self._deploy('jumpbox', self.jumpbox)
if self.db:
run(f'kubectl set image deployment.apps/db db=postgres:{self.db}')

print('Done!')
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ services:
OV_API_URL: http://wagtail

db:
image: postgres:14.2-alpine
image: postgres:14.5-alpine
2 changes: 2 additions & 0 deletions docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ The script can be called with several arguments:
: Backend: `-b VERSION`
: Frontend: `-f VERSION`
: Proxy: `-p VERSION`
: Jumpbox: `-j VERSION`
: db: `-d VERSION`

1. Run command

Expand Down
4 changes: 3 additions & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ The following services are needed to run the stack:
OV_DB_NAME=postgres
OV_DB_USER=postgres

OV_BASE_URL=http://ovfrontend.k8s.wgbhdigital.org
OV_ADMIN_BASE_URL=http://ov-admin.k8s.wgbhdigital.org
OV_TRUSTED_ORIGINS=http://ov-admin.k8s.wgbhdigital.org
OV_ALLOWED_HOSTS=ov-wag
OV_TRUSTED_ORIGINS=http://ov-admin.k8s.wgbhdigital.org/
```

- secrets:
Expand Down
2 changes: 1 addition & 1 deletion ov-frontend
2 changes: 1 addition & 1 deletion ov-wag
71 changes: 43 additions & 28 deletions sync-labels.json
Original file line number Diff line number Diff line change
@@ -1,79 +1,94 @@
[
{
"repositories": [
"WGBH-MLA/ov_deploy",
"WGBH-MLA/ov-deploy",
"WGBH-MLA/ov-wag",
"WGBH-MLA/ov-frontend"
],
"labels": [
{
"previousNames": ["bug"],
"name": "bug :bug:",
"previousNames": ["bug", "bug :bug:"],
"name": "bug 🐛",
"color": "d73a4a"
},
{
"previousNames": ["CD"],
"name": "CD :building_construction:",
"previousNames": ["CD", "CD :building_construction:"],
"name": "CD 🏗️",
"description": "Relating to Continuous Deployment",
"color": "732487"
},
{
"previousNames": ["CI"],
"name": "CI :test_tube:",
"previousNames": ["CI", "CI :test_tube:"],
"name": "CI 🦾",
"description": "Relating to Continuous Integration",
"color": "E09B24"
},
{
"previousNames": ["breaking"],
"name": "breaking :broken_heart:",
"previousNames": ["production"],
"name": "production 🎭",
"description": "Relating to the production deployment",
"color": "772b8d"
},
{
"previousNames": ["test"],
"name": "test 🧪",
"description": "Tests and testing",
"color": "38C5D6"
},
{
"previousNames": ["breaking", "breaking :broken_heart:"],
"name": "breaking 💔",
"description": "Breaking changes",
"color": "BF0212"
},
{
"previousNames": ["documentation"],
"name": "documentation :scroll:",
"previousNames": ["documentation", "documentation :scroll:"],
"name": "documentation 📜",
"color": "0075ca"
},
{
"previousNames": ["duplicate"],
"name": "duplicate :gemini:",
"previousNames": ["duplicate", "duplicate :gemini:"],
"name": "duplicate ",
"color": "cfd3d7"
},
{
"previousNames": ["enhancement"],
"name": "enhancement :heavy_plus_sign:",
"previousNames": ["enhancement", "enhancement :heavy_plus_sign:"],
"name": "enhancement ",
"color": "a2eeef"
},
{
"previousNames": ["good first issue"],
"name": "good first issue :new_moon_with_face:",
"previousNames": [
"good first issue",
"good first issue :new_moon_with_face:"
],
"name": "good first issue 🌚",
"color": "7057ff"
},
{
"previousNames": ["help wanted"],
"name": "help wanted :information_source:",
"previousNames": ["help wanted", "help wanted :information_source:"],
"name": "help wanted ℹ️",
"color": "008672"
},
{
"previousNames": ["invalid"],
"name": "invalid :exclamation:",
"previousNames": ["invalid", "invalid :exclamation:"],
"name": "invalid ",
"color": "e4e669"
},
{
"previousNames": ["maintenance"],
"name": "maintenance :wrench:",
"previousNames": ["maintenance", "maintenance :wrench:"],
"name": "maintenance 🔧",
"description": "Updates and upgrades",
"color": "F87431"
},
{
"previousNames": ["question"],
"name": "question :grey_question:",
"previousNames": ["question", "question :grey_question:"],
"name": "question ",
"color": "d876e3"
},
{
"previousNames": ["wontfix"],
"name": "wontfix :x:",
"color": "ffffff"
"previousNames": ["wontfix", "wontfix :x:"],
"name": "wontfix ✖️",
"color": "000000"
}
]
}
Expand Down
14 changes: 10 additions & 4 deletions sync-milestones.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"repositories": [
"WGBH-MLA/ov_deploy",
"WGBH-MLA/ov-deploy",
"WGBH-MLA/ov-wag",
"WGBH-MLA/ov-frontend"
],
Expand All @@ -15,16 +15,22 @@
{
"previousTitles": ["v0.2.0"],
"title": "v0.2.0 Deploy 🌇",
"state": "open",
"description": "# Deploy\n#### *The self-titled album*\n\nIncludes:\n- [ ] deploy documentation\n- [x] `nginx` image\n- [x] `jumpbox` image",
"description": "# Deploy\n#### *The self-titled album*\n\nIncludes:\n- [x] deploy documentation\n- [x] `nginx` image\n- [x] `jumpbox` image",
"due_on": "2022-08-01T23:59:59Z"
},
{
"previousTitles": ["v0.2.1"],
"title": "v0.2.1 Upgrade 🔨",
"state": "open",
"description": "# Upgrade\nUpgrades to back, front, and deploy\n- [x] Upgrade to Wagtail 4.0\n- [x] Upgrade to Remix 1.7\n- [x] Upgrade to Postgres 14.5\n- [x] Add deploy db\n- [x] Upgrade github labels",
"due_on": "2022-09-02T23:59:59Z"
},
{
"previousTitles": ["v0.3.0"],
"title": "v0.3.0 Collections 🖼️",
"state": "open",
"description": "# Collections\n- [ ] Special Collections\n- [ ] Other Exhibits\n- [ ] Embed images",
"due_on": "2022-09-01T23:59:59Z"
"due_on": "2022-09-16T23:59:59Z"
},
{
"previousTitles": ["v0.4.0"],
Expand Down

0 comments on commit bc7ec62

Please sign in to comment.