Skip to content

Commit

Permalink
Release for new header and footer (#1720)
Browse files Browse the repository at this point in the history
Co-authored-by: James Biggs <[email protected]>
Co-authored-by: James Biggs <[email protected]>
Co-authored-by: TNA-Allan <[email protected]>
  • Loading branch information
4 people authored Sep 17, 2024
1 parent 845fae4 commit d1f2c9b
Show file tree
Hide file tree
Showing 74 changed files with 2,934 additions and 999 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-image-name: ${{ vars.DOCKER_IMAGE_NAME }}

update-proof-of-concept:
update-ds-infrastructure-web:
runs-on: ubuntu-latest
needs:
- build
Expand All @@ -59,7 +59,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
repository: nationalarchives/ds-etna-deployments-proof-of-concept
repository: nationalarchives/ds-infrastructure-web
ref: main
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
- name: Set up git config
Expand All @@ -69,10 +69,10 @@ jobs:
- name: Install jq
run: sudo apt-get install jq
- name: Update config
run: jq --indent 4 '(.services.cms.version|="${{ needs.version.outputs.version }}")' config-aws-develop.json > tmp.$$.json && mv tmp.$$.json config-aws-develop.json
run: jq --indent 4 '(.services.cms.version|="${{ needs.version.outputs.version }}")' config/develop.json > tmp.$$.json && mv tmp.$$.json config/develop.json
- name: Push new version
run: |
git add config-aws-develop.json
git add config/develop.json
git commit -m "Update cms to v${{ needs.version.outputs.version }}"
git push origin main
Expand Down
16 changes: 5 additions & 11 deletions .platform.app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ name: app
# to find the supported versions for the 'python' type.
type: 'python:3.12'

dependencies:
python3:
poetry: '1.8.1'

variables:
env:
DJANGO_SETTINGS_MODULE: 'config.settings.platform'
Expand All @@ -18,7 +22,7 @@ variables:
POETRY_VERSION: 1.8.1

# The size of the persistent disk of the application (in MB).
disk: 4096
disk: 4608

# The relationships of the application with services or other applications.
#
Expand All @@ -37,15 +41,6 @@ hooks:
# Download the latest version of pip
python3.12 -m pip install --upgrade pip
# Install and configure Poetry
# Set user to false to install Poetry globally
export PIP_USER=false
curl -sSL https://install.python-poetry.org | python3 - --version $POETRY_VERSION
# Update PATH to make Poetry available in this hook
export PATH="/app/.local/bin:$PATH"
# Set user to true to install dependencies only in the virtual environment
export PIP_USER=true
# Install dependencies
poetry install --only main
Expand All @@ -63,7 +58,6 @@ hooks:
poetry run python manage.py collectstatic --no-input
deploy: |
poetry run python manage.py rename_app authors people
poetry run python manage.py migrate
web:
Expand Down
2 changes: 1 addition & 1 deletion .platform/routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
type: upstream
upstream: "app:http"
cache:
enabled: false
enabled: true
default_ttl: 300
cookies:
- sessionid
Expand Down
5 changes: 4 additions & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"etna.analytics",
"etna.articles",
"etna.people",
"etna.cookies",
"etna.categories",
"etna.ciim",
"etna.collections",
Expand Down Expand Up @@ -80,7 +81,7 @@
"wagtailmedia",
"wagtail.contrib.settings",
"generic_chooser",
"wagtailmetadata",
"wagtailmetadata", # TODO: Remove this package when we reset migrations and remove the dependency from the pyproject.toml
"modelcluster",
"taggit",
"django.contrib.admin",
Expand Down Expand Up @@ -119,6 +120,8 @@

ROOT_URLCONF = "config.urls"

ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "").split(",")

TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
Expand Down
5 changes: 2 additions & 3 deletions config/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@
}

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "@6gce61jt^(pyj5+l**&*_#zyxfj5v1*71cs5yoetg-!fsz826"
SECRET_KEY = "abc123"

