This file contains more detailed information about the way template-builder
functions when defining templates as a project
- that is, a BaseProject
or RemoteProject
. For example, multiple template projects will deviate from how the update
task is used that is better noted here than written on each of their project scripts.
Relevant to:
- Gatsby (
project/gatsby.py
)- Next.js (
project/nextjs.py
)- Strapi (
project/strapi.py
)
The BaseProject
update
task will loop through a list of updateCommands
for a number of different package managers and run them if their respective depedency files (i.e. package.json
) are present.
Node.js has two popular package mangers - npm and Yarn. Both use package.json
to define dependencies, but resolve to different lock files (package-lock.json
& yarn.lock
). When deployed, we'll only be using one of them, and it's generally recommended to not have lock files from both package managers present in the same repo.
Because update
loops through updateCommands
, simply adding an upgrade command for Yarn to BaseProject
would result in that exact situation we'd like to avoid: both npm update
and yarn upgrade
will be run, resulting in two lock files. So, updateCommands
is redefined here for a few templates to prioritize Yarn and avoid it altogether:
from . import BaseProject
class Template(BaseProject):
updateCommands = {
'package.json': 'yarn upgrade'
}
- Use the namespace
platformsh/SOMETHING
, preferably whereSOMETHING
matches the upstream name. - Merge into the default branch
- Register the repo on packagist.
- add the
push
event webhook to the GitHub repo settings. Update
the package on packagist.- With no releases on the template repo, the final command will be
composer create-project platformsh/XXX -s dev
(the-s dev
is necessary without releases on the repo)
There are a few Remote
type templates that retrieve the latest upstream tag with a call to https://api.github.com
(see project/hugo.py
for an example). This error simply means that you have exceeded GitHub's unauthenticated request limit.
Every template where this call needs to take place has an authentication path. All you need to resume your work is retrieve a GitHub API token, and then set it in your terminal:
$ export GITHUB_TOKEN=XXXXXXXXXXXXXXXXXXXXXXX
- sylius
- fastapi
- prefect.io
- sulu
- next-drupal
Below shows the templates currently included in the auto-update workflow, which runs every 3 days.
- nodejs
- wordpress-composer
- meilisearch
- drupal9
- django2
- nextcloud
- gatsby
- strapi4
- flask
- php
- django3
- python3
- python3-uwsgi
- pyramid
- rails
- hugo
- backdrop
- gin
- beego
- pelican
- nextjs
- koa
- django4
- express
- echo
- golang
- mattermost
- wagtail
- strapi
- wordpress-bedrock
- wordpress-woocommerce
- nuxtjs
- lisp
- drupal8
- drupal8-opigno
- drupal8-multisite
Below are those templates that will still need to be integrated.
- Total in workflow: 36
- Left (excluding multi-app): 11 (36/47)
- Left (including multi-app): 16 (36/52)
- Node.js (2)
- directus
- probot
- PHP (9)
- Drupal 8 (1)
- drupal8-govcms8
- WordPress (1)
- wordpress-vanilla (EU-3 issue)
- Other (7)
- akeneo
- laravel
- typo3
- magento2ce
- pimcore
- sculpin
- sylius
- Drupal 8 (1)
- Multi-apps (5)
- elastic-apm
- eleventy-strapi
- gatsby-drupal
- gatsby-strapi
- gatsby-wordpress
Below have lower priority, or no clear auto-update path as of yet.
- .NET Core
- aspnet-core
- Java
- jenkins
- jetty
- micronaut
- microprofile-helidon
- microprofile-kumuluzee
- microprofile-openliberty
- microprofile-payara
- microprofile-thorntail
- microprofile-tomee
- microprofile-wildfly
- quarkus
- spring-boot-gradle-mysql
- spring-boot-maven-mysql
- spring-kotlin
- spring-mvc-maven-mongodb
- tomcat
- xwiki