Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Strapi multi-app demo data #566

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,272 changes: 3,272 additions & 0 deletions demos/foodadvisor/foodadvisor.sql

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions demos/foodadvisor/update_demo_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Some vars.
UPDATER_HOME=$(pwd)
TEMPLATES_HOME=$UPDATER_HOME/templates
DEMOS_HOME=$UPDATER_HOME/demos/foodadvisor
DATA_FILE=foodadvisor.sql
DATA_TAR=foodadvisor.tar.gz
# Relevant templates to apply the updates.
templates=(
nextjs-strapi
# eleventy-strapi
# gatsby-strapi
)
# Run the update.
for template in "${templates[@]}"
do
printf "\nUpdating demo data for $template.\n"
# Rebuild the template's `build` directory.
# poetry run doit cleanup:$template
# poetry run doit init:$template
# poetry run doit update:$template
# poetry run doit platformify:$template
# Update the data tar.gz file.
# mkdir $TEMPLATES_HOME/$template/build/api/deploy
# cp $DEMOS_HOME/$DATA_FILE $TEMPLATES_HOME/$template/build/api/deploy
cd $TEMPLATES_HOME/$template/build/api
# # Remove previous tar.gz file.
# rm $DATA_TAR
# # Setup data to zip.
# yarn seed
# Create the file.
# tar -czf $DATA_TAR deploy public/uploads
# # Put it where it will be committed.
# cp $DATA_TAR $TEMPLATES_HOME/$template/files/api
# # Cleanup.
# rm -rf deploy && rm -rf public/uploads
# # Push the updates.
cd $UPDATER_HOME
poetry run doit branch:$template
poetry run doit push:$template
done
2 changes: 1 addition & 1 deletion dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from project.nuxtjs import Nuxtjs
from project.rails import Rails
from project.sculpin import Sculpin
from project.strapi import Strapi
from project.strapi import Strapi, Eleventy_strapi, Nextjs_strapi
from project.sylius import Sylius
from project.symfony import Symfony4, Symfony5
from project.typo3 import Typo3
Expand Down
32 changes: 32 additions & 0 deletions notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,35 @@ Below have lower priority, or no clear auto-update path as of yet.
1. spring-mvc-maven-mongodb
1. tomcat
1. xwiki


## Multi-app investigations

### Strapi variations

**Templates:**

- nextjs-strapi
- eleventy-strapi
- gatsby-strapi

## Drupal variations

**Templates:**

- nextjs-drupal
- gatsby-drupal

## WordPress variations

**Templates:**

- gatsby-wordpress
- frontity-wordpress

## Other

**Templates:**

- elastic-apm

5 changes: 4 additions & 1 deletion project/hugo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from . import BaseProject
import os
import json
import requests

Expand All @@ -8,9 +9,11 @@ class Hugo(BaseProject):
@property
def platformify(self):

headers = {'Authorization': "token {0}".format(os.environ.get("DEVREL_TOKEN"))}

major_version = "0.91"

response = requests.get('https://api.github.com/repos/gohugoio/hugo/releases')
response = requests.get('https://api.github.com/repos/gohugoio/hugo/releases', headers=headers)

tags = [release["tag_name"] for release in response.json() if release["tag_name"].startswith("v{}".format(major_version)) and 'beta' not in release["tag_name"] and 'alpha' not in release["tag_name"]]

Expand Down
112 changes: 112 additions & 0 deletions project/strapi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from . import BaseProject
from .remote import RemoteProject
from collections import OrderedDict
import os
import json
from os.path import exists

class Strapi(BaseProject):

Expand Down Expand Up @@ -40,3 +44,111 @@ class Eleventy_strapi(BaseProject):
updateCommands = {
'package.json': 'yarn upgrade'
}

class MultiAppStrapiDemoBase(RemoteProject):
upstream_branch = "master"
remote = 'https://github.com/strapi/foodadvisor.git'

# Keeps package-lock.json out of repo. See notes.md (Yarn - Overwriting updateCommands) for more details.
updateCommands = {
'package.json': 'yarn upgrade'
}

@property
def update(self):
actions = super(MultiAppStrapiDemoBase, self).update

def unpin_dependency(locked_version):
if '^' not in locked_version:
return '^{}'.format(locked_version)
else:
return locked_version

def strapi_unpin_packagejson():
with open('{0}/api/package.json'.format(self.builddir), 'r') as f:
# The OrderedDict means that the property orders in composer.json will be preserved.
config = json.load(f, object_pairs_hook=OrderedDict)
for dependency in config["dependencies"]:
config["dependencies"][dependency] = unpin_dependency(config["dependencies"][dependency])

with open('{0}/api/package.json'.format(self.builddir), 'w') as out:
json.dump(config, out, indent=2)

