Skip to content

Latest commit

 

History

History
153 lines (125 loc) · 4.33 KB

notes.md

File metadata and controls

153 lines (125 loc) · 4.33 KB

Template Builder notes

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.

Yarn

Overwriting updateCommands

Relevant to:

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'
    }

composer create-project platformsh/X

  • Use the namespace platformsh/SOMETHING, preferably where SOMETHING 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)

TypeError: string indices must be integers

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

New templates

  • sylius
  • fastapi
  • prefect.io
  • sulu
  • next-drupal

Auto-updates

Below shows the templates currently included in the auto-update workflow, which runs every 3 days.

  1. nodejs
  2. wordpress-composer
  3. meilisearch
  4. drupal9
  5. django2
  6. nextcloud
  7. gatsby
  8. strapi4
  9. flask
  10. php
  11. django3
  12. python3
  13. python3-uwsgi
  14. pyramid
  15. rails
  16. hugo
  17. backdrop
  18. gin
  19. beego
  20. pelican
  21. nextjs
  22. koa
  23. django4
  24. express
  25. echo
  26. golang
  27. mattermost
  28. wagtail
  29. strapi
  30. wordpress-bedrock
  31. wordpress-woocommerce
  32. nuxtjs
  33. lisp
  34. drupal8
  35. drupal8-opigno
  36. 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)
    1. directus
    2. probot
  • PHP (9)
    • Drupal 8 (1)
      1. drupal8-govcms8
    • WordPress (1)
      1. wordpress-vanilla (EU-3 issue)
    • Other (7)
      1. akeneo
      2. laravel
      3. typo3
      4. magento2ce
      5. pimcore
      6. sculpin
      7. sylius
  • Multi-apps (5)
    1. elastic-apm
    2. eleventy-strapi
    3. gatsby-drupal
    4. gatsby-strapi
    5. gatsby-wordpress

Below have lower priority, or no clear auto-update path as of yet.

  • .NET Core
    1. aspnet-core
  • Java
    1. jenkins
    2. jetty
    3. micronaut
    4. microprofile-helidon
    5. microprofile-kumuluzee
    6. microprofile-openliberty
    7. microprofile-payara
    8. microprofile-thorntail
    9. microprofile-tomee
    10. microprofile-wildfly
    11. quarkus
    12. spring-boot-gradle-mysql
    13. spring-boot-maven-mysql
    14. spring-kotlin
    15. spring-mvc-maven-mongodb
    16. tomcat
    17. xwiki