# SECURITY WARNING: define the correct hosts in production!
ALLOWED_HOSTS = ["*"]
ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "*").split(",")

EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"

Expand Down
11 changes: 1 addition & 10 deletions config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,10 @@
from .base import * # noqa: F401

# TODO: Temporary until the static files can be served via S3 or a CDN
DEBUG = True
# DEBUG = True

# TODO: Ensure that certificates are always checked by the Client API in production
# CLIENT_VERIFY_CERTIFICATES = True

# TODO: Generate SECRET_KEY
SECRET_KEY = os.getenv("SECRET_KEY", "")
# Need to get the IP of the load balancer or reverse proxy
ALLOWED_HOSTS = ["*"]
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
STATIC_ROOT = "/app/static"

try:
from .local import * # noqa: F401
except ImportError:
pass
2 changes: 1 addition & 1 deletion config/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
pass

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "@6gce61jt^(pyj5+l**&*_#zyxfj5v1*71cs5yoetg-!fsz826"
SECRET_KEY = "abc123"

ALLOWED_HOSTS = ["localhost", "127.0.0.1"]

Expand Down
File renamed without changes.
74 changes: 38 additions & 36 deletions etna/api/tests/expected_results/article.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,48 @@
},
"privacy": "public",
"last_published_at": "2000-01-01T00:00:00Z",
"url": "/article_index/article/"
"url": "/article_index/article/",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 12,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg",
"width": 100,
"height": 68
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp",
"width": 100,
"height": 68
}
},
"teaser_image_square": {
"id": 12,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg",
"width": 100,
"height": 100
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp",
"width": 100,
"height": 100
}
},
"search_image": null,
"twitter_og_title": null,
"twitter_og_description": null,
"twitter_og_image": null
},
"title": "article",
"global_alert": null,
"type_label": "The story of",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 12,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_HJzpFFv.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_HJzpFFv.jpg",
"width": 100,
"height": 68
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_q1PKELE.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_q1PKELE.webp",
"width": 100,
"height": 68
}
},
"teaser_image_square": {
"id": 12,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_dN8zZYf.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_dN8zZYf.jpg",
"width": 100,
"height": 100
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_8zcBeAq.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_8zcBeAq.webp",
"width": 100,
"height": 100
}
},
"facebook_og_image": null,
"twitter_og_image": null,
"mourning_notice": {
"title": "Test title",
"message": "<p>Test message</p>"
Expand Down
74 changes: 38 additions & 36 deletions etna/api/tests/expected_results/article_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,48 @@
},
"privacy": "public",
"last_published_at": "2000-01-01T00:00:00Z",
"url": "/article_index/"
"url": "/article_index/",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 11,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_Qqqrhoo.jpg",
"width": 100,
"height": 68
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_EW7Ow5o.webp",
"width": 100,
"height": 68
}
},
"teaser_image_square": {
"id": 11,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_3mqgkw3.jpg",
"width": 100,
"height": 100
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_iIlAHIz.webp",
"width": 100,
"height": 100
}
},
"search_image": null,
"twitter_og_title": null,
"twitter_og_description": null,
"twitter_og_image": null
},
"title": "article_index",
"global_alert": null,
"type_label": "Article index",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 11,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_4ShM0BL.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_4ShM0BL.jpg",
"width": 100,
"height": 68
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_7hLyRgB.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-60_7hLyRgB.webp",
"width": 100,
"height": 68
}
},
"teaser_image_square": {
"id": 11,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_faOjnDM.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_faOjnDM.jpg",
"width": 100,
"height": 100
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_ppQbvU2.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-60_ppQbvU2.webp",
"width": 100,
"height": 100
}
},
"facebook_og_image": null,
"twitter_og_image": null,
"mourning_notice": {
"title": "Test title",
"message": "<p>Test message</p>"
Expand Down
Loading

0 comments on commit d1f2c9b

Please sign in to comment.