def strapi_fix_demo_schema():
# Strapi will produce an error when a collection name in the database is too long, which happens to be
# the case in the demo data provided with Foodadvisor. This block updates the collection name in the
# schema file, which will be updated automatically in the database when the change is detected.
# Issue: https://github.com/strapi/strapi/issues/12101
# Workaround source: https://github.com/iFixit/react-commerce/commit/a0dc38ddc3c09f7908b7230f66296f006ebf4800
schema_file = "{0}api/src/components/blocks/related-restaurants.json".format(self.builddir)
if exists(schema_file):
updated_collection_name = "components_rest_related_rest"
with open(schema_file, "r") as file:
data = json.load(file)
file.close()
data['collectionName'] = updated_collection_name
with open(schema_file, "w") as file:
json.dump(data, file, indent=4)
file.close()

actions.insert(4, (strapi_unpin_packagejson, []))
actions.insert(4, (strapi_fix_demo_schema, []))

return actions + [
# Preserve the upstream README.
'cd {0} && mv README.md README_upstream.md'.format(self.builddir),
# Add the missing local server directory to .gitignore.
'cd {0}/api && printf "\nhttp:/*\n" >> .gitignore'.format(self.builddir),
]

@property
def platformify(self):
return super(MultiAppStrapiDemoBase, self).platformify + [
# Force add the demo data, since tars are ignored by default.
'cd {0} && git add -f api/foodadvisor.tar.gz'.format(self.builddir),
# For now, remove plugins, since submodules fail.
'cd {0} && rm -rf api/src/plugins'.format(self.builddir),
# Add the mysql package.
'cd {0}/api && yarn add mysql'.format(self.builddir),
# Upgrade dependencies once more.
'cd {0}/api && yarn upgrade'.format(self.builddir),
]

class Eleventy_strapi(MultiAppStrapiDemoBase):
upstream_branch = "master"
remote = 'https://github.com/strapi/foodadvisor.git'

@property
def update(self):
return [
# Clear the upstream Next.js client we don't need.
'cd {0} && rm -rf client'.format(self.builddir),
# Clear the current template (remove post-update).
'cd {0} && rm -rf strapi'.format(self.builddir),
'cd {0} && rm -rf eleventy'.format(self.builddir),
'cd {0} && cp README.md README.original.md'.format(self.builddir),
'cd {0} && rm -rf .platform'.format(self.builddir),
# Get eleventy base.
'cd {0} && git clone https://github.com/11ty/eleventy-base-blog.git frontend'.format(self.builddir)
] + super(Eleventy_strapi, self).update

@property
def platformify(self):
return super(Eleventy_strapi, self).platformify + [
# For now, remove the client subdir.
'cd {0} && rm -rf client'.format(self.builddir),
# Rename the files eleventy dir.
'cd {0} && mv eleventy/ client/'.format(self.builddir),
# Add the graphql package.
'cd {0}/api && yarn strapi install graphql'.format(self.builddir),
# Upgrade dependencies once more.
'cd {0}/api && yarn upgrade'.format(self.builddir),
]

# class Gatsby_strapi(MultiAppStrapiDemoBase):
# upstream_branch = "master"
# remote = 'https://github.com/strapi/foodadvisor.git'

class Nextjs_strapi(MultiAppStrapiDemoBase):
upstream_branch = "master"
remote = 'https://github.com/strapi/foodadvisor.git'
36 changes: 36 additions & 0 deletions templates/eleventy-strapi-old/.platform.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 1

info:
id: platformsh/eleventy-strapi
name: Eleventy with Strapi
description: |
<p>This template deploys a two application project on Platform.sh: one for a frontend static site generator, Eleventy, and the other for a backend headless CMS, Strapi. Like our other "decoupled" templates, Eleventy's build is delayed until the <code>post_deploy</code> hook, at which point the backend Strapi content data becomes available to query using GraphQL. That data then is reformatted into "Blogs" on the frontend. Both applications utilize the Platform.sh Configuration Reader library for Node.js. It is intended for you to use as a starting point and modify for your own needs.</p>
<p>Note that there are several setup steps required after the first deploy. An <code>article</code> content type has already been committed, but you will still need to follow the post deploy instructions to add content and define permissions for Eleventy to consume it.</p>
<p>Eleventy is a static site generator written in Node.js, and Strapi is a headless CMS framework also written in Node.js.</p>

tags:
- Node.js
- CMS
- API
- Headless CMS
- Static Site Generator
image: data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzY2NzRfMTU0MTYpIj4KPHBhdGggZD0iTTIxLjAzMiAxNC4xMjlDMjEuMDgyMSAxMy44MDM0IDIxLjEzODcgMTMuNDc5IDIxLjE4MjQgMTMuMTUzNEMyMS40Mzg0IDExLjQyMTUgMjEuNjk0NCA5LjY4ODUxIDIxLjk1NzkgNy45NTg3QzIyLjAzMDQgNy40ODQyMyAyMi4yMTYgNy4xOTU5MiAyMi44MTEyIDcuMjI4OUMyMy4wMjk5IDcuMjQxNjcgMjMuMjUwNyA3LjIyODkgMjMuNDY5MyA3LjIyODlDMjMuODA5NiA3LjIzNTI5IDIzLjk4NjcgNy4zNDM4IDI0LjAwMjcgNy42NzU3MkMyNC4wMTAzIDguMDY4NTEgMjMuOTc0NSA4LjQ2MDk1IDIzLjg5NiA4Ljg0NTk0QzIzLjI3MTYgMTIuMTI2MSAyMi42NDA5IDE1LjQwNDUgMjIuMDAzNyAxOC42ODEyQzIxLjg3NiAxOS40MTEyIDIxLjY3NDggMjAuMTI2NSAyMS40MDMyIDIwLjgxNjNDMjAuODM2OCAyMi4xODMzIDE5LjQzNzMgMjIuMTQ0IDE4LjU3NzYgMjEuNzkyOUMxOC4zODQ2IDIxLjcyNDMgMTguMjE5NCAyMS41OTQ2IDE4LjEwNzIgMjEuNDIzN0MxNy45OTQ5IDIxLjI1MjggMTcuOTQxNyAyMS4wNDk5IDE3Ljk1NTcgMjAuODQ2MUMxNy45NTQgMjAuNTkyMyAxNy45NzExIDIwLjMzODggMTguMDA2OSAyMC4wODc2QzE4LjA4Nj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IyOTcgMy44Nzc3MUM1LjYzMzYzIDMuNDgwOSA1LjgwMzIzIDMuMjg1MTUgNi4xODUxIDMuMTg4MzRMOC45NDEzNiAyLjQ5MTUyQzkuNDQyNjkgMi4zNjQ5MiA5LjcyMzIzIDIuNTY3MDUgOS43NTQxNiAzLjA4MDg5QzkuNzYxNjMgMy4yMDAwNCA5Ljc2MTYzIDMuMzIxMzIgOS43NjE2MyAzLjQ0MDQ3QzkuNzYxNjMgOC4yMzkxMSA5Ljc2MTYzIDEzLjAzNzcgOS43NjE2MyAxNy44MzY0QzkuNzY1MyAxOC4wNjkxIDkuNzQ3NDUgMTguMzAxNiA5LjcwODI5IDE4LjUzMTFDOS42NDEwOSAxOC44OTkyIDkuNDQ0ODMgMTkuMDQ2IDkuMDY4MjkgMTkuMDQ0OUM4LjU3MjI5IDE5LjA0NDkgOC4wNzYzIDE5LjA0NDkgNy41NzQ5NiAxOS4wMzQzQzcuMTg3NzYgMTkuMDI4OSA3LjAwMTEgMTguODc1OCA2LjkzNDk2IDE4LjQ5MzhDNi45MDMyOCAxOC4yODQ0IDYuODg4NjUgMTguMDcyNyA2Ljg5MTIzIDE3Ljg2MDhDNi44OTEyMyAxMy44OTcgNi44OTEyMyA5LjkzMjM5IDYuODkxMjMgNS45NjcwOUw2Ljg5ODcgNS42ODUxOFoiIGZpbGw9ImJsYWNrIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDBfNjY3NF8xNTQxNiI+CjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K
notes:
- heading: "Features"
content: |
Node.js 12 & 14<br />
PostgreSQL 12<br />
Automatic TLS certificates<br />
yarn-based build<br />
Multi-app configuration<br />
Delayed SSG build (post deploy hook)<br />

plans:
exclude:
- small

initialize:
repository: https://github.com/platformsh-templates/eleventy-strapi.git@master
config: null
files: []
profile: Eleventy with Strapi
21 changes: 21 additions & 0 deletions templates/eleventy-strapi-old/files/.platform/routes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# The routes of the project.
#
# Each route describes how an incoming URL is going
# to be processed by Platform.sh.

"https://www.{default}/":
type: upstream
upstream: "eleventy:http"

"https://{default}/":
type: redirect
to: "https://www.{default}/"

"https://www.backend.{default}/":
type: upstream
id: strapi
upstream: "strapi:http"

"https://backend.{default}/":
type: redirect
to: "https://www.backend.{default}/"
8 changes: 8 additions & 0 deletions templates/eleventy-strapi-old/files/.platform/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# The services of the project.
#
# Each service listed will be deployed
# to power your Platform.sh project.

dbpostgres:
type: postgresql:12
disk: 256
Loading