diff --git a/.github/workflows/updates.yaml b/.github/workflows/updates.yaml index d11512efc..76b2d9322 100644 --- a/.github/workflows/updates.yaml +++ b/.github/workflows/updates.yaml @@ -4,8 +4,8 @@ name: "Updates" on: schedule: - cron: "0 1 */3 * *" # At 01:00 on every 3rd day-of-month. -# push: -# branches: 'pipenv-fix' + # push: + # branches: 'drupals' env: # Update vars. @@ -91,7 +91,7 @@ jobs: template: ${{fromJSON(needs.build.outputs.templates)}} exclude: # PHP - - template: "drupal8-govcms8" + # - template: "drupal8-govcms8" - template: "magento2ce" - template: "pimcore" - template: "laravel" @@ -139,44 +139,47 @@ jobs: ################################ # Working excludes for testing # ################################ -# - template: nuxtjs -# - template: lisp -# - template: 'wordpress-woocommerce' -# - template: 'wordpress-bedrock' -# - template: wagtail -# - template: strapi -# - template: mattermost -# - template: golang -# - template: nodejs -# - template: wordpress-composer -# - template: meilisearch -# - template: drupal9 -# - template: 'drupal8-multisite' -# - template: 'drupal8' -# - template: django2 -# - template: nextcloud -# - template: gatsby -# - template: strapi4 -# - template: flask -# - template: php -# - template: django3 -# - template: python3 -# - template: python3-uwsgi -# - template: pyramid -# - template: rails -# - template: hugo -# - template: backdrop -# - template: gin -# - template: beego -# - template: pelican -# - template: probot -# - template: nextjs -# - template: koa -# - template: django4 -# - template: express -# - template: echo -# - template: fastapi -# - template: 'drupal8-opigno' + # - template: contentacms + # - template: koa + # - template: wagtail + # - template: backdrop + # - template: drupal8 + # - template: wordpress-bedrock + # - template: wordpress-composer + # - template: django2 + # - template: rails + # - template: echo + # - template: beego + # - template: nodejs + # - template: django4 + # - template: nuxtjs + # - template: drupal8-opigno + # - template: nextcloud + # - template: drupal9-multisite + # - template: mattermost + # - template: gatsby + # - template: hugo + # - template: drupal8-multisite + # - template: php + # - template: django3 + # - template: lisp + # - template: wordpress-woocommerce + # - template: golang + # - template: express + # - template: strapi4 + # - template: python3-uwsgi + # - template: python3 + # - template: nextjs + # - template: meilisearch + # - template: drupal9 + # - template: flask + # - template: fastapi + # - template: pyramid + # - template: contentacms + # - template: gin + # - template: pelican + + steps: # Before beginning we need set up all our tools and dependencies diff --git a/common/.preload/preloader.php b/common/.preload/preloader.php new file mode 100644 index 000000000..ccd8ff002 --- /dev/null +++ b/common/.preload/preloader.php @@ -0,0 +1,248 @@ +paths = $paths; + } + + /** + * Paths + * + * Path to load + * + * @param string $paths + * + * @return $this + */ + public function paths(string ...$paths): void + { + $this->paths = \array_merge( + $this->paths, + $paths + ); + } + + /** + * Ignore + * + * Ignore a given path or file + * + * @param string $names + * + * @return $this + */ + public function ignore(string ...$names): void + { + foreach ($names as $name) { + if (true === is_readable($name)) { + $this->ignores[] = $name; + } else { + if (true === $this->debug) { + echo sprintf('Preloader] Failed to ignore path %s', $name).PHP_EOL; + } + } + } + } + + /** + * Preload + */ + public function preload(): void + { + $this->loaded = get_included_files(); + foreach ($this->paths as $path) { + $path = \rtrim($path, '/'); + $this->loadPath($path); + } + if (true === $this->debug) { + echo sprintf('[Preloader] Preloaded: %s files', $this->count).PHP_EOL; + } + } + + /** + * Get Count + * + * Get the total number of loaded files. + * + * @return int + */ + public function getCount(): int + { + return $this->count; + } + + /** + * Get List + * + * @return array + */ + public function getList(): array + { + return $this->included; + } + + /** + * Set Debug + * + * @param bool $flag + */ + public function setDebug(bool $flag = true): void + { + $this->debug = $flag; + } + + /** + * Load Path + * + * Load a specific file or folder and nested folders. + * + * @param string $path + * @return void + */ + private function loadPath(string $path): void + { + if (true === \is_dir($path)) { + $this->loadDir($path); + return; + } + $this->loadFile($path); + } + + /** + * Load Directory + * + * Load a specific folder and nested folders. + * + * @param string $path + * @return void + */ + private function loadDir(string $path): void + { + $handle = \opendir($path); + while ($file = \readdir($handle)) { + if (true === \in_array($file, ['.', '..'])) { + continue; + } + $this->loadPath("{$path}/{$file}"); + } + \closedir($handle); + } + + /** + * Load File + * + * Load a specific file. + * + * @param string $path + * @return void + */ + private function loadFile(string $path): void + { + if (true === $this->shouldIgnore($path)) { + return; + } + if (true === \in_array(\realpath($path), $this->included)) { + if (true === $this->debug) { + echo sprintf('[Preloader] Skipped: %s', $path).PHP_EOL; + } + return; + } + if (true === \in_array(\realpath($path), $this->loaded)) { + if (true === $this->debug) { + echo sprintf('[Preloader] Skipped: %s', $path).PHP_EOL; + } + return; + } + try { + require $path; + } catch (\Throwable $th) { + if (true === $this->debug) { + echo sprintf('[[Preloader] Failed to load: %s, Error Message: %s', $path, $th->getMessage()).PHP_EOL; + } + return; + } + $this->loaded = get_included_files(); + $this->included[] = $path; + $this->count++; + } + + /** + * Should Ignore + * + * Should a given path be ignored or not? + * + * @param string $path + * @return bool + */ + private function shouldIgnore(?string $path): bool + { + if ($path === null) { + return true; + } + $pathExtension = \pathinfo($path, PATHINFO_EXTENSION); + if (false === \in_array($pathExtension, ['php']) || 'html.php' == substr($path, -8) || 'tpl.php' == substr($path, -7)) { + return true; + } + foreach ($this->ignores as $ignore) { + if (\strpos($path, $ignore) === 0) { + return true; + } + } + return false; + } +} + +$vendorDirectory = __DIR__.'/vendor/'; +$vendorAutoloadFile = sprintf('%s/autoload.php', \rtrim($vendorDirectory, '/')); +if (true === file_exists($vendorAutoloadFile)) { + require $vendorAutoloadFile; +} + +$clpPreloader = new ClpPreloader(); +$clpPreloader->setDebug(false); +$clpPreloader->paths(realpath(__DIR__ . '/src')); +$clpPreloader->paths(realpath(__DIR__ . '/vendor')); +$clpPreloader->ignore(realpath(__DIR__ . '/vendor/twig/twig')); +$clpPreloader->preload(); diff --git a/common/all/.github/ISSUE_TEMPLATE/bug_report.yaml b/common/all/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 000000000..604f31cd2 --- /dev/null +++ b/common/all/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,72 @@ +name: Bug report +description: If you've found a problem with the template, let us know so that we can update it for everyone. +labels: + - 'bug' +body: + - type: markdown + attributes: + value: | + Thanks for your interest in helping improve the Platform.sh templates! + Please fill in the fields below so we can understand what's going wrong. + + - type: textarea + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is. + placeholder: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum eleifend diam non condimentum tincidunt. Vestibulum convallis eget ante dapibus eleifend. + validations: + required: true + + - type: textarea + attributes: + label: Include some logs + description: Any logs you can include will help us investigate the issue. + placeholder: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum eleifend diam non condimentum tincidunt. Vestibulum convallis eget ante dapibus eleifend. + validations: + required: true + + - type: textarea + attributes: + label: Reproducing + description: Help us reproduce what you're seeing. + placeholder: | + Steps to reproduce the behavior: + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error + validations: + required: true + + - type: textarea + attributes: + label: Expected behavior + description: A clear and concise description of what you expected to happen. + placeholder: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum eleifend diam non condimentum tincidunt. Vestibulum convallis eget ante dapibus eleifend. + validations: + required: true + + - type: textarea + attributes: + label: Your environment + description: Give us as many details as you can about your environment, whether that's on Platform.sh (your configuration YAMLs), or locally (your OS, services, and local development tool). + placeholder: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum eleifend diam non condimentum tincidunt. Vestibulum convallis eget ante dapibus eleifend. + validations: + required: true + + - type: textarea + attributes: + label: Screenshots + description: If applicable, add screenshots to help explain your problem. + placeholder: A picture's worth a thousand words... + validations: + required: false + + - type: textarea + attributes: + label: Additional context + description: Optionally add any other information or screenshots that could help us understand and implement the change. + placeholder: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum eleifend diam non condimentum tincidunt. Vestibulum convallis eget ante dapibus eleifend. + validations: + required: false + \ No newline at end of file diff --git a/common/all/.github/ISSUE_TEMPLATE/config.yaml b/common/all/.github/ISSUE_TEMPLATE/config.yaml new file mode 100644 index 000000000..6391f6f4d --- /dev/null +++ b/common/all/.github/ISSUE_TEMPLATE/config.yaml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Community Support + url: https://community.platform.sh/ + about: Please ask and answer questions here. + - name: Join us on Slack + url: https://chat.platform.sh/ + about: Ping the `@devrel_team`! diff --git a/common/all/.github/ISSUE_TEMPLATE/improvements.yaml b/common/all/.github/ISSUE_TEMPLATE/improvements.yaml new file mode 100644 index 000000000..0ba3aa5cd --- /dev/null +++ b/common/all/.github/ISSUE_TEMPLATE/improvements.yaml @@ -0,0 +1,41 @@ +name: Feature request +description: For changes to improve this template. +labels: + - 'feature request' +body: + - type: markdown + attributes: + value: | + Thanks for your interest in helping improve the Platform.sh templates! + Please fill in the fields below so we can understand what changes you'd like to see. + + - type: textarea + attributes: + label: What in this template can be improved or added as a feature? + description: Is your feature request related to a problem? Please describe. + placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + validations: + required: true + + - type: textarea + attributes: + label: What exactly should be updated? + description: | + - Share as much detail as you can to help us understand the suggestion. + - What do you expect as an outcome? + validations: + required: true + + - type: textarea + attributes: + label: How important is this feature to you? + description: Does this template lacking this feature block your work? + validations: + required: true + + - type: textarea + attributes: + label: Additional context + description: Optionally add any other information or screenshots that could help us understand and implement the change. + validations: + required: false diff --git a/common/all/.github/PULL_REQUEST_TEMPLATE.md b/common/all/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..b41bea1c8 --- /dev/null +++ b/common/all/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,34 @@ +## Description +Please describe your changes in detail according to the information below + +## Related Issue +This project only accepts pull requests related to open issues. +- If suggesting a new feature or change, please discuss it in an issue first +- If fixing a bug, there should be an issue describing it with steps to reproduce it following the bug report guide +- If you're suggesting a feature, please follow the feature request guide by clicking on issues + +### Please drop a link to the issue here: + +## Motivation and Context +Why is this change required? What problem does it solve? + +## How Has This Been Tested? +Please describe in detail how you tested your changes. Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc. + +## Screenshots (if appropriate): + +## Types of changes +What types of changes does your code introduce? Put an `x` in all the boxes that apply: + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) + +## Checklist: + Go over all the following list, and put an `x` in all the boxes that apply. If you're unsure about what any of these mean, don't hesitate to ask. We're here to help! + +- [ ] I have read the contribution guide +- [ ] I have created an issue following the issue guide +- [ ] My code follows the code style of this project. +- [ ] My change requires a change to the documentation. +- [ ] I have updated the documentation accordingly. diff --git a/common/drupal8/.blackfire.yml b/common/drupal8/.blackfire.yml new file mode 100644 index 000000000..2d3acb471 --- /dev/null +++ b/common/drupal8/.blackfire.yml @@ -0,0 +1,81 @@ +tests: + 'The homepage should be fast': + path: + - '/' + assertions: + - 'main.wall_time <= 250ms' + 'Some Composer dependencies have known security issues and should be upgraded': + path: + - '/.*' + assertions: + - { expression: 'not has_vulnerable_dependencies()' } + '"assert.active" is a dev_only feature and should be disabled in production': + path: + - '/.*' + assertions: + - { expression: 'runtime.configuration.assert_active === false' } + '"display_errors" should be disabled': + path: + - '/.*' + assertions: + - { expression: 'not is_configuration_enabled("display_errors")' } + '"display_startup_errors" should not be enabled': + path: + - '/.*' + assertions: + - { expression: 'not is_configuration_enabled("display_startup_errors")' } + '"max_execution_time" should be less than 30 seconds for Web requests': + path: + - '/.*' + assertions: + - { expression: 'runtime.configuration.max_execution_time <= 30' } + '"session.use_strict_mode" should be enabled': + path: + - '/.*' + assertions: + - { expression: 'runtime.configuration.session_use_strict_mode === true' } + '"zend.detect_unicode" should be disabled as BOMs are not portable': + path: + - '/.*' + assertions: + - { expression: 'runtime.configuration.zend_detect_unicode === false' } + 'The realpath cache ttl should be more than one hour in production': + path: + - '/.*' + assertions: + - { expression: 'runtime.configuration.realpath_cache_ttl >= 3600' } + 'The session garbage collector should be disabled in production': + path: + - '/.*' + assertions: + - { expression: 'runtime.configuration.session_gc_probability === 0' } + +scenarios: | + #!blackfire-player + + name "Drupal Scenarios" + + group homepages + visit url("/") + name "Homepage (English)" + expect status_code() == 200 + visit url("/es") + name "Homepage (Español)" + expect status_code() == 200 + + group articles + visit url("/en/articles") + name "Articles" + expect status_code() == 200 + + group admin_anonymous + visit url("/en/admin/content") + expect status_code() == 403 + visit url("/en/admin/structure") + expect status_code() == 403 + + scenario + name "Anonymous Visit" + include homepages + include articles + include admin_anonymous diff --git a/common/drupal8/.ddev/config.yaml b/common/drupal8/.ddev/config.yaml new file mode 100644 index 000000000..0bd50b1f5 --- /dev/null +++ b/common/drupal8/.ddev/config.yaml @@ -0,0 +1,207 @@ +name: api +type: drupal8 +docroot: web +php_version: "7.4" +webserver_type: nginx-fpm +router_http_port: "8000" +router_https_port: "8443" +xdebug_enabled: false +additional_hostnames: [] +additional_fqdns: [] +database: + type: mariadb + version: "10.3" +nfs_mount_enabled: false +mutagen_enabled: false +use_dns_when_possible: true +composer_version: "2" +web_environment: [] +nodejs_version: "16" + +# Key features of ddev's config.yaml: + +# name: # Name of the project, automatically provides +# http://projectname.ddev.site and https://projectname.ddev.site + +# type: # drupal6/7/8, backdrop, typo3, wordpress, php + +# docroot: # Relative path to the directory containing index.php. + +# php_version: "7.4" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1" + +# You can explicitly specify the webimage but this +# is not recommended, as the images are often closely tied to ddev's' behavior, +# so this can break upgrades. + +# webimage: # nginx/php docker image. + +# database: +# type: # mysql, mariadb +# version: # database version, like "10.3" or "8.0" +# Note that mariadb_version or mysql_version from v1.18 and earlier +# will automatically be converted to this notation with just a "ddev config --auto" + +# router_http_port: # Port to be used for http (defaults to port 80) +# router_https_port: # Port for https (defaults to 443) + +# xdebug_enabled: false # Set to true to enable xdebug and "ddev start" or "ddev restart" +# Note that for most people the commands +# "ddev xdebug" to enable xdebug and "ddev xdebug off" to disable it work better, +# as leaving xdebug enabled all the time is a big performance hit. + +# xhprof_enabled: false # Set to true to enable xhprof and "ddev start" or "ddev restart" +# Note that for most people the commands +# "ddev xhprof" to enable xhprof and "ddev xhprof off" to disable it work better, +# as leaving xhprof enabled all the time is a big performance hit. + +# webserver_type: nginx-fpm # or apache-fpm + +# timezone: Europe/Berlin +# This is the timezone used in the containers and by PHP; +# it can be set to any valid timezone, +# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +# For example Europe/Dublin or MST7MDT + +# composer_root: +# Relative path to the composer root directory from the project root. This is +# the directory which contains the composer.json and where all Composer related +# commands are executed. + +# composer_version: "2" +# if composer_version:"2" it will use the most recent composer v2 +# It can also be set to "1", to get most recent composer v1 +# or "" for the default v2 created at release time. +# It can be set to any existing specific composer version. +# After first project 'ddev start' this will not be updated until it changes + +# nodejs_version: "16" +# change from the default system Node.js version to another supported version, like 12, 14, 17. +# Note that you can use 'ddev nvm' or nvm inside the web container to provide nearly any +# Node.js version, including v6, etc. + +# additional_hostnames: +# - somename +# - someothername +# would provide http and https URLs for "somename.ddev.site" +# and "someothername.ddev.site". + +# additional_fqdns: +# - example.com +# - sub1.example.com +# would provide http and https URLs for "example.com" and "sub1.example.com" +# Please take care with this because it can cause great confusion. + +# upload_dir: custom/upload/dir +# would set the destination path for ddev import-files to /custom/upload/dir + +# working_dir: +# web: /var/www/html +# db: /home +# would set the default working directory for the web and db services. +# These values specify the destination directory for ddev ssh and the +# directory in which commands passed into ddev exec are run. + +# omit_containers: [db, dba, ddev-ssh-agent] +# Currently only these containers are supported. Some containers can also be +# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit +# the "db" container, several standard features of ddev that access the +# database container will be unusable. In the global configuration it is also +# possible to omit ddev-router, but not here. + +# nfs_mount_enabled: false +# Great performance improvement but requires host configuration first. +# See https://ddev.readthedocs.io/en/stable/users/performance/#using-nfs-to-mount-the-project-into-the-container + +# mutagen_enabled: false +# Experimental performance improvement using mutagen asynchronous updates. +# See https://ddev.readthedocs.io/en/latest/users/performance/#using-mutagen + +# fail_on_hook_fail: False +# Decide whether 'ddev start' should be interrupted by a failing hook + +# host_https_port: "59002" +# The host port binding for https can be explicitly specified. It is +# dynamic unless otherwise specified. +# This is not used by most people, most people use the *router* instead +# of the localhost port. + +# host_webserver_port: "59001" +# The host port binding for the ddev-webserver can be explicitly specified. It is +# dynamic unless otherwise specified. +# This is not used by most people, most people use the *router* instead +# of the localhost port. + +# host_db_port: "59002" +# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic +# unless explicitly specified. + +# phpmyadmin_port: "8036" +# phpmyadmin_https_port: "8037" +# The PHPMyAdmin ports can be changed from the default 8036 and 8037 + +# host_phpmyadmin_port: "8036" +# The phpmyadmin (dba) port is not normally bound on the host at all, instead being routed +# through ddev-router, but it can be specified and bound. + +# mailhog_port: "8025" +# mailhog_https_port: "8026" +# The MailHog ports can be changed from the default 8025 and 8026 + +# host_mailhog_port: "8025" +# The mailhog port is not normally bound on the host at all, instead being routed +# through ddev-router, but it can be bound directly to localhost if specified here. + +# webimage_extra_packages: [php7.4-tidy, php-bcmath] +# Extra Debian packages that are needed in the webimage can be added here + +# dbimage_extra_packages: [telnet,netcat] +# Extra Debian packages that are needed in the dbimage can be added here + +# use_dns_when_possible: true +# If the host has internet access and the domain configured can +# successfully be looked up, DNS will be used for hostname resolution +# instead of editing /etc/hosts +# Defaults to true + +# project_tld: ddev.site +# The top-level domain used for project URLs +# The default "ddev.site" allows DNS lookup via a wildcard +# If you prefer you can change this to "ddev.local" to preserve +# pre-v1.9 behavior. + +# ngrok_args: --subdomain mysite --auth username:pass +# Provide extra flags to the "ngrok http" command, see +# https://ngrok.com/docs#http or run "ngrok http -h" + +# disable_settings_management: false +# If true, ddev will not create CMS-specific settings files like +# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php +# In this case the user must provide all such settings. + +# You can inject environment variables into the web container with: +# web_environment: +# - SOMEENV=somevalue +# - SOMEOTHERENV=someothervalue + +# no_project_mount: false +# (Experimental) If true, ddev will not mount the project into the web container; +# the user is responsible for mounting it manually or via a script. +# This is to enable experimentation with alternate file mounting strategies. +# For advanced users only! + +# bind_all_interfaces: false +# If true, host ports will be bound on all network interfaces, +# not just the localhost interface. This means that ports +# will be available on the local network if the host firewall +# allows it. + +# Many ddev commands can be extended to run tasks before or after the +# ddev command is executed, for example "post-start", "post-import-db", +# "pre-composer", "post-composer" +# See https://ddev.readthedocs.io/en/stable/users/extending-commands/ for more +# information on the commands that can be extended and the tasks you can define +# for them. Example: +#hooks: +# post-import-db: +# - exec: drush cr +# - exec: drush updb diff --git a/common/drupal8/.ddev/providers/platform.yaml b/common/drupal8/.ddev/providers/platform.yaml new file mode 100755 index 000000000..19ce7501c --- /dev/null +++ b/common/drupal8/.ddev/providers/platform.yaml @@ -0,0 +1,63 @@ +#ddev-generated +# Example Platform.sh provider configuration. + +# To use this configuration, + +# 1. Check out the site from platform.sh and then configure it with `ddev config`. You'll want to use `ddev start` and make sure the basic functionality is working. +# 2. Obtain and configure an API token. +# a. Login to the Platform.sh Dashboard and go to Account->API Tokens to create an API token for ddev to use. +# b. Add the API token to the `web_environment` section in your global ddev configuration at ~/.ddev/global_config.yaml: +# ```yaml +# web_environment: +# - PLATFORMSH_CLI_TOKEN=abcdeyourtoken +# ``` +# 3. `ddev restart` +# 4. Obtain your project id with `ddev exec platform`. The platform tool should show you all the information about your account and project. +# 5. In your project's .ddev/providers directory, copy platform.yaml.example to platform.yaml and edit the `project_id` and `environment_name`. +# 6. Run `ddev pull platform`. After you agree to the prompt, the current upstream database and files will be downloaded. +# 7. Optionally use `ddev push platform` to push local files and database to platform.sh. Note that `ddev push` is a command that can potentially damage your production site, so this is not recommended. + +# Debugging: Use `ddev exec platform` to see what platform.sh knows about +# your configuration and whether it's working correctly. + +environment_variables: + project_id: yourproject + environment: main + application: drupal + +auth_command: + command: | + set -eu -o pipefail + if [ -z "${PLATFORMSH_CLI_TOKEN:-}" ]; then echo "Please make sure you have set PLATFORMSH_CLI_TOKEN in ~/.ddev/global_config.yaml" && exit 1; fi + +db_pull_command: + command: | + set -x # You can enable bash debugging output by uncommenting + set -eu -o pipefail + ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible + platform db:dump --yes --gzip --file=/var/www/html/.ddev/.downloads/db.sql.gz --project="${project_id}" --environment="${environment}" --app="${application}" + +files_pull_command: + command: | + set -x # You can enable bash debugging output by uncommenting + set -eu -o pipefail + ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible + platform mount:download --yes --quiet --project="${project_id}" --environment="${environment}" --app="${application}" --mount=web/sites/default/files --target=/var/www/html/.ddev/.downloads/files + + +# push is a dangerous command. If not absolutely needed it's better to delete these lines. +db_push_command: + command: | + set -x # You can enable bash debugging output by uncommenting + set -eu -o pipefail + ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible + pushd /var/www/html/.ddev/.downloads >/dev/null; + gzip -dc db.sql.gz | platform db:sql --project="${project_id}" --environment="${environment}" + +# push is a dangerous command. If not absolutely needed it's better to delete these lines. +files_push_command: + command: | + set -x # You can enable bash debugging output by uncommenting + set -eu -o pipefail + ls "${DDEV_FILES_DIR}" >/dev/null # This just refreshes stale NFS if possible + platform mount:upload --yes --quiet --project="${project_id}" --environment="${environment}" --source="${DDEV_FILES_DIR}" --mount=web/sites/default/files diff --git a/common/drupal8/.lando.upstream.yml b/common/drupal8/.lando.upstream.yml new file mode 100644 index 000000000..ff6d2fcdf --- /dev/null +++ b/common/drupal8/.lando.upstream.yml @@ -0,0 +1,32 @@ +# This file sets some good defaults for local development using this Platform.sh +# template with Lando. +# +# Note that you should not edit this file so it can continue to receive upstream +# updates. If you wish to change the values below then override them in your +# normal .lando.yml. + +# These both allow you to test this template without needing a site on Platform.sh +# However you will want to replace them in your .lando.yml +name: platformsh-drupal8 +recipe: platformsh + +config: + + # This section overrides Platform.sh configuration with values that make more + # sense for local development. + # + # Note that "app" is the name of the application defined in your + # .platform.app.yaml or applications.yaml. + overrides: + app: + variables: + d8config: + "system.file:path:temporary": "/tmp" + d8settings: + "skip_permissions_hardening": 1 + + +# These are tools that are commonly used during development for this template. +tooling: + drush: + service: app diff --git a/common/drupal8/php.ini b/common/drupal8/php.ini new file mode 100644 index 000000000..b731f3112 --- /dev/null +++ b/common/drupal8/php.ini @@ -0,0 +1,14 @@ +assert.active = Off +display_errors = Off +display_startup_errors = Off +max_execution_time = 30 +session.use_strict_mode = On +zend.detect_unicode = Off +opcache.memory_consumption = 128 +opcache.interned_strings_buffer = 8 +opcache.max_accelerated_files = 4000 +opcache.revalidate_freq = 60 +opcache.fast_shutdown = 1 +opcache.enable_cli = 1 +realpath_cache_ttl = 3600 +session.gc_probability = 0 diff --git a/common/drupal9/.blackfire.yml b/common/drupal9/.blackfire.yml new file mode 100644 index 000000000..2d3acb471 --- /dev/null +++ b/common/drupal9/.blackfire.yml @@ -0,0 +1,81 @@ +tests: + 'The homepage should be fast': + path: + - '/' + assertions: + - 'main.wall_time <= 250ms' + 'Some Composer dependencies have known security issues and should be upgraded': + path: + - '/.*' + assertions: + - { expression: 'not has_vulnerable_dependencies()' } + '"assert.active" is a dev_only feature and should be disabled in production': + path: + - '/.*' + assertions: + - { expression: 'runtime.configuration.assert_active === false' } + '"display_errors" should be disabled': + path: + - '/.*' + assertions: + - { expression: 'not is_configuration_enabled("display_errors")' } + '"display_startup_errors" should not be enabled': + path: + - '/.*' + assertions: + - { expression: 'not is_configuration_enabled("display_startup_errors")' } + '"max_execution_time" should be less than 30 seconds for Web requests': + path: + - '/.*' + assertions: + - { expression: 'runtime.configuration.max_execution_time <= 30' } + '"session.use_strict_mode" should be enabled': + path: + - '/.*' + assertions: + - { expression: 'runtime.configuration.session_use_strict_mode === true' } + '"zend.detect_unicode" should be disabled as BOMs are not portable': + path: + - '/.*' + assertions: + - { expression: 'runtime.configuration.zend_detect_unicode === false' } + 'The realpath cache ttl should be more than one hour in production': + path: + - '/.*' + assertions: + - { expression: 'runtime.configuration.realpath_cache_ttl >= 3600' } + 'The session garbage collector should be disabled in production': + path: + - '/.*' + assertions: + - { expression: 'runtime.configuration.session_gc_probability === 0' } + +scenarios: | + #!blackfire-player + + name "Drupal Scenarios" + + group homepages + visit url("/") + name "Homepage (English)" + expect status_code() == 200 + visit url("/es") + name "Homepage (Español)" + expect status_code() == 200 + + group articles + visit url("/en/articles") + name "Articles" + expect status_code() == 200 + + group admin_anonymous + visit url("/en/admin/content") + expect status_code() == 403 + visit url("/en/admin/structure") + expect status_code() == 403 + + scenario + name "Anonymous Visit" + include homepages + include articles + include admin_anonymous diff --git a/common/drupal9/.ddev/config.yaml b/common/drupal9/.ddev/config.yaml new file mode 100644 index 000000000..62e93338b --- /dev/null +++ b/common/drupal9/.ddev/config.yaml @@ -0,0 +1,207 @@ +name: api +type: drupal9 +docroot: web +php_version: "8.0" +webserver_type: nginx-fpm +router_http_port: "8000" +router_https_port: "8443" +xdebug_enabled: false +additional_hostnames: [] +additional_fqdns: [] +database: + type: mariadb + version: "10.3" +nfs_mount_enabled: false +mutagen_enabled: false +use_dns_when_possible: true +composer_version: "2" +web_environment: [] +nodejs_version: "16" + +# Key features of ddev's config.yaml: + +# name: # Name of the project, automatically provides +# http://projectname.ddev.site and https://projectname.ddev.site + +# type: # drupal6/7/8, backdrop, typo3, wordpress, php + +# docroot: # Relative path to the directory containing index.php. + +# php_version: "7.4" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1" + +# You can explicitly specify the webimage but this +# is not recommended, as the images are often closely tied to ddev's' behavior, +# so this can break upgrades. + +# webimage: # nginx/php docker image. + +# database: +# type: # mysql, mariadb +# version: # database version, like "10.3" or "8.0" +# Note that mariadb_version or mysql_version from v1.18 and earlier +# will automatically be converted to this notation with just a "ddev config --auto" + +# router_http_port: # Port to be used for http (defaults to port 80) +# router_https_port: # Port for https (defaults to 443) + +# xdebug_enabled: false # Set to true to enable xdebug and "ddev start" or "ddev restart" +# Note that for most people the commands +# "ddev xdebug" to enable xdebug and "ddev xdebug off" to disable it work better, +# as leaving xdebug enabled all the time is a big performance hit. + +# xhprof_enabled: false # Set to true to enable xhprof and "ddev start" or "ddev restart" +# Note that for most people the commands +# "ddev xhprof" to enable xhprof and "ddev xhprof off" to disable it work better, +# as leaving xhprof enabled all the time is a big performance hit. + +# webserver_type: nginx-fpm # or apache-fpm + +# timezone: Europe/Berlin +# This is the timezone used in the containers and by PHP; +# it can be set to any valid timezone, +# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +# For example Europe/Dublin or MST7MDT + +# composer_root: +# Relative path to the composer root directory from the project root. This is +# the directory which contains the composer.json and where all Composer related +# commands are executed. + +# composer_version: "2" +# if composer_version:"2" it will use the most recent composer v2 +# It can also be set to "1", to get most recent composer v1 +# or "" for the default v2 created at release time. +# It can be set to any existing specific composer version. +# After first project 'ddev start' this will not be updated until it changes + +# nodejs_version: "16" +# change from the default system Node.js version to another supported version, like 12, 14, 17. +# Note that you can use 'ddev nvm' or nvm inside the web container to provide nearly any +# Node.js version, including v6, etc. + +# additional_hostnames: +# - somename +# - someothername +# would provide http and https URLs for "somename.ddev.site" +# and "someothername.ddev.site". + +# additional_fqdns: +# - example.com +# - sub1.example.com +# would provide http and https URLs for "example.com" and "sub1.example.com" +# Please take care with this because it can cause great confusion. + +# upload_dir: custom/upload/dir +# would set the destination path for ddev import-files to /custom/upload/dir + +# working_dir: +# web: /var/www/html +# db: /home +# would set the default working directory for the web and db services. +# These values specify the destination directory for ddev ssh and the +# directory in which commands passed into ddev exec are run. + +# omit_containers: [db, dba, ddev-ssh-agent] +# Currently only these containers are supported. Some containers can also be +# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit +# the "db" container, several standard features of ddev that access the +# database container will be unusable. In the global configuration it is also +# possible to omit ddev-router, but not here. + +# nfs_mount_enabled: false +# Great performance improvement but requires host configuration first. +# See https://ddev.readthedocs.io/en/stable/users/performance/#using-nfs-to-mount-the-project-into-the-container + +# mutagen_enabled: false +# Experimental performance improvement using mutagen asynchronous updates. +# See https://ddev.readthedocs.io/en/latest/users/performance/#using-mutagen + +# fail_on_hook_fail: False +# Decide whether 'ddev start' should be interrupted by a failing hook + +# host_https_port: "59002" +# The host port binding for https can be explicitly specified. It is +# dynamic unless otherwise specified. +# This is not used by most people, most people use the *router* instead +# of the localhost port. + +# host_webserver_port: "59001" +# The host port binding for the ddev-webserver can be explicitly specified. It is +# dynamic unless otherwise specified. +# This is not used by most people, most people use the *router* instead +# of the localhost port. + +# host_db_port: "59002" +# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic +# unless explicitly specified. + +# phpmyadmin_port: "8036" +# phpmyadmin_https_port: "8037" +# The PHPMyAdmin ports can be changed from the default 8036 and 8037 + +# host_phpmyadmin_port: "8036" +# The phpmyadmin (dba) port is not normally bound on the host at all, instead being routed +# through ddev-router, but it can be specified and bound. + +# mailhog_port: "8025" +# mailhog_https_port: "8026" +# The MailHog ports can be changed from the default 8025 and 8026 + +# host_mailhog_port: "8025" +# The mailhog port is not normally bound on the host at all, instead being routed +# through ddev-router, but it can be bound directly to localhost if specified here. + +# webimage_extra_packages: [php7.4-tidy, php-bcmath] +# Extra Debian packages that are needed in the webimage can be added here + +# dbimage_extra_packages: [telnet,netcat] +# Extra Debian packages that are needed in the dbimage can be added here + +# use_dns_when_possible: true +# If the host has internet access and the domain configured can +# successfully be looked up, DNS will be used for hostname resolution +# instead of editing /etc/hosts +# Defaults to true + +# project_tld: ddev.site +# The top-level domain used for project URLs +# The default "ddev.site" allows DNS lookup via a wildcard +# If you prefer you can change this to "ddev.local" to preserve +# pre-v1.9 behavior. + +# ngrok_args: --subdomain mysite --auth username:pass +# Provide extra flags to the "ngrok http" command, see +# https://ngrok.com/docs#http or run "ngrok http -h" + +# disable_settings_management: false +# If true, ddev will not create CMS-specific settings files like +# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php +# In this case the user must provide all such settings. + +# You can inject environment variables into the web container with: +# web_environment: +# - SOMEENV=somevalue +# - SOMEOTHERENV=someothervalue + +# no_project_mount: false +# (Experimental) If true, ddev will not mount the project into the web container; +# the user is responsible for mounting it manually or via a script. +# This is to enable experimentation with alternate file mounting strategies. +# For advanced users only! + +# bind_all_interfaces: false +# If true, host ports will be bound on all network interfaces, +# not just the localhost interface. This means that ports +# will be available on the local network if the host firewall +# allows it. + +# Many ddev commands can be extended to run tasks before or after the +# ddev command is executed, for example "post-start", "post-import-db", +# "pre-composer", "post-composer" +# See https://ddev.readthedocs.io/en/stable/users/extending-commands/ for more +# information on the commands that can be extended and the tasks you can define +# for them. Example: +#hooks: +# post-import-db: +# - exec: drush cr +# - exec: drush updb diff --git a/common/drupal9/.ddev/providers/platform.yaml b/common/drupal9/.ddev/providers/platform.yaml new file mode 100755 index 000000000..19ce7501c --- /dev/null +++ b/common/drupal9/.ddev/providers/platform.yaml @@ -0,0 +1,63 @@ +#ddev-generated +# Example Platform.sh provider configuration. + +# To use this configuration, + +# 1. Check out the site from platform.sh and then configure it with `ddev config`. You'll want to use `ddev start` and make sure the basic functionality is working. +# 2. Obtain and configure an API token. +# a. Login to the Platform.sh Dashboard and go to Account->API Tokens to create an API token for ddev to use. +# b. Add the API token to the `web_environment` section in your global ddev configuration at ~/.ddev/global_config.yaml: +# ```yaml +# web_environment: +# - PLATFORMSH_CLI_TOKEN=abcdeyourtoken +# ``` +# 3. `ddev restart` +# 4. Obtain your project id with `ddev exec platform`. The platform tool should show you all the information about your account and project. +# 5. In your project's .ddev/providers directory, copy platform.yaml.example to platform.yaml and edit the `project_id` and `environment_name`. +# 6. Run `ddev pull platform`. After you agree to the prompt, the current upstream database and files will be downloaded. +# 7. Optionally use `ddev push platform` to push local files and database to platform.sh. Note that `ddev push` is a command that can potentially damage your production site, so this is not recommended. + +# Debugging: Use `ddev exec platform` to see what platform.sh knows about +# your configuration and whether it's working correctly. + +environment_variables: + project_id: yourproject + environment: main + application: drupal + +auth_command: + command: | + set -eu -o pipefail + if [ -z "${PLATFORMSH_CLI_TOKEN:-}" ]; then echo "Please make sure you have set PLATFORMSH_CLI_TOKEN in ~/.ddev/global_config.yaml" && exit 1; fi + +db_pull_command: + command: | + set -x # You can enable bash debugging output by uncommenting + set -eu -o pipefail + ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible + platform db:dump --yes --gzip --file=/var/www/html/.ddev/.downloads/db.sql.gz --project="${project_id}" --environment="${environment}" --app="${application}" + +files_pull_command: + command: | + set -x # You can enable bash debugging output by uncommenting + set -eu -o pipefail + ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible + platform mount:download --yes --quiet --project="${project_id}" --environment="${environment}" --app="${application}" --mount=web/sites/default/files --target=/var/www/html/.ddev/.downloads/files + + +# push is a dangerous command. If not absolutely needed it's better to delete these lines. +db_push_command: + command: | + set -x # You can enable bash debugging output by uncommenting + set -eu -o pipefail + ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible + pushd /var/www/html/.ddev/.downloads >/dev/null; + gzip -dc db.sql.gz | platform db:sql --project="${project_id}" --environment="${environment}" + +# push is a dangerous command. If not absolutely needed it's better to delete these lines. +files_push_command: + command: | + set -x # You can enable bash debugging output by uncommenting + set -eu -o pipefail + ls "${DDEV_FILES_DIR}" >/dev/null # This just refreshes stale NFS if possible + platform mount:upload --yes --quiet --project="${project_id}" --environment="${environment}" --source="${DDEV_FILES_DIR}" --mount=web/sites/default/files diff --git a/common/drupal9/.lando.upstream.yml b/common/drupal9/.lando.upstream.yml new file mode 100644 index 000000000..09b952be9 --- /dev/null +++ b/common/drupal9/.lando.upstream.yml @@ -0,0 +1,32 @@ +# This file sets some good defaults for local development using this Platform.sh +# template with Lando. +# +# Note that you should not edit this file so it can continue to receive upstream +# updates. If you wish to change the values below then override them in your +# normal .lando.yml. + +# These both allow you to test this template without needing a site on Platform.sh +# However you will want to replace them in your .lando.yml +name: platformsh-drupal9 +recipe: platformsh + +config: + + # This section overrides Platform.sh configuration with values that make more + # sense for local development. + # + # Note that "app" is the name of the application defined in your + # .platform.app.yaml or applications.yaml. + overrides: + app: + variables: + drupalconfig: + "system.file:path:temporary": "/tmp" + drupalsettings: + "skip_permissions_hardening": 1 + + +# These are tools that are commonly used during development for this template. +tooling: + drush: + service: app diff --git a/common/drupal9/php.ini b/common/drupal9/php.ini new file mode 100644 index 000000000..b731f3112 --- /dev/null +++ b/common/drupal9/php.ini @@ -0,0 +1,14 @@ +assert.active = Off +display_errors = Off +display_startup_errors = Off +max_execution_time = 30 +session.use_strict_mode = On +zend.detect_unicode = Off +opcache.memory_consumption = 128 +opcache.interned_strings_buffer = 8 +opcache.max_accelerated_files = 4000 +opcache.revalidate_freq = 60 +opcache.fast_shutdown = 1 +opcache.enable_cli = 1 +realpath_cache_ttl = 3600 +session.gc_probability = 0 diff --git a/common/readme/blackfire.md b/common/readme/blackfire.md new file mode 100644 index 000000000..b6df2c94c --- /dev/null +++ b/common/readme/blackfire.md @@ -0,0 +1,12 @@ +### Blackfire.io: creating a Continuous Observability Strategy + +This template includes a starting [`.blackfire.yml`](.blackfire.yml) file that can be used to enable [Application Performance Monitoring](https://blackfire.io/docs/monitoring-cookbooks/index), [Profiling](https://blackfire.io/docs/profiling-cookbooks/index), [Builds](https://blackfire.io/docs/builds-cookbooks/index) and [Performance Testing](https://blackfire.io/docs/testing-cookbooks/index) on your project. Platform.sh comes with Blackfire pre-installed on application containers, and [setting up requires minimal configuration](https://docs.platform.sh/integrations/observability/blackfire.html). + +* [What is Blackfire?](https://blackfire.io/docs/introduction) +* [Configuring Blackfire.io on a Platform.sh project](https://docs.platform.sh/integrations/observability/blackfire.html) +* [Blackfire.io Platform.sh documentation](https://blackfire.io/docs/integrations/paas/platformsh) +* [Profiling Cookbooks](https://blackfire.io/docs/profiling-cookbooks/index) +* [Monitoring Cookbooks](https://blackfire.io/docs/monitoring-cookbooks/index) +* [Testing Cookbooks](https://blackfire.io/docs/testing-cookbooks/index) +* [Using Builds](https://blackfire.io/docs/builds-cookbooks/index) +* [Configuring Integrations](https://blackfire.io/docs/integrations/index) diff --git a/common/readme/contact.md b/common/readme/contact.md new file mode 100644 index 000000000..78c14c8f7 --- /dev/null +++ b/common/readme/contact.md @@ -0,0 +1,4 @@ +This template is maintained by the Platform.sh Developer Relations team, and they will be notified of all issues and pull requests you open here. + +- **Community:** Share your question with the community, or see if it's already been asked on our [Community site](https://community.platform.sh). +- **Slack:** If you haven't done so already, you can join Platform.sh's [public Slack](https://chat.platform.sh/) channels and ping the `@devrel_team` with any questions. diff --git a/common/readme/deploy_bitbucket.md b/common/readme/deploy_bitbucket.md new file mode 100644 index 000000000..4d5b3460e --- /dev/null +++ b/common/readme/deploy_bitbucket.md @@ -0,0 +1,37 @@ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
diff --git a/common/readme/deploy_direct.md b/common/readme/deploy_direct.md new file mode 100644 index 000000000..c8010baea --- /dev/null +++ b/common/readme/deploy_direct.md @@ -0,0 +1,49 @@ +
+Deploy directly to Platform.sh from the command line + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
diff --git a/common/readme/deploy_github.md b/common/readme/deploy_github.md new file mode 100644 index 000000000..e72973a81 --- /dev/null +++ b/common/readme/deploy_github.md @@ -0,0 +1,33 @@ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
diff --git a/common/readme/deploy_gitlab.md b/common/readme/deploy_gitlab.md new file mode 100644 index 000000000..39dde20ef --- /dev/null +++ b/common/readme/deploy_gitlab.md @@ -0,0 +1,37 @@ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
diff --git a/common/readme/drupal/local_ddev.md b/common/readme/drupal/local_ddev.md new file mode 100644 index 000000000..c17a8108a --- /dev/null +++ b/common/readme/drupal/local_ddev.md @@ -0,0 +1,28 @@ +
+Drupal: using ddev
+ +ddev provides an integration with Platform.sh that makes it simple to develop Drupal locally. Check the [providers documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for the most up-to-date information. + +In general, the steps are as follows: + +1. [Install ddev](https://ddev.readthedocs.io/en/stable/#installation). +1. A configuration file has already been provided at `.ddev/providers/platform.yaml`, so you should not need to run `ddev config`. +1. [Retrieve an API token](https://docs.platform.sh/development/cli/api-tokens.html#get-a-token) for your organization via the management console. +1. Update your dedev global configuration file to use the token you've just retrieved: + ```yaml + web_environment: + - PLATFORMSH_CLI_TOKEN=abcdeyourtoken` + ``` +1. Run `ddev restart`. +1. Get your project ID with `platform project:info`. If you have not already connected your local repo with the project (as is the case with a source integration, by default), you can run `platform project:list` to locate the project ID, and `platform project:set-remote PROJECT_ID` to configure Platform.sh locally. +1. Update the `.ddev/providers/platform.yaml` file for your current setup: + ```yaml + environment_variables: + project_id: PROJECT_ID + environment: CURRENT_ENVIRONMENT + application: drupal + ``` +1. Get the current environment's data with `ddev pull platform`. +1. When you have finished with your work, run `ddev stop` and `ddev poweroff`. + +
\ No newline at end of file diff --git a/common/readme/drupal/local_lando.md b/common/readme/drupal/local_lando.md new file mode 100644 index 000000000..399964197 --- /dev/null +++ b/common/readme/drupal/local_lando.md @@ -0,0 +1,13 @@ +
+Drupal: using Lando
+ +Lando supports PHP applications [configured to run on Platform.sh](https://docs.platform.sh/development/local/lando.html), and pulls from the same container registry Platform.sh uses on your remote environments during your local builds through its own [recipe and plugin](https://docs.lando.dev/platformsh/). + +1. [Install Lando](https://docs.lando.dev/getting-started/installation.html). +1. Make sure Docker is already running - Lando will attempt to start Docker for you, but it's best to have it running in the background before beginning. +1. Start your apps and services with the command `lando start`. +1. To get up-to-date data from your Platform.sh environment ([services *and* mounts](https://docs.lando.dev/platformsh/sync.html#pulling)), run the command `lando pull`. +1. If at any time you have updated your Platform.sh configuration files, run the command `lando rebuild`. +1. When you have finished with your work, run `lando stop` and `lando poweroff`. + +
diff --git a/common/readme/drupal/php.ini.md b/common/readme/drupal/php.ini.md new file mode 100644 index 000000000..cdbd043bf --- /dev/null +++ b/common/readme/drupal/php.ini.md @@ -0,0 +1 @@ +An initial `php.ini` file has also beed added. The settings are a result of performance testing and best practice recommendations coming from [Blackfire.io](https://blackfire.io). They will initialize Drupal with a number of good baseline performance settings for production applications, and complement many of the tests specified in [`.blackfire.yml`](.blackfire.yml). \ No newline at end of file diff --git a/common/readme/drupal/troubleshoot_cache.md b/common/readme/drupal/troubleshoot_cache.md new file mode 100644 index 000000000..de3868e6f --- /dev/null +++ b/common/readme/drupal/troubleshoot_cache.md @@ -0,0 +1,11 @@ +
+Rebuilding cache
+ +You may run into a database error after installing Drupal on your production environment initially. +To fix, SSH into the application container (`platform ssh`) and rebuild the cache using Drush: + +```bash +drush cache-rebuild +``` + +
diff --git a/common/readme/drupal/troubleshoot_hashsalt.md b/common/readme/drupal/troubleshoot_hashsalt.md new file mode 100644 index 000000000..f7907e155 --- /dev/null +++ b/common/readme/drupal/troubleshoot_hashsalt.md @@ -0,0 +1,29 @@ +
+Default hash_salt behavior
+ +Drupal's [default settings set](https://github.com/drupal/drupal/blob/9.3.x/core/assets/scaffold/files/default.settings.php#L252) `hash_salt` to an empty string: + +```php +$settings['hash_salt'] = ''; +``` + +In the past, Platform.sh templates have overridden this value: + +```php +$settings['hash_salt'] = $settings['hash_salt'] ?? $platformsh->projectEntropy; +``` + +This setting was insufficient to cover some user configurations - such as those cases when an application depends on a `Null` value for `hash_salt`. + +Now, the setting looks like this in `settings.platformsh.php`: + +```bash +$settings['hash_salt'] = empty($settings['hash_salt']) ? $platformsh->projectEntropy : $settings['hash_salt']; +``` + +This change sets `hash_salt` to the built-in environment variable `PLATFORM_PROJECT_ENTROPY` value if the project contains the default settings OR `Null`. +If your application code *depends* on an empty value, feel free to comment out that line, or reset again later in that file. + +Feel free to visit [`platformsh-templates/drupal9#73`](https://github.com/platformsh-templates/drupal9/pull/73) for more details on this discussion. + +
\ No newline at end of file diff --git a/common/readme/drupal/troubleshoot_multisite.md b/common/readme/drupal/troubleshoot_multisite.md new file mode 100644 index 000000000..e451fede8 --- /dev/null +++ b/common/readme/drupal/troubleshoot_multisite.md @@ -0,0 +1,16 @@ +
+How Drupal multi-site works on Platform.sh
+ +Multisite on Platform.sh can be tricky. Drupal multisite bases its logic off of the domain name of the incoming request. However, the domain name of the request is by design highly variable on Platform.sh as every environment has a unique domain. As a result, this template establishes a number of conventions and custom configuration to make multi-site work. + +* Every subsite is a subdomain off of a common domain. See `routes.yaml`. The domain prefix is the "subsite ID". +* Every subsite has its own database and endpoint on a single MariaDB service instance. The endpoint name is the same as the subsite ID. +* The `sites/sites.php` file includes code to build a `$sites` lookup list to map any incoming request, regardless of branch, to a settings directory named for the subsite ID. It iterates over all routes that point to the Drupal application and parses those routes into a domain name -> directory list, where the directory is the site ID. If you are not using a subdomain based multi-site you will likely need to modify the body of the `foreach()` loop. +* The `.platform.app.yaml` file is essentially the same as for a single-site Drupal installation, but its relationships include every defined MariaDB endpoint. The relationship is also named for the subsite ID. +* Every subsite ID's `settings.php` file is identical, and largely similar to the standard Platform.sh `settings.php` file. You may customize it if needed. In particular, the `$platformsh_enable_redis` variable should be toggled to `true` for each site only after the install process is completed for that site, as Drupal cannot install with the redis module active. +* The `settings.php` files also include a shared `sites/settings.platformsh.php` file. It is largely the same as in a single-site configuration but has been modified to leverage the subsite ID for: + * Selecting which database relationship to use + * Including a cache prefix in Redis so that each site has its own effective cache pool. + * Setting the files and private files directories, which are subsite ID prefixes of top-level `files` and `private` directories rather than under each site directory. + +
\ No newline at end of file diff --git a/common/readme/drupal/troubleshoot_multisite_addsite.md b/common/readme/drupal/troubleshoot_multisite_addsite.md new file mode 100644 index 000000000..771b70acc --- /dev/null +++ b/common/readme/drupal/troubleshoot_multisite_addsite.md @@ -0,0 +1,17 @@ +
+Adding a new subsite
+ +Adding a new subsite requires the following steps. For these steps, assume we're adding a subdomain named `stuff`. + +1. Add a new route to `routes.yaml` with a new `stuff` domain prefix. Copying and pasting an existing route is fine. +2. Copy the `sites/default` directory to `sites/stuff`. +3. Edit `services.yaml` and add a new database and endpoint. Copying and pasting an existing entry is fine. The new relationship must be named `stuff`. +4. Edit `.platform.app.yaml` and add a new relationship: `stuff: db:stuff`. (Where `db` is the name of the database service from `services.yaml`.) +5. Commit the above changes and push. +6. In your browser, go to the `stuff.example.com` domain (or equivalent on a dev environment) and run through the Drupal installer as usual. Alternatively, you can use Drush as described bellow. +7. Edit the `sites/stuff/settings.php` file again and enable Redis by setting `$platformsh_enable_redis` to true. +8. Commit and push that change. + +Alternatively, a PHP shell script is provided that automates steps 1-4. See [`psh-subsite-add.php`](psh-subsite-add.php). + +
\ No newline at end of file diff --git a/common/readme/drupal/troubleshoot_multisite_drush.md b/common/readme/drupal/troubleshoot_multisite_drush.md new file mode 100644 index 000000000..5cedc9d3e --- /dev/null +++ b/common/readme/drupal/troubleshoot_multisite_drush.md @@ -0,0 +1,10 @@ +
+Using Drush in multi-site
+ +In a Drupal multi-site setup, sites ID are defined in [web/sites/sites.php](https://github.com/platformsh-templates/drupal8-multisite/blob/master/web/sites/sites.php). By default in this multi-site template, 2 subsites are defined in [routes.yaml](https://github.com/platformsh-templates/drupal8-multisite/blob/master/.platform/routes.yaml): `first` and `second` + +Any Drush command can therefore be used on a specific subsite by using `--uri=`. For example: +* `drush status --uri=first` +* `drush status --uri=second` + +
\ No newline at end of file diff --git a/common/readme/file_descriptions/.blackfire.yml.md b/common/readme/file_descriptions/.blackfire.yml.md new file mode 100644 index 000000000..cf0987fd2 --- /dev/null +++ b/common/readme/file_descriptions/.blackfire.yml.md @@ -0,0 +1 @@ +This file has been added to help you get started using [Blackfire.io](https://blackfire.io) on your project. See [the Blackfire section below](#blackfireio-creating-a-continuous-observability-strategy) for more information on how to get started. \ No newline at end of file diff --git a/common/readme/file_descriptions/.ddev.providers.platform.yaml.md b/common/readme/file_descriptions/.ddev.providers.platform.yaml.md new file mode 100644 index 000000000..e50927747 --- /dev/null +++ b/common/readme/file_descriptions/.ddev.providers.platform.yaml.md @@ -0,0 +1 @@ +This file configures [ddev](https://ddev.readthedocs.io/en/latest/users/providers/platform/) as a local development option for this template. See the [Platform.sh ddev integration documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. Be sure to follow the instructions provided through the ddev CLI and in the comments section of that file to correctly configure ddev for your project. \ No newline at end of file diff --git a/common/readme/file_descriptions/.environment.md b/common/readme/file_descriptions/.environment.md new file mode 100644 index 000000000..c7be4bd2b --- /dev/null +++ b/common/readme/file_descriptions/.environment.md @@ -0,0 +1 @@ +The `.environment` file is a convenient place to [set environment variables](https://docs.platform.sh/development/variables/set-variables.html#set-variables-via-script) relevant to your applications that may be dependent on the current environment. It is sourced before the start command is run, as the first step in the `deploy` and `post_deploy` hooks, and at the beginning of each session when you SSH into an application container. It is written in dash, so be aware of the differences to bash.

It can be used to set any environment variable, including ones that depend on Platform.sh-provided variables like `PLATFORM_RELATIONSHIPS` and `PLATFORM_ROUTES`, or to modify `PATH`. This file should not [produce output](https://docs.platform.sh/development/variables/set-variables.html#testing-environment-scripts).

\ No newline at end of file diff --git a/common/readme/file_descriptions/.lando.upstream.yml.md b/common/readme/file_descriptions/.lando.upstream.yml.md new file mode 100644 index 000000000..b706c9de3 --- /dev/null +++ b/common/readme/file_descriptions/.lando.upstream.yml.md @@ -0,0 +1 @@ +This file configures [Lando](https://docs.platform.sh/development/local/lando.html) as a local development option for this template. See the [Platform.sh Lando plugin documentation](https://docs.lando.dev/platformsh/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. \ No newline at end of file diff --git a/common/readme/file_descriptions/.platform.app.yaml.md b/common/readme/file_descriptions/.platform.app.yaml.md new file mode 100644 index 000000000..85126a2eb --- /dev/null +++ b/common/readme/file_descriptions/.platform.app.yaml.md @@ -0,0 +1 @@ +This file is required to define the build and deploy process for all application containers on Platform.sh. Within this file, the runtime version, relationships to service containers, and writable mounts are configured. It's also in this file that it is defined what dependencies are installed, when they are installed, and that package manager will be used to do so.

Take a look at the [Application](https://docs.platform.sh/configuration/app.html) documentation for more details about configuration. For more information about the sequence of events that lead from a build to deployment, see the [Build and deploy timeline documentation](https://docs.platform.sh/overview/build-deploy.html).

\ No newline at end of file diff --git a/common/readme/file_descriptions/.platform.routes.yaml.md b/common/readme/file_descriptions/.platform.routes.yaml.md new file mode 100644 index 000000000..0866f64f6 --- /dev/null +++ b/common/readme/file_descriptions/.platform.routes.yaml.md @@ -0,0 +1 @@ +This file is require to deploy on Platform.sh, as it defines how requests should be handled on the platform. It's within this file that redirects and basic caching can be configured. See the [Routes documentation](https://docs.platform.sh/configuration/routes.html) for more configuration details.

\ No newline at end of file diff --git a/common/readme/file_descriptions/.platform.services.yaml.md b/common/readme/file_descriptions/.platform.services.yaml.md new file mode 100644 index 000000000..cca9e031b --- /dev/null +++ b/common/readme/file_descriptions/.platform.services.yaml.md @@ -0,0 +1 @@ +Platform.sh provides a number of on-demand managed services that can easily be added to your projects. It's within this file that each service's version, name, resources, and additional configuration are set. See the [Services documentation](https://docs.platform.sh/configuration/services.html) for more details on configuration, version and service availability.

\ No newline at end of file diff --git a/common/readme/file_ignore.json b/common/readme/file_ignore.json new file mode 100644 index 000000000..76efa2f2f --- /dev/null +++ b/common/readme/file_ignore.json @@ -0,0 +1,91 @@ +[ + "README.md", + "header.svg", + ".editorconfig", + ".ddev/web-build/Dockerfile.example", + ".ddev/xhprof/xhprof_prepend.php", + ".ddev/db-build/Dockerfile.example", + ".ddev/providers/git.yaml.example", + ".ddev/providers/pantheon.yaml.example", + ".ddev/providers/localfile.yaml.example", + ".ddev/providers/rsync.yaml.example", + ".ddev/providers/acquia.yaml.example", + ".ddev/providers/README.txt", + ".ddev/providers/platform.yaml.example", + ".ddev/nginx_full/README.nginx_full.txt", + ".ddev/nginx_full/seconddocroot.conf.example", + ".ddev/nginx_full/nginx-site.conf", + ".ddev/.dbimageBuild/Dockerfile", + ".ddev/.dbimageBuild/Dockerfile.example", + ".ddev/config.yaml", + ".ddev/homeadditions/README.txt", + ".ddev/homeadditions/bash_aliases.example", + ".ddev/.downloads/files/eflat_spirit_big.jpg", + ".ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + ".ddev/.downloads/files/iridescent_sladoje_big.jpg", + ".ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + ".ddev/.downloads/files/pwyll_gal_big.jpg", + ".ddev/.downloads/files/.htaccess", + ".ddev/.ddev-docker-compose-base.yaml", + ".ddev/.gitignore", + ".ddev/commands/host/solrtail.example", + ".ddev/commands/host/README.txt", + ".ddev/commands/web/README.txt", + ".ddev/commands/solr/solrtail.example", + ".ddev/commands/solr/README.txt", + ".ddev/commands/.gitattributes", + ".ddev/commands/db/README.txt", + ".ddev/.global_commands/host/sequelpro", + ".ddev/.global_commands/host/heidisql", + ".ddev/.global_commands/host/tableplus", + ".ddev/.global_commands/host/launch", + ".ddev/.global_commands/host/phpstorm.example", + ".ddev/.global_commands/host/yarn", + ".ddev/.global_commands/host/README.txt", + ".ddev/.global_commands/host/mysqlworkbench.example", + ".ddev/.global_commands/host/sequelace", + ".ddev/.global_commands/web/xdebug", + ".ddev/.global_commands/web/magento", + ".ddev/.global_commands/web/typo3cms", + ".ddev/.global_commands/web/xhprof", + ".ddev/.global_commands/web/php", + ".ddev/.global_commands/web/nvm", + ".ddev/.global_commands/web/wp", + ".ddev/.global_commands/web/artisan", + ".ddev/.global_commands/web/blackfire", + ".ddev/.global_commands/web/typo3", + ".ddev/.global_commands/web/README.txt", + ".ddev/.global_commands/web/drush.example", + ".ddev/.global_commands/web/drush", + ".ddev/.global_commands/.gitattributes", + ".ddev/.global_commands/db/psql", + ".ddev/.global_commands/db/mysql", + ".ddev/.global_commands/db/README.txt", + ".ddev/.global_commands/db/mysqldump.example", + ".ddev/.webimageBuild/Dockerfile", + ".ddev/.webimageBuild/Dockerfile.example", + ".ddev/.ddev-docker-compose-full.yaml", + ".ddev/.homeadditions/README.txt", + ".ddev/.homeadditions/bash_aliases.example", + ".ddev/apache/apache-site.conf", + ".ddev/apache/README.apache.txt", + ".ddev/apache/seconddocroot.conf.example", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/ISSUE_TEMPLATE/config.yaml", + ".github/ISSUE_TEMPLATE/improvements.yaml", + ".github/ISSUE_TEMPLATE/bug_report.yaml", + "config/sync/first/.gitkeep", + "config/sync/second/.gitkeep", + "config/sync/main/.gitkeep", + "web/sites/second/services.yml", + "web/sites/first/services.yml", + "web/sites/second/drushrc.php", + "web/sites/first/drushrc.php", + "web/sites/second/settings.php", + "web/sites/first/settings.php", + "web/sites/default.settings.php", + "web/sites/default.services.yml", + "web/sites/main/settings.php", + "web/sites/main/services.yml", + "web/sites/main/drushrc.php" +] diff --git a/common/readme/metrics.md b/common/readme/metrics.md new file mode 100644 index 000000000..2a05e557c --- /dev/null +++ b/common/readme/metrics.md @@ -0,0 +1,3 @@ +### Infrastructure metrics + +Something about metrics \ No newline at end of file diff --git a/common/readme/platformsh_desc.md b/common/readme/platformsh_desc.md new file mode 100644 index 000000000..96528d29c --- /dev/null +++ b/common/readme/platformsh_desc.md @@ -0,0 +1,35 @@ +This template has been specifically designed to deploy on Platform.sh. + +
+What is Platform.sh?
+ +Platform.sh is a unified, secure, enterprise-grade platform for building, running and scaling web applications. We’re the leader in Fleet Ops: Everything you need to manage your fleet of websites and apps is available from the start. Because infrastructure and workflows are handled from the start, apps just work, so teams can focus on what really matters: making faster changes, collaborating confidently, and scaling responsibly. Whether managing a fleet of ten or ten thousand sites and apps, Platform.sh is the Developer- preferred solution that scales right. + +Our key features include: + +* **GitOps: Git as the source of truth** + + Every branch becomes a development environment, and nothing can change without a commit. + +* **Batteries included: Managed infrastructure** + + [Simple abstraction in YAML](https://docs.platform.sh/configuration/yaml.html) for [committing and configuring infrastructure](https://docs.platform.sh/overview/structure.html), fully managed patch updates, and 24 [runtimes](https://docs.platform.sh/languages.html) & [services](https://docs.platform.sh/configuration/services.html) that can be added with a single line of code. + +* **Instant cloning: Branch, merge, repeat** + + [Reusable builds](https://docs.platform.sh/overview/build-deploy.html) and automatically inherited production data provide true staging environments - experiment in isolation, test, then destroy or merge. + +* **FleetOps: Fleet management platform** + + Leverage our public API along with custom tools like [Source Operations](https://docs.platform.sh/configuration/app/source-operations.html) and [Activity Scripts](https://docs.platform.sh/integrations/activity.html) to [manage thousands of applications](https://youtu.be/MILHG9OqhmE) - their dependency updates, fresh content, and upstream code. + + +To find out more, check out the demo below and go to our [website](https://platform.sh/product/). + +
+

+The Platform.sh demo +

+ + +
diff --git a/common/readme/tags_and_branches.md b/common/readme/tags_and_branches.md new file mode 100644 index 000000000..b7d49a3a6 --- /dev/null +++ b/common/readme/tags_and_branches.md @@ -0,0 +1,18 @@ +
+
+Note: not something we can merge
+ +All template repositories (a repo in the github.com/platform-templates organization) are *artifacts* of a central tool that helps our team keep them updated. +The steps described here are the steps taken by that tool to produce those artifact repositories. +This is advantageous, because we are able to describe the exact steps taken to build a working template you can use in your own migrations. + +Related to this, the final line above (`git merge --allow-unrelated-histories -X theirs M.m.P`) pulls "upstream" code from the open source project used to build this template. +In some cases, those projects will only have a primary stable branch to pull from, and you will see the command as `git merge --allow-unrelated-histories -X theirs main` for example. +Feel free to copy this command exactly. + +In other cases, we will track a major version of a tag on that upstream repo (i.e. `9.3.X`), and simply pull the latest patch when updates are periodically run. +If the command above contains a patch version, copy it exactly locally. +If it only contains a major or minor version, take a look at the output of `git fetch --all --depth=2` to find the latest tag version that fits the version listed above and use that instead. + +
+
diff --git a/common/readme/troubleshoot_ssh.md b/common/readme/troubleshoot_ssh.md new file mode 100644 index 000000000..df5b0dfd5 --- /dev/null +++ b/common/readme/troubleshoot_ssh.md @@ -0,0 +1,13 @@ +
+Accessing logs
+ +After the environment has finished its deployment, you can investigate issues that occured on startup, `deploy` and `post_deploy` hooks, and generally at runtime using the CLI. Run the command: + +```bash +platform ssh +``` + +If you are running the command outside of a local copy of the project, you will need to include the `-p` (project) and/or `-e` (environment) flags as well. +Once you have connected to the container, [logs](https://docs.platform.sh/development/logs.html#container-logs) are available within `/var/log/` for you to investigate. + +
diff --git a/dodo.py b/dodo.py index f161f1536..a56a3654c 100644 --- a/dodo.py +++ b/dodo.py @@ -11,6 +11,7 @@ from project.akeneo import Akeneo from project.backdrop import Backdrop from project.drupal import Drupal7_vanilla, Drupal8, Drupal8_multisite, Drupal8_opigno, Drupal8_govcms8, Drupal9 +from project.drupal import Drupal9_multisite, Contentacms from project.elasticapm import Elastic_apm from project.gatsby import Gatsby from project.hugo import Hugo diff --git a/migrate.py b/migrate.py new file mode 100644 index 000000000..a6eecbba2 --- /dev/null +++ b/migrate.py @@ -0,0 +1,196 @@ +# test.py in template-builder root + +import os +import sys +import json +import dodo +from datetime import datetime + +def get_templates_list(): + + templates_path = "{0}/templates".format(os.getcwd()) + with os.scandir(templates_path) as p: + for entry in p: + if entry.is_dir(): + yield entry.name + +def document_migration_steps(template): + + mypath = "{0}/templates/{1}/files".format(os.getcwd(), template) + template_link = 'https://raw.githubusercontent.com/platformsh/template-builder/master/' + + def get_files(path, depth): + """Retrieve files added to upstream templates.""" + depth -= 1 + with os.scandir(path) as p: + for entry in p: + file_link = entry.path.replace("{0}/".format(mypath),template_link) + if not entry.is_dir(): + if template_link not in file_link: + stripped_file = "/".join(file_link.split("{0}/common".format(os.getcwd()))[1].split("/")[2:]) + file_link = "{0}{1}".format(template_link, stripped_file) + yield file_link + if entry.is_dir() and depth > 0: + yield from get_files(entry.path, depth) + + def get_commands(data): + # data = dodo.project_factory(template).update + commands = [] + for item in data: + if isinstance(item, str): + # if 'echo' not in item and 'git' not in item and 'rsync' not in item: + if "&&" in item: + if len(item.split(" && ")) == 2: + # new_item = item.split(" && ")[1] + commands.append(item.split(" && ")[1]) + # print(new_item) + # if 'composer require' in new_item or 'composer update' in new_item: + # commands.append(new_item.split(" --")[0]) + # else: + # commands.append(item.split(" && ")[1]) + else: + commands.append(item) + return commands + + # 'cleanup', 'init', 'update', 'platformify', 'branch', 'push' + + def get_cleanup_commands(): + return get_commands(dodo.project_factory(template).cleanup) + + def get_init_commands(): + return get_commands(dodo.project_factory(template).init) + + def get_update_commands(): + return get_commands(dodo.project_factory(template).update) + + def get_platformify_commands(): + return get_commands(dodo.project_factory(template).platformify) + + def get_branch_commands(): + return get_commands(dodo.project_factory(template).branch) + + def get_push_commands(): + return get_commands(dodo.project_factory(template).push) + + + # Commands. + cleanup_commands = get_cleanup_commands() + init_commands = get_init_commands() + update_commands = get_update_commands() + platformify_commands = get_platformify_commands() + branch_commands = get_branch_commands() + push_commands = get_push_commands() + + composer_dependencies = [command.split(" --")[0] for command in [*platformify_commands] if "composer require" in command] + composer_config = [command for command in [*platformify_commands] if "composer config allow-plugins" in command] + + dependencies = [*composer_dependencies, *composer_config] + + # Files. + + rsync_files = [command for command in [*platformify_commands] if "rsync" in command] + migrate_files = [] + for command in rsync_files: + migrate_files += list(get_files(command.split(" ")[2], 10)) + + migrate_trimmed_files = [] + migrate_rel = [] + if len(migrate_files) > 0: + migrate_trimmed_files = ["https://raw.githubusercontent.com/platformsh-templates/{0}/master/{1}".format(template, file.split("template-builder/master/")[1]) for file in migrate_files] + migrate_rel = [file.split("template-builder/master/")[1] for file in migrate_files] + + try: + major_version = dodo.project_factory(template).major_version + except: + major_version = dodo.project_factory(template).upstream_branch + + + try: + latest_tag = dodo.project_factory(template).latest_tag() + except: + latest_tag = None + + if latest_tag is not None: + major_version = latest_tag + + try: + remote = dodo.project_factory(template).remote + except: + remote = None + try: + imageType = dodo.project_factory(template).type + except: + imageType = None + try: + imageTypeVersion = dodo.project_factory(template).typeVersion + except: + imageTypeVersion = None + + data = { + "template": template, + "type": imageType, + "type_version": imageTypeVersion, + "remote": { + "major_version": major_version, + "repository": remote, + "latest_tag": latest_tag, + }, + "last_updated_on": datetime.today().strftime('%Y-%m-%d-%H:%M:%S'), + "migration": { + "files": { + "rel_template": migrate_trimmed_files, + "rel_tb": migrate_files, + "rel_root": migrate_rel + }, + "commands": { + "cleanup": [*cleanup_commands], + "init": [*init_commands], + "update": [*update_commands], + "platformify": [*platformify_commands], + "branch": [*branch_commands], + "push": [*push_commands] + }, + "migrate": { + "init": [ + "mkdir {0} && cd {0}".format(template), + "git init", + "git remote add upstream {0}".format(dodo.project_factory(template).remote), + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs {0}".format(major_version) + ], + "deps": dependencies + } + } + } + + json_data=json.dumps(data, indent = 4) + projectType = "remote" + if remote == None: + projectType = "basic" + with open("{0}/migrations/{1}.migrate.json".format(os.getcwd(), template), "w") as outfile: + outfile.write(json_data) + +def get_migration_data(template): + ignore_templates = ['wordpress-vanilla'] + try: + remote = dodo.project_factory(template).remote + except: + remote = None + if remote is not None: + if template not in ignore_templates: + document_migration_steps(template) + +def run(args): + + if len(args) > 1: + template = args[1] + get_migration_data(template) + else: + templates = list(get_templates_list()) + for template in templates: + get_migration_data(template) + +if __name__ == "__main__": + run(sys.argv) diff --git a/migrations/akeneo.migrate.json b/migrations/akeneo.migrate.json new file mode 100644 index 000000000..84b929296 --- /dev/null +++ b/migrations/akeneo.migrate.json @@ -0,0 +1,77 @@ +{ + "template": "akeneo", + "type": "php", + "type_version": "8.0", + "remote": { + "major_version": "v6.0.6", + "repository": "https://github.com/akeneo/pim-community-standard.git", + "latest_tag": "v6.0.6" + }, + "last_updated_on": "2022-04-05-14:00:04", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/akeneo/master/.environment", + "https://raw.githubusercontent.com/platformsh-templates/akeneo/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/akeneo/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/akeneo/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/akeneo/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/akeneo/master/.platform/routes.yaml" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/.environment", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml" + ], + "rel_root": [ + ".environment", + "README.md", + ".lando.upstream.yml", + ".platform.app.yaml", + ".platform/services.yaml", + ".platform/routes.yaml" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/akeneo/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/akeneo.git /Users/chadcarlson/template-builder/templates/akeneo/build/", + "git remote add project https://github.com/akeneo/pim-community-standard.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/akeneo/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/akeneo/files/ /Users/chadcarlson/template-builder/templates/akeneo/build/", + "composer require platformsh/config-reader --no-scripts --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php", + "composer update -W --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir akeneo && cd akeneo", + "git init", + "git remote add upstream https://github.com/akeneo/pim-community-standard.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs v6.0.6" + ], + "deps": [ + "composer require platformsh/config-reader" + ] + } + } +} \ No newline at end of file diff --git a/migrations/drupal8-govcms8.migrate.json b/migrations/drupal8-govcms8.migrate.json new file mode 100644 index 000000000..6e837f4aa --- /dev/null +++ b/migrations/drupal8-govcms8.migrate.json @@ -0,0 +1,345 @@ +{ + "template": "drupal8-govcms8", + "type": "php", + "type_version": "8.0", + "remote": { + "major_version": "2.12.0", + "repository": "https://github.com/govCMS/GovCMS.git", + "latest_tag": "2.12.0" + }, + "last_updated_on": "2022-04-13-14:35:36", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.github/PULL_REQUEST_TEMPLATE.md", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.github/ISSUE_TEMPLATE/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.github/ISSUE_TEMPLATE/improvements.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.github/ISSUE_TEMPLATE/bug_report.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/config/sync/.gitkeep", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.environment", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/scripts/composer/ScriptHandler.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/docroot/sites/default/settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/docroot/sites/default/settings.platformsh.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/drush/platformsh_generate_drush_yml.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/header.svg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/php.ini", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.blackfire.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/web-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/xhprof/xhprof_prepend.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/db-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/providers/git.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/providers/pantheon.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/providers/localfile.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/providers/platform.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/providers/rsync.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/providers/acquia.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/providers/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/providers/platform.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/nginx_full/README.nginx_full.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/nginx_full/seconddocroot.conf.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/nginx_full/nginx-site.conf", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.dbimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.dbimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.downloads/files/eflat_spirit_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.downloads/files/iridescent_sladoje_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.downloads/files/pwyll_gal_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.downloads/files/.htaccess", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.ddev-docker-compose-base.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/commands/host/solrtail.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/commands/solr/solrtail.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/commands/solr/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/host/sequelpro", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/host/heidisql", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/host/tableplus", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/host/launch", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/host/phpstorm.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/host/yarn", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/host/mysqlworkbench.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/host/sequelace", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/xdebug", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/magento", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/typo3cms", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/xhprof", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/nvm", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/wp", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/artisan", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/blackfire", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/typo3", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/drush.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/web/drush", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/db/psql", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/db/mysql", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.global_commands/db/mysqldump.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.webimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.webimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.ddev-docker-compose-full.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/.homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/apache/apache-site.conf", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/apache/README.apache.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-govcms8/master/.ddev/apache/seconddocroot.conf.example" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/PULL_REQUEST_TEMPLATE.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/improvements.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/bug_report.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/config/sync/.gitkeep", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.environment", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/scripts/composer/ScriptHandler.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/docroot/sites/default/settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/docroot/sites/default/settings.platformsh.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/drush/platformsh_generate_drush_yml.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/header.svg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/php.ini", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.blackfire.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/web-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/xhprof/xhprof_prepend.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/db-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/git.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/pantheon.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/localfile.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/platform.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/rsync.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/acquia.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/platform.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/README.nginx_full.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/seconddocroot.conf.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/nginx-site.conf", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.dbimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.dbimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/eflat_spirit_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/iridescent_sladoje_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/pwyll_gal_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/.htaccess", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.ddev-docker-compose-base.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/host/solrtail.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/solr/solrtail.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/solr/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/sequelpro", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/heidisql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/tableplus", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/launch", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/phpstorm.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/yarn", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/mysqlworkbench.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/sequelace", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/xdebug", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/magento", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/typo3cms", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/xhprof", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/nvm", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/wp", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/artisan", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/blackfire", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/typo3", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/drush.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/drush", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/psql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/mysql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/mysqldump.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.webimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.webimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.ddev-docker-compose-full.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/apache-site.conf", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/README.apache.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/seconddocroot.conf.example" + ], + "rel_root": [ + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/ISSUE_TEMPLATE/config.yaml", + ".github/ISSUE_TEMPLATE/improvements.yaml", + ".github/ISSUE_TEMPLATE/bug_report.yaml", + "config/sync/.gitkeep", + ".editorconfig", + ".environment", + "README.md", + ".gitignore", + "scripts/composer/ScriptHandler.php", + ".lando.upstream.yml", + ".platform.app.yaml", + "docroot/sites/default/settings.php", + "docroot/sites/default/settings.platformsh.php", + "drush/platformsh_generate_drush_yml.php", + "header.svg", + ".platform/services.yaml", + ".platform/routes.yaml", + "php.ini", + ".blackfire.yml", + ".lando.upstream.yml", + ".ddev/web-build/Dockerfile.example", + ".ddev/xhprof/xhprof_prepend.php", + ".ddev/db-build/Dockerfile.example", + ".ddev/providers/git.yaml.example", + ".ddev/providers/pantheon.yaml.example", + ".ddev/providers/localfile.yaml.example", + ".ddev/providers/platform.yaml", + ".ddev/providers/rsync.yaml.example", + ".ddev/providers/acquia.yaml.example", + ".ddev/providers/README.txt", + ".ddev/providers/platform.yaml.example", + ".ddev/nginx_full/README.nginx_full.txt", + ".ddev/nginx_full/seconddocroot.conf.example", + ".ddev/nginx_full/nginx-site.conf", + ".ddev/.dbimageBuild/Dockerfile", + ".ddev/.dbimageBuild/Dockerfile.example", + ".ddev/config.yaml", + ".ddev/homeadditions/README.txt", + ".ddev/homeadditions/bash_aliases.example", + ".ddev/.downloads/files/eflat_spirit_big.jpg", + ".ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + ".ddev/.downloads/files/iridescent_sladoje_big.jpg", + ".ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + ".ddev/.downloads/files/pwyll_gal_big.jpg", + ".ddev/.downloads/files/.htaccess", + ".ddev/.ddev-docker-compose-base.yaml", + ".ddev/.gitignore", + ".ddev/commands/host/solrtail.example", + ".ddev/commands/host/README.txt", + ".ddev/commands/web/README.txt", + ".ddev/commands/solr/solrtail.example", + ".ddev/commands/solr/README.txt", + ".ddev/commands/.gitattributes", + ".ddev/commands/db/README.txt", + ".ddev/.global_commands/host/sequelpro", + ".ddev/.global_commands/host/heidisql", + ".ddev/.global_commands/host/tableplus", + ".ddev/.global_commands/host/launch", + ".ddev/.global_commands/host/phpstorm.example", + ".ddev/.global_commands/host/yarn", + ".ddev/.global_commands/host/README.txt", + ".ddev/.global_commands/host/mysqlworkbench.example", + ".ddev/.global_commands/host/sequelace", + ".ddev/.global_commands/web/xdebug", + ".ddev/.global_commands/web/magento", + ".ddev/.global_commands/web/typo3cms", + ".ddev/.global_commands/web/xhprof", + ".ddev/.global_commands/web/php", + ".ddev/.global_commands/web/nvm", + ".ddev/.global_commands/web/wp", + ".ddev/.global_commands/web/artisan", + ".ddev/.global_commands/web/blackfire", + ".ddev/.global_commands/web/typo3", + ".ddev/.global_commands/web/README.txt", + ".ddev/.global_commands/web/drush.example", + ".ddev/.global_commands/web/drush", + ".ddev/.global_commands/.gitattributes", + ".ddev/.global_commands/db/psql", + ".ddev/.global_commands/db/mysql", + ".ddev/.global_commands/db/README.txt", + ".ddev/.global_commands/db/mysqldump.example", + ".ddev/.webimageBuild/Dockerfile", + ".ddev/.webimageBuild/Dockerfile.example", + ".ddev/.ddev-docker-compose-full.yaml", + ".ddev/.homeadditions/README.txt", + ".ddev/.homeadditions/bash_aliases.example", + ".ddev/apache/apache-site.conf", + ".ddev/apache/README.apache.txt", + ".ddev/apache/seconddocroot.conf.example" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/drupal8-govcms8/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/drupal8-govcms8.git /Users/chadcarlson/template-builder/templates/drupal8-govcms8/build/", + "git remote add project https://github.com/govCMS/GovCMS.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags", + "rm -rf .circleci", + "rm -rf .github", + "rm -rf .tugboat", + "composer remove php" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/drupal8-govcms8/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/drupal8-govcms8/files/ /Users/chadcarlson/template-builder/templates/drupal8-govcms8/build/", + "patch -p1 < /Users/chadcarlson/template-builder/templates/drupal8-govcms8/gitignore.patch", + "composer require platformsh/config-reader drush/drush:^10 drupal/redis --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php", + "composer config -g allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins", + "composer config allow-plugins.drupal/core-project-message true --no-plugins", + "composer config allow-plugins.cweagans/composer-patches true --no-plugins ", + "composer update -W --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php", + "rm -rf web/profiles/govcms", + "rsync -aP /Users/chadcarlson/template-builder/common/drupal9/ /Users/chadcarlson/template-builder/templates/drupal8-govcms8/build/" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir drupal8-govcms8 && cd drupal8-govcms8", + "git init", + "git remote add upstream https://github.com/govCMS/GovCMS.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs 2.12.0" + ], + "deps": [ + "composer require platformsh/config-reader drush/drush:^10 drupal/redis", + "composer config allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins", + "composer config allow-plugins.drupal/core-project-message true --no-plugins", + "composer config allow-plugins.cweagans/composer-patches true --no-plugins " + ] + } + } +} \ No newline at end of file diff --git a/migrations/drupal8-multisite.migrate.json b/migrations/drupal8-multisite.migrate.json new file mode 100644 index 000000000..257f17b8c --- /dev/null +++ b/migrations/drupal8-multisite.migrate.json @@ -0,0 +1,383 @@ +{ + "template": "drupal8-multisite", + "type": "php", + "type_version": "7.4", + "remote": { + "major_version": "8.9.20", + "repository": "https://github.com/drupal/recommended-project.git", + "latest_tag": "8.9.20" + }, + "last_updated_on": "2022-04-12-14:43:03", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.github/PULL_REQUEST_TEMPLATE.md", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.github/ISSUE_TEMPLATE/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.github/ISSUE_TEMPLATE/improvements.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.github/ISSUE_TEMPLATE/bug_report.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/psh-subsite-add.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/config/sync/first/.gitkeep", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/config/sync/second/.gitkeep", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/config/sync/main/.gitkeep", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/sites.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/first/settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/first/services.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/first/drushrc.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/default.settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/second/settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/second/services.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/second/drushrc.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/default/settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/default/services.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/default/drushrc.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/settings.platformsh.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/main/settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/main/services.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/main/drushrc.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/web/sites/default.services.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.environment", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/drush/platformsh_generate_drush_yml.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/php.ini", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.blackfire.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/web-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/xhprof/xhprof_prepend.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/db-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/providers/git.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/providers/pantheon.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/providers/localfile.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/providers/platform.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/providers/rsync.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/providers/acquia.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/providers/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/providers/platform.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/nginx_full/README.nginx_full.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/nginx_full/seconddocroot.conf.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/nginx_full/nginx-site.conf", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.dbimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.dbimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.downloads/files/eflat_spirit_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.downloads/files/iridescent_sladoje_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.downloads/files/pwyll_gal_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.downloads/files/.htaccess", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.ddev-docker-compose-base.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/commands/host/solrtail.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/commands/solr/solrtail.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/commands/solr/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/host/sequelpro", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/host/heidisql", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/host/tableplus", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/host/launch", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/host/phpstorm.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/host/yarn", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/host/mysqlworkbench.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/host/sequelace", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/xdebug", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/magento", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/typo3cms", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/xhprof", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/nvm", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/wp", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/artisan", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/blackfire", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/typo3", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/drush.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/web/drush", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/db/psql", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/db/mysql", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.global_commands/db/mysqldump.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.webimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.webimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.ddev-docker-compose-full.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/.homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/apache/apache-site.conf", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/apache/README.apache.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-multisite/master/.ddev/apache/seconddocroot.conf.example" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/PULL_REQUEST_TEMPLATE.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/improvements.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/bug_report.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/psh-subsite-add.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/config/sync/first/.gitkeep", + "https://raw.githubusercontent.com/platformsh/template-builder/master/config/sync/second/.gitkeep", + "https://raw.githubusercontent.com/platformsh/template-builder/master/config/sync/main/.gitkeep", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/sites.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/first/settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/first/services.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/first/drushrc.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default.settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/second/settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/second/services.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/second/drushrc.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default/settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default/services.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default/drushrc.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/settings.platformsh.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/main/settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/main/services.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/main/drushrc.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default.services.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.environment", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/drush/platformsh_generate_drush_yml.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/php.ini", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.blackfire.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/web-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/xhprof/xhprof_prepend.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/db-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/git.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/pantheon.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/localfile.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/platform.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/rsync.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/acquia.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/platform.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/README.nginx_full.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/seconddocroot.conf.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/nginx-site.conf", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.dbimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.dbimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/eflat_spirit_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/iridescent_sladoje_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/pwyll_gal_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/.htaccess", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.ddev-docker-compose-base.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/host/solrtail.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/solr/solrtail.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/solr/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/sequelpro", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/heidisql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/tableplus", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/launch", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/phpstorm.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/yarn", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/mysqlworkbench.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/sequelace", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/xdebug", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/magento", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/typo3cms", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/xhprof", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/nvm", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/wp", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/artisan", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/blackfire", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/typo3", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/drush.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/drush", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/psql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/mysql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/mysqldump.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.webimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.webimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.ddev-docker-compose-full.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/apache-site.conf", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/README.apache.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/seconddocroot.conf.example" + ], + "rel_root": [ + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/ISSUE_TEMPLATE/config.yaml", + ".github/ISSUE_TEMPLATE/improvements.yaml", + ".github/ISSUE_TEMPLATE/bug_report.yaml", + "psh-subsite-add.php", + "config/sync/first/.gitkeep", + "config/sync/second/.gitkeep", + "config/sync/main/.gitkeep", + "web/sites/sites.php", + "web/sites/first/settings.php", + "web/sites/first/services.yml", + "web/sites/first/drushrc.php", + "web/sites/default.settings.php", + "web/sites/second/settings.php", + "web/sites/second/services.yml", + "web/sites/second/drushrc.php", + "web/sites/default/settings.php", + "web/sites/default/services.yml", + "web/sites/default/drushrc.php", + "web/sites/settings.platformsh.php", + "web/sites/main/settings.php", + "web/sites/main/services.yml", + "web/sites/main/drushrc.php", + "web/sites/default.services.yml", + ".editorconfig", + ".environment", + "README.md", + ".gitignore", + ".lando.upstream.yml", + ".platform.app.yaml", + "drush/platformsh_generate_drush_yml.php", + ".platform/services.yaml", + ".platform/routes.yaml", + "php.ini", + ".blackfire.yml", + ".lando.upstream.yml", + ".ddev/web-build/Dockerfile.example", + ".ddev/xhprof/xhprof_prepend.php", + ".ddev/db-build/Dockerfile.example", + ".ddev/providers/git.yaml.example", + ".ddev/providers/pantheon.yaml.example", + ".ddev/providers/localfile.yaml.example", + ".ddev/providers/platform.yaml", + ".ddev/providers/rsync.yaml.example", + ".ddev/providers/acquia.yaml.example", + ".ddev/providers/README.txt", + ".ddev/providers/platform.yaml.example", + ".ddev/nginx_full/README.nginx_full.txt", + ".ddev/nginx_full/seconddocroot.conf.example", + ".ddev/nginx_full/nginx-site.conf", + ".ddev/.dbimageBuild/Dockerfile", + ".ddev/.dbimageBuild/Dockerfile.example", + ".ddev/config.yaml", + ".ddev/homeadditions/README.txt", + ".ddev/homeadditions/bash_aliases.example", + ".ddev/.downloads/files/eflat_spirit_big.jpg", + ".ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + ".ddev/.downloads/files/iridescent_sladoje_big.jpg", + ".ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + ".ddev/.downloads/files/pwyll_gal_big.jpg", + ".ddev/.downloads/files/.htaccess", + ".ddev/.ddev-docker-compose-base.yaml", + ".ddev/.gitignore", + ".ddev/commands/host/solrtail.example", + ".ddev/commands/host/README.txt", + ".ddev/commands/web/README.txt", + ".ddev/commands/solr/solrtail.example", + ".ddev/commands/solr/README.txt", + ".ddev/commands/.gitattributes", + ".ddev/commands/db/README.txt", + ".ddev/.global_commands/host/sequelpro", + ".ddev/.global_commands/host/heidisql", + ".ddev/.global_commands/host/tableplus", + ".ddev/.global_commands/host/launch", + ".ddev/.global_commands/host/phpstorm.example", + ".ddev/.global_commands/host/yarn", + ".ddev/.global_commands/host/README.txt", + ".ddev/.global_commands/host/mysqlworkbench.example", + ".ddev/.global_commands/host/sequelace", + ".ddev/.global_commands/web/xdebug", + ".ddev/.global_commands/web/magento", + ".ddev/.global_commands/web/typo3cms", + ".ddev/.global_commands/web/xhprof", + ".ddev/.global_commands/web/php", + ".ddev/.global_commands/web/nvm", + ".ddev/.global_commands/web/wp", + ".ddev/.global_commands/web/artisan", + ".ddev/.global_commands/web/blackfire", + ".ddev/.global_commands/web/typo3", + ".ddev/.global_commands/web/README.txt", + ".ddev/.global_commands/web/drush.example", + ".ddev/.global_commands/web/drush", + ".ddev/.global_commands/.gitattributes", + ".ddev/.global_commands/db/psql", + ".ddev/.global_commands/db/mysql", + ".ddev/.global_commands/db/README.txt", + ".ddev/.global_commands/db/mysqldump.example", + ".ddev/.webimageBuild/Dockerfile", + ".ddev/.webimageBuild/Dockerfile.example", + ".ddev/.ddev-docker-compose-full.yaml", + ".ddev/.homeadditions/README.txt", + ".ddev/.homeadditions/bash_aliases.example", + ".ddev/apache/apache-site.conf", + ".ddev/apache/README.apache.txt", + ".ddev/apache/seconddocroot.conf.example" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/drupal8-multisite/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/drupal8-multisite.git /Users/chadcarlson/template-builder/templates/drupal8-multisite/build/", + "git remote add project https://github.com/drupal/recommended-project.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/drupal8-multisite/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/drupal8-multisite/files/ /Users/chadcarlson/template-builder/templates/drupal8-multisite/build/", + "composer require platformsh/config-reader drush/drush:^10.6 drupal/console drupal/redis --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php", + "composer config -g allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins", + "composer config allow-plugins.drupal/core-project-message true --no-plugins", + "composer config allow-plugins.cweagans/composer-patches true --no-plugins ", + "rsync -aP /Users/chadcarlson/template-builder/common/drupal8/ /Users/chadcarlson/template-builder/templates/drupal8-multisite/build/" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir drupal8-multisite && cd drupal8-multisite", + "git init", + "git remote add upstream https://github.com/drupal/recommended-project.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs 8.9.20" + ], + "deps": [ + "composer require platformsh/config-reader drush/drush:^10.6 drupal/console drupal/redis", + "composer config allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins", + "composer config allow-plugins.drupal/core-project-message true --no-plugins", + "composer config allow-plugins.cweagans/composer-patches true --no-plugins " + ] + } + } +} \ No newline at end of file diff --git a/migrations/drupal8-opigno.migrate.json b/migrations/drupal8-opigno.migrate.json new file mode 100644 index 000000000..b89bb56a0 --- /dev/null +++ b/migrations/drupal8-opigno.migrate.json @@ -0,0 +1,336 @@ +{ + "template": "drupal8-opigno", + "type": "php", + "type_version": "7.4", + "remote": { + "major_version": "2.29.0", + "repository": "https://bitbucket.org/opigno/opigno-composer.git", + "latest_tag": "2.29.0" + }, + "last_updated_on": "2022-04-13-08:45:32", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.github/PULL_REQUEST_TEMPLATE.md", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.github/ISSUE_TEMPLATE/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.github/ISSUE_TEMPLATE/improvements.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.github/ISSUE_TEMPLATE/bug_report.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/config/sync/.gitkeep", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/web/sites/default/settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/web/sites/default/settings.platformsh.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.environment", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/drush/platformsh_generate_drush_yml.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/header.svg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/php.ini", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.blackfire.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/web-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/xhprof/xhprof_prepend.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/db-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/providers/git.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/providers/pantheon.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/providers/localfile.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/providers/platform.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/providers/rsync.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/providers/acquia.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/providers/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/providers/platform.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/nginx_full/README.nginx_full.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/nginx_full/seconddocroot.conf.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/nginx_full/nginx-site.conf", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.dbimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.dbimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.downloads/files/eflat_spirit_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.downloads/files/iridescent_sladoje_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.downloads/files/pwyll_gal_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.downloads/files/.htaccess", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.ddev-docker-compose-base.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/commands/host/solrtail.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/commands/solr/solrtail.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/commands/solr/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/host/sequelpro", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/host/heidisql", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/host/tableplus", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/host/launch", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/host/phpstorm.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/host/yarn", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/host/mysqlworkbench.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/host/sequelace", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/xdebug", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/magento", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/typo3cms", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/xhprof", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/nvm", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/wp", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/artisan", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/blackfire", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/typo3", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/drush.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/web/drush", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/db/psql", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/db/mysql", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.global_commands/db/mysqldump.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.webimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.webimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.ddev-docker-compose-full.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/.homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/apache/apache-site.conf", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/apache/README.apache.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8-opigno/master/.ddev/apache/seconddocroot.conf.example" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/PULL_REQUEST_TEMPLATE.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/improvements.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/bug_report.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/config/sync/.gitkeep", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default/settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default/settings.platformsh.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.environment", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/drush/platformsh_generate_drush_yml.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/header.svg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/php.ini", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.blackfire.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/web-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/xhprof/xhprof_prepend.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/db-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/git.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/pantheon.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/localfile.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/platform.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/rsync.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/acquia.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/platform.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/README.nginx_full.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/seconddocroot.conf.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/nginx-site.conf", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.dbimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.dbimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/eflat_spirit_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/iridescent_sladoje_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/pwyll_gal_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/.htaccess", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.ddev-docker-compose-base.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/host/solrtail.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/solr/solrtail.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/solr/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/sequelpro", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/heidisql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/tableplus", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/launch", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/phpstorm.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/yarn", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/mysqlworkbench.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/sequelace", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/xdebug", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/magento", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/typo3cms", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/xhprof", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/nvm", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/wp", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/artisan", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/blackfire", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/typo3", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/drush.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/drush", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/psql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/mysql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/mysqldump.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.webimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.webimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.ddev-docker-compose-full.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/apache-site.conf", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/README.apache.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/seconddocroot.conf.example" + ], + "rel_root": [ + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/ISSUE_TEMPLATE/config.yaml", + ".github/ISSUE_TEMPLATE/improvements.yaml", + ".github/ISSUE_TEMPLATE/bug_report.yaml", + "config/sync/.gitkeep", + "web/sites/default/settings.php", + "web/sites/default/settings.platformsh.php", + ".editorconfig", + ".environment", + "README.md", + ".gitignore", + ".lando.upstream.yml", + ".platform.app.yaml", + "drush/platformsh_generate_drush_yml.php", + "header.svg", + ".platform/services.yaml", + ".platform/routes.yaml", + "php.ini", + ".blackfire.yml", + ".lando.upstream.yml", + ".ddev/web-build/Dockerfile.example", + ".ddev/xhprof/xhprof_prepend.php", + ".ddev/db-build/Dockerfile.example", + ".ddev/providers/git.yaml.example", + ".ddev/providers/pantheon.yaml.example", + ".ddev/providers/localfile.yaml.example", + ".ddev/providers/platform.yaml", + ".ddev/providers/rsync.yaml.example", + ".ddev/providers/acquia.yaml.example", + ".ddev/providers/README.txt", + ".ddev/providers/platform.yaml.example", + ".ddev/nginx_full/README.nginx_full.txt", + ".ddev/nginx_full/seconddocroot.conf.example", + ".ddev/nginx_full/nginx-site.conf", + ".ddev/.dbimageBuild/Dockerfile", + ".ddev/.dbimageBuild/Dockerfile.example", + ".ddev/config.yaml", + ".ddev/homeadditions/README.txt", + ".ddev/homeadditions/bash_aliases.example", + ".ddev/.downloads/files/eflat_spirit_big.jpg", + ".ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + ".ddev/.downloads/files/iridescent_sladoje_big.jpg", + ".ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + ".ddev/.downloads/files/pwyll_gal_big.jpg", + ".ddev/.downloads/files/.htaccess", + ".ddev/.ddev-docker-compose-base.yaml", + ".ddev/.gitignore", + ".ddev/commands/host/solrtail.example", + ".ddev/commands/host/README.txt", + ".ddev/commands/web/README.txt", + ".ddev/commands/solr/solrtail.example", + ".ddev/commands/solr/README.txt", + ".ddev/commands/.gitattributes", + ".ddev/commands/db/README.txt", + ".ddev/.global_commands/host/sequelpro", + ".ddev/.global_commands/host/heidisql", + ".ddev/.global_commands/host/tableplus", + ".ddev/.global_commands/host/launch", + ".ddev/.global_commands/host/phpstorm.example", + ".ddev/.global_commands/host/yarn", + ".ddev/.global_commands/host/README.txt", + ".ddev/.global_commands/host/mysqlworkbench.example", + ".ddev/.global_commands/host/sequelace", + ".ddev/.global_commands/web/xdebug", + ".ddev/.global_commands/web/magento", + ".ddev/.global_commands/web/typo3cms", + ".ddev/.global_commands/web/xhprof", + ".ddev/.global_commands/web/php", + ".ddev/.global_commands/web/nvm", + ".ddev/.global_commands/web/wp", + ".ddev/.global_commands/web/artisan", + ".ddev/.global_commands/web/blackfire", + ".ddev/.global_commands/web/typo3", + ".ddev/.global_commands/web/README.txt", + ".ddev/.global_commands/web/drush.example", + ".ddev/.global_commands/web/drush", + ".ddev/.global_commands/.gitattributes", + ".ddev/.global_commands/db/psql", + ".ddev/.global_commands/db/mysql", + ".ddev/.global_commands/db/README.txt", + ".ddev/.global_commands/db/mysqldump.example", + ".ddev/.webimageBuild/Dockerfile", + ".ddev/.webimageBuild/Dockerfile.example", + ".ddev/.ddev-docker-compose-full.yaml", + ".ddev/.homeadditions/README.txt", + ".ddev/.homeadditions/bash_aliases.example", + ".ddev/apache/apache-site.conf", + ".ddev/apache/README.apache.txt", + ".ddev/apache/seconddocroot.conf.example" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/drupal8-opigno/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/drupal8-opigno.git /Users/chadcarlson/template-builder/templates/drupal8-opigno/build/", + "git remote add project https://bitbucket.org/opigno/opigno-composer.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/drupal8-opigno/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/drupal8-opigno/files/ /Users/chadcarlson/template-builder/templates/drupal8-opigno/build/", + "composer require platformsh/config-reader drush/drush:^9.1 drupal/console drupal/redis psr/cache:^1.0 --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php", + "composer config -g allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins", + "composer config allow-plugins.drupal/core-project-message true --no-plugins", + "composer config allow-plugins.cweagans/composer-patches true --no-plugins ", + "composer update -W --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php", + "rsync -aP /Users/chadcarlson/template-builder/common/drupal8/ /Users/chadcarlson/template-builder/templates/drupal8-opigno/build/" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir drupal8-opigno && cd drupal8-opigno", + "git init", + "git remote add upstream https://bitbucket.org/opigno/opigno-composer.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs 2.29.0" + ], + "deps": [ + "composer require platformsh/config-reader drush/drush:^9.1 drupal/console drupal/redis psr/cache:^1.0", + "composer config allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins", + "composer config allow-plugins.drupal/core-project-message true --no-plugins", + "composer config allow-plugins.cweagans/composer-patches true --no-plugins " + ] + } + } +} \ No newline at end of file diff --git a/migrations/drupal8.migrate.json b/migrations/drupal8.migrate.json new file mode 100644 index 000000000..2555c8036 --- /dev/null +++ b/migrations/drupal8.migrate.json @@ -0,0 +1,335 @@ +{ + "template": "drupal8", + "type": "php", + "type_version": "7.4", + "remote": { + "major_version": "8.9.20", + "repository": "https://github.com/drupal/recommended-project.git", + "latest_tag": "8.9.20" + }, + "last_updated_on": "2022-04-12-14:54:40", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.github/PULL_REQUEST_TEMPLATE.md", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.github/ISSUE_TEMPLATE/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.github/ISSUE_TEMPLATE/improvements.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.github/ISSUE_TEMPLATE/bug_report.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/config/sync/.gitkeep", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/web/sites/default/settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/web/sites/default/settings.platformsh.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.environment", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/drush/platformsh_generate_drush_yml.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/header.svg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/php.ini", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.blackfire.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/web-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/xhprof/xhprof_prepend.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/db-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/providers/git.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/providers/pantheon.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/providers/localfile.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/providers/platform.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/providers/rsync.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/providers/acquia.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/providers/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/providers/platform.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/nginx_full/README.nginx_full.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/nginx_full/seconddocroot.conf.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/nginx_full/nginx-site.conf", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.dbimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.dbimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.downloads/files/eflat_spirit_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.downloads/files/iridescent_sladoje_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.downloads/files/pwyll_gal_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.downloads/files/.htaccess", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.ddev-docker-compose-base.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/commands/host/solrtail.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/commands/solr/solrtail.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/commands/solr/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/host/sequelpro", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/host/heidisql", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/host/tableplus", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/host/launch", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/host/phpstorm.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/host/yarn", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/host/mysqlworkbench.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/host/sequelace", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/xdebug", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/magento", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/typo3cms", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/xhprof", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/php", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/nvm", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/wp", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/artisan", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/blackfire", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/typo3", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/drush.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/web/drush", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/db/psql", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/db/mysql", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.global_commands/db/mysqldump.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.webimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.webimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.ddev-docker-compose-full.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/.homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/apache/apache-site.conf", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/apache/README.apache.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal8/master/.ddev/apache/seconddocroot.conf.example" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/PULL_REQUEST_TEMPLATE.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/improvements.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/bug_report.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/config/sync/.gitkeep", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default/settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default/settings.platformsh.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.environment", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/drush/platformsh_generate_drush_yml.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/header.svg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/php.ini", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.blackfire.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/web-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/xhprof/xhprof_prepend.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/db-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/git.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/pantheon.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/localfile.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/platform.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/rsync.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/acquia.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/platform.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/README.nginx_full.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/seconddocroot.conf.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/nginx-site.conf", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.dbimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.dbimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/eflat_spirit_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/iridescent_sladoje_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/pwyll_gal_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/.htaccess", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.ddev-docker-compose-base.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/host/solrtail.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/solr/solrtail.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/solr/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/sequelpro", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/heidisql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/tableplus", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/launch", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/phpstorm.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/yarn", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/mysqlworkbench.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/sequelace", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/xdebug", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/magento", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/typo3cms", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/xhprof", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/nvm", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/wp", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/artisan", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/blackfire", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/typo3", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/drush.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/drush", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/psql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/mysql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/mysqldump.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.webimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.webimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.ddev-docker-compose-full.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/apache-site.conf", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/README.apache.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/seconddocroot.conf.example" + ], + "rel_root": [ + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/ISSUE_TEMPLATE/config.yaml", + ".github/ISSUE_TEMPLATE/improvements.yaml", + ".github/ISSUE_TEMPLATE/bug_report.yaml", + "config/sync/.gitkeep", + "web/sites/default/settings.php", + "web/sites/default/settings.platformsh.php", + ".editorconfig", + ".environment", + "README.md", + ".gitignore", + ".lando.upstream.yml", + ".platform.app.yaml", + "drush/platformsh_generate_drush_yml.php", + "header.svg", + ".platform/services.yaml", + ".platform/routes.yaml", + "php.ini", + ".blackfire.yml", + ".lando.upstream.yml", + ".ddev/web-build/Dockerfile.example", + ".ddev/xhprof/xhprof_prepend.php", + ".ddev/db-build/Dockerfile.example", + ".ddev/providers/git.yaml.example", + ".ddev/providers/pantheon.yaml.example", + ".ddev/providers/localfile.yaml.example", + ".ddev/providers/platform.yaml", + ".ddev/providers/rsync.yaml.example", + ".ddev/providers/acquia.yaml.example", + ".ddev/providers/README.txt", + ".ddev/providers/platform.yaml.example", + ".ddev/nginx_full/README.nginx_full.txt", + ".ddev/nginx_full/seconddocroot.conf.example", + ".ddev/nginx_full/nginx-site.conf", + ".ddev/.dbimageBuild/Dockerfile", + ".ddev/.dbimageBuild/Dockerfile.example", + ".ddev/config.yaml", + ".ddev/homeadditions/README.txt", + ".ddev/homeadditions/bash_aliases.example", + ".ddev/.downloads/files/eflat_spirit_big.jpg", + ".ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + ".ddev/.downloads/files/iridescent_sladoje_big.jpg", + ".ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + ".ddev/.downloads/files/pwyll_gal_big.jpg", + ".ddev/.downloads/files/.htaccess", + ".ddev/.ddev-docker-compose-base.yaml", + ".ddev/.gitignore", + ".ddev/commands/host/solrtail.example", + ".ddev/commands/host/README.txt", + ".ddev/commands/web/README.txt", + ".ddev/commands/solr/solrtail.example", + ".ddev/commands/solr/README.txt", + ".ddev/commands/.gitattributes", + ".ddev/commands/db/README.txt", + ".ddev/.global_commands/host/sequelpro", + ".ddev/.global_commands/host/heidisql", + ".ddev/.global_commands/host/tableplus", + ".ddev/.global_commands/host/launch", + ".ddev/.global_commands/host/phpstorm.example", + ".ddev/.global_commands/host/yarn", + ".ddev/.global_commands/host/README.txt", + ".ddev/.global_commands/host/mysqlworkbench.example", + ".ddev/.global_commands/host/sequelace", + ".ddev/.global_commands/web/xdebug", + ".ddev/.global_commands/web/magento", + ".ddev/.global_commands/web/typo3cms", + ".ddev/.global_commands/web/xhprof", + ".ddev/.global_commands/web/php", + ".ddev/.global_commands/web/nvm", + ".ddev/.global_commands/web/wp", + ".ddev/.global_commands/web/artisan", + ".ddev/.global_commands/web/blackfire", + ".ddev/.global_commands/web/typo3", + ".ddev/.global_commands/web/README.txt", + ".ddev/.global_commands/web/drush.example", + ".ddev/.global_commands/web/drush", + ".ddev/.global_commands/.gitattributes", + ".ddev/.global_commands/db/psql", + ".ddev/.global_commands/db/mysql", + ".ddev/.global_commands/db/README.txt", + ".ddev/.global_commands/db/mysqldump.example", + ".ddev/.webimageBuild/Dockerfile", + ".ddev/.webimageBuild/Dockerfile.example", + ".ddev/.ddev-docker-compose-full.yaml", + ".ddev/.homeadditions/README.txt", + ".ddev/.homeadditions/bash_aliases.example", + ".ddev/apache/apache-site.conf", + ".ddev/apache/README.apache.txt", + ".ddev/apache/seconddocroot.conf.example" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/drupal8/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/drupal8.git /Users/chadcarlson/template-builder/templates/drupal8/build/", + "git remote add project https://github.com/drupal/recommended-project.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/drupal8/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/drupal8/files/ /Users/chadcarlson/template-builder/templates/drupal8/build/", + "composer require platformsh/config-reader drush/drush:^10.6 drupal/console drupal/redis --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php", + "composer config -g allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins", + "composer config allow-plugins.drupal/core-project-message true --no-plugins", + "composer config allow-plugins.cweagans/composer-patches true --no-plugins ", + "rsync -aP /Users/chadcarlson/template-builder/common/drupal8/ /Users/chadcarlson/template-builder/templates/drupal8/build/" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir drupal8 && cd drupal8", + "git init", + "git remote add upstream https://github.com/drupal/recommended-project.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs 8.9.20" + ], + "deps": [ + "composer require platformsh/config-reader drush/drush:^10.6 drupal/console drupal/redis", + "composer config allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins", + "composer config allow-plugins.drupal/core-project-message true --no-plugins", + "composer config allow-plugins.cweagans/composer-patches true --no-plugins " + ] + } + } +} \ No newline at end of file diff --git a/migrations/drupal9-multisite.migrate.json b/migrations/drupal9-multisite.migrate.json new file mode 100644 index 000000000..5a30943b7 --- /dev/null +++ b/migrations/drupal9-multisite.migrate.json @@ -0,0 +1,386 @@ +{ + "template": "drupal9-multisite", + "type": "php", + "type_version": "8.0", + "remote": { + "major_version": "9.3.9", + "repository": "https://github.com/drupal/recommended-project.git", + "latest_tag": "9.3.9" + }, + "last_updated_on": "2022-04-12-11:56:47", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.github/PULL_REQUEST_TEMPLATE.md", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.github/ISSUE_TEMPLATE/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.github/ISSUE_TEMPLATE/improvements.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.github/ISSUE_TEMPLATE/bug_report.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/psh-subsite-add.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/config/sync/first/.gitkeep", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/config/sync/second/.gitkeep", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/config/sync/main/.gitkeep", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/sites.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/first/settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/first/services.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/first/drushrc.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/default.settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/second/settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/second/services.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/second/drushrc.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/default/settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/default/services.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/default/drushrc.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/settings.platformsh.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/main/settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/main/services.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/main/drushrc.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/web/sites/default.services.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.environment", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/drush/platformsh_generate_drush_yml.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/header.svg", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/php.ini", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.blackfire.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/web-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/xhprof/xhprof_prepend.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/db-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/providers/git.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/providers/pantheon.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/providers/localfile.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/providers/platform.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/providers/rsync.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/providers/acquia.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/providers/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/providers/platform.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/nginx_full/README.nginx_full.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/nginx_full/seconddocroot.conf.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/nginx_full/nginx-site.conf", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.dbimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.dbimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.downloads/files/eflat_spirit_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.downloads/files/iridescent_sladoje_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.downloads/files/pwyll_gal_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.downloads/files/.htaccess", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.ddev-docker-compose-base.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/commands/host/solrtail.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/commands/solr/solrtail.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/commands/solr/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/host/sequelpro", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/host/heidisql", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/host/tableplus", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/host/launch", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/host/phpstorm.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/host/yarn", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/host/mysqlworkbench.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/host/sequelace", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/xdebug", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/magento", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/typo3cms", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/xhprof", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/nvm", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/wp", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/artisan", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/blackfire", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/typo3", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/drush.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/web/drush", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/db/psql", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/db/mysql", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.global_commands/db/mysqldump.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.webimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.webimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.ddev-docker-compose-full.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/.homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/apache/apache-site.conf", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/apache/README.apache.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9-multisite/master/.ddev/apache/seconddocroot.conf.example" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/PULL_REQUEST_TEMPLATE.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/improvements.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/bug_report.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/psh-subsite-add.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/config/sync/first/.gitkeep", + "https://raw.githubusercontent.com/platformsh/template-builder/master/config/sync/second/.gitkeep", + "https://raw.githubusercontent.com/platformsh/template-builder/master/config/sync/main/.gitkeep", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/sites.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/first/settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/first/services.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/first/drushrc.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default.settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/second/settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/second/services.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/second/drushrc.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default/settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default/services.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default/drushrc.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/settings.platformsh.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/main/settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/main/services.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/main/drushrc.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default.services.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.environment", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/drush/platformsh_generate_drush_yml.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/header.svg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/php.ini", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.blackfire.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/web-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/xhprof/xhprof_prepend.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/db-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/git.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/pantheon.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/localfile.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/platform.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/rsync.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/acquia.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/platform.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/README.nginx_full.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/seconddocroot.conf.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/nginx-site.conf", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.dbimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.dbimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/eflat_spirit_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/iridescent_sladoje_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/pwyll_gal_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/.htaccess", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.ddev-docker-compose-base.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/host/solrtail.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/solr/solrtail.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/solr/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/sequelpro", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/heidisql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/tableplus", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/launch", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/phpstorm.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/yarn", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/mysqlworkbench.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/sequelace", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/xdebug", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/magento", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/typo3cms", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/xhprof", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/nvm", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/wp", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/artisan", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/blackfire", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/typo3", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/drush.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/drush", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/psql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/mysql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/mysqldump.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.webimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.webimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.ddev-docker-compose-full.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/apache-site.conf", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/README.apache.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/seconddocroot.conf.example" + ], + "rel_root": [ + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/ISSUE_TEMPLATE/config.yaml", + ".github/ISSUE_TEMPLATE/improvements.yaml", + ".github/ISSUE_TEMPLATE/bug_report.yaml", + "psh-subsite-add.php", + "config/sync/first/.gitkeep", + "config/sync/second/.gitkeep", + "config/sync/main/.gitkeep", + "web/sites/sites.php", + "web/sites/first/settings.php", + "web/sites/first/services.yml", + "web/sites/first/drushrc.php", + "web/sites/default.settings.php", + "web/sites/second/settings.php", + "web/sites/second/services.yml", + "web/sites/second/drushrc.php", + "web/sites/default/settings.php", + "web/sites/default/services.yml", + "web/sites/default/drushrc.php", + "web/sites/settings.platformsh.php", + "web/sites/main/settings.php", + "web/sites/main/services.yml", + "web/sites/main/drushrc.php", + "web/sites/default.services.yml", + ".editorconfig", + ".environment", + "README.md", + ".gitignore", + ".lando.upstream.yml", + ".platform.app.yaml", + "drush/platformsh_generate_drush_yml.php", + "header.svg", + ".platform/services.yaml", + ".platform/routes.yaml", + "php.ini", + ".blackfire.yml", + ".lando.upstream.yml", + ".ddev/web-build/Dockerfile.example", + ".ddev/xhprof/xhprof_prepend.php", + ".ddev/db-build/Dockerfile.example", + ".ddev/providers/git.yaml.example", + ".ddev/providers/pantheon.yaml.example", + ".ddev/providers/localfile.yaml.example", + ".ddev/providers/platform.yaml", + ".ddev/providers/rsync.yaml.example", + ".ddev/providers/acquia.yaml.example", + ".ddev/providers/README.txt", + ".ddev/providers/platform.yaml.example", + ".ddev/nginx_full/README.nginx_full.txt", + ".ddev/nginx_full/seconddocroot.conf.example", + ".ddev/nginx_full/nginx-site.conf", + ".ddev/.dbimageBuild/Dockerfile", + ".ddev/.dbimageBuild/Dockerfile.example", + ".ddev/config.yaml", + ".ddev/homeadditions/README.txt", + ".ddev/homeadditions/bash_aliases.example", + ".ddev/.downloads/files/eflat_spirit_big.jpg", + ".ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + ".ddev/.downloads/files/iridescent_sladoje_big.jpg", + ".ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + ".ddev/.downloads/files/pwyll_gal_big.jpg", + ".ddev/.downloads/files/.htaccess", + ".ddev/.ddev-docker-compose-base.yaml", + ".ddev/.gitignore", + ".ddev/commands/host/solrtail.example", + ".ddev/commands/host/README.txt", + ".ddev/commands/web/README.txt", + ".ddev/commands/solr/solrtail.example", + ".ddev/commands/solr/README.txt", + ".ddev/commands/.gitattributes", + ".ddev/commands/db/README.txt", + ".ddev/.global_commands/host/sequelpro", + ".ddev/.global_commands/host/heidisql", + ".ddev/.global_commands/host/tableplus", + ".ddev/.global_commands/host/launch", + ".ddev/.global_commands/host/phpstorm.example", + ".ddev/.global_commands/host/yarn", + ".ddev/.global_commands/host/README.txt", + ".ddev/.global_commands/host/mysqlworkbench.example", + ".ddev/.global_commands/host/sequelace", + ".ddev/.global_commands/web/xdebug", + ".ddev/.global_commands/web/magento", + ".ddev/.global_commands/web/typo3cms", + ".ddev/.global_commands/web/xhprof", + ".ddev/.global_commands/web/php", + ".ddev/.global_commands/web/nvm", + ".ddev/.global_commands/web/wp", + ".ddev/.global_commands/web/artisan", + ".ddev/.global_commands/web/blackfire", + ".ddev/.global_commands/web/typo3", + ".ddev/.global_commands/web/README.txt", + ".ddev/.global_commands/web/drush.example", + ".ddev/.global_commands/web/drush", + ".ddev/.global_commands/.gitattributes", + ".ddev/.global_commands/db/psql", + ".ddev/.global_commands/db/mysql", + ".ddev/.global_commands/db/README.txt", + ".ddev/.global_commands/db/mysqldump.example", + ".ddev/.webimageBuild/Dockerfile", + ".ddev/.webimageBuild/Dockerfile.example", + ".ddev/.ddev-docker-compose-full.yaml", + ".ddev/.homeadditions/README.txt", + ".ddev/.homeadditions/bash_aliases.example", + ".ddev/apache/apache-site.conf", + ".ddev/apache/README.apache.txt", + ".ddev/apache/seconddocroot.conf.example" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/drupal9-multisite/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/drupal9-multisite.git /Users/chadcarlson/template-builder/templates/drupal9-multisite/build/", + "git remote add project https://github.com/drupal/recommended-project.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/drupal9-multisite/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/drupal9-multisite/files/ /Users/chadcarlson/template-builder/templates/drupal9-multisite/build/", + "composer require platformsh/config-reader drush/drush drupal/redis --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php", + "composer config -g allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins", + "composer config allow-plugins.drupal/core-project-message true --no-plugins", + "composer config allow-plugins.cweagans/composer-patches true --no-plugins ", + "rsync -aP /Users/chadcarlson/template-builder/common/drupal9/ /Users/chadcarlson/template-builder/templates/drupal9-multisite/build/" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir drupal9-multisite && cd drupal9-multisite", + "git init", + "git remote add upstream https://github.com/drupal/recommended-project.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs 9.3.9" + ], + "deps": [ + "composer require platformsh/config-reader drush/drush drupal/redis", + "composer config allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins", + "composer config allow-plugins.drupal/core-project-message true --no-plugins", + "composer config allow-plugins.cweagans/composer-patches true --no-plugins " + ] + } + } +} \ No newline at end of file diff --git a/migrations/drupal9.migrate.json b/migrations/drupal9.migrate.json new file mode 100644 index 000000000..a267ec709 --- /dev/null +++ b/migrations/drupal9.migrate.json @@ -0,0 +1,332 @@ +{ + "template": "drupal9", + "type": "php", + "type_version": "8.0", + "remote": { + "major_version": "9.3.9", + "repository": "https://github.com/drupal/recommended-project.git", + "latest_tag": "9.3.9" + }, + "last_updated_on": "2022-04-12-14:25:35", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.github/PULL_REQUEST_TEMPLATE.md", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.github/ISSUE_TEMPLATE/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.github/ISSUE_TEMPLATE/improvements.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.github/ISSUE_TEMPLATE/bug_report.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/config/sync/.gitkeep", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/web/sites/default/settings.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/web/sites/default/settings.platformsh.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.environment", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/drush/platformsh_generate_drush_yml.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/header.svg", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/php.ini", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.blackfire.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/web-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/xhprof/xhprof_prepend.php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/db-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/providers/git.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/providers/pantheon.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/providers/localfile.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/providers/platform.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/providers/rsync.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/providers/acquia.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/providers/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/providers/platform.yaml.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/nginx_full/README.nginx_full.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/nginx_full/seconddocroot.conf.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/nginx_full/nginx-site.conf", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.dbimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.dbimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.downloads/files/eflat_spirit_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.downloads/files/iridescent_sladoje_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.downloads/files/pwyll_gal_big.jpg", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.downloads/files/.htaccess", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.ddev-docker-compose-base.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/commands/host/solrtail.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/commands/solr/solrtail.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/commands/solr/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/host/sequelpro", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/host/heidisql", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/host/tableplus", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/host/launch", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/host/phpstorm.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/host/yarn", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/host/mysqlworkbench.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/host/sequelace", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/xdebug", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/magento", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/typo3cms", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/xhprof", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/php", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/nvm", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/wp", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/artisan", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/blackfire", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/typo3", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/drush.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/web/drush", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/db/psql", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/db/mysql", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.global_commands/db/mysqldump.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.webimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.webimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.ddev-docker-compose-full.yaml", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/.homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/apache/apache-site.conf", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/apache/README.apache.txt", + "https://raw.githubusercontent.com/platformsh-templates/drupal9/master/.ddev/apache/seconddocroot.conf.example" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/PULL_REQUEST_TEMPLATE.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/improvements.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.github/ISSUE_TEMPLATE/bug_report.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/config/sync/.gitkeep", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default/settings.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/web/sites/default/settings.platformsh.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.environment", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/drush/platformsh_generate_drush_yml.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/header.svg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/php.ini", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.blackfire.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/web-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/xhprof/xhprof_prepend.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/db-build/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/git.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/pantheon.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/localfile.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/platform.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/rsync.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/acquia.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/providers/platform.yaml.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/README.nginx_full.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/seconddocroot.conf.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/nginx_full/nginx-site.conf", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.dbimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.dbimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/eflat_spirit_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/iridescent_sladoje_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/pwyll_gal_big.jpg", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.downloads/files/.htaccess", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.ddev-docker-compose-base.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/host/solrtail.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/solr/solrtail.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/solr/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/sequelpro", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/heidisql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/tableplus", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/launch", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/phpstorm.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/yarn", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/mysqlworkbench.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/host/sequelace", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/xdebug", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/magento", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/typo3cms", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/xhprof", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/nvm", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/wp", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/artisan", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/blackfire", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/typo3", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/drush.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/web/drush", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/.gitattributes", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/psql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/mysql", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.global_commands/db/mysqldump.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.webimageBuild/Dockerfile", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.webimageBuild/Dockerfile.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.ddev-docker-compose-full.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.homeadditions/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/.homeadditions/bash_aliases.example", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/apache-site.conf", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/README.apache.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.ddev/apache/seconddocroot.conf.example" + ], + "rel_root": [ + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/ISSUE_TEMPLATE/config.yaml", + ".github/ISSUE_TEMPLATE/improvements.yaml", + ".github/ISSUE_TEMPLATE/bug_report.yaml", + "config/sync/.gitkeep", + "web/sites/default/settings.php", + "web/sites/default/settings.platformsh.php", + ".editorconfig", + ".environment", + "README.md", + ".gitignore", + ".platform.app.yaml", + "drush/platformsh_generate_drush_yml.php", + "header.svg", + ".platform/services.yaml", + ".platform/routes.yaml", + "php.ini", + ".blackfire.yml", + ".lando.upstream.yml", + ".ddev/web-build/Dockerfile.example", + ".ddev/xhprof/xhprof_prepend.php", + ".ddev/db-build/Dockerfile.example", + ".ddev/providers/git.yaml.example", + ".ddev/providers/pantheon.yaml.example", + ".ddev/providers/localfile.yaml.example", + ".ddev/providers/platform.yaml", + ".ddev/providers/rsync.yaml.example", + ".ddev/providers/acquia.yaml.example", + ".ddev/providers/README.txt", + ".ddev/providers/platform.yaml.example", + ".ddev/nginx_full/README.nginx_full.txt", + ".ddev/nginx_full/seconddocroot.conf.example", + ".ddev/nginx_full/nginx-site.conf", + ".ddev/.dbimageBuild/Dockerfile", + ".ddev/.dbimageBuild/Dockerfile.example", + ".ddev/config.yaml", + ".ddev/homeadditions/README.txt", + ".ddev/homeadditions/bash_aliases.example", + ".ddev/.downloads/files/eflat_spirit_big.jpg", + ".ddev/.downloads/files/CeresOccator_Dawn_1200.jpg", + ".ddev/.downloads/files/iridescent_sladoje_big.jpg", + ".ddev/.downloads/files/vdb142_hendenkelly_big.jpg", + ".ddev/.downloads/files/pwyll_gal_big.jpg", + ".ddev/.downloads/files/.htaccess", + ".ddev/.ddev-docker-compose-base.yaml", + ".ddev/.gitignore", + ".ddev/commands/host/solrtail.example", + ".ddev/commands/host/README.txt", + ".ddev/commands/web/README.txt", + ".ddev/commands/solr/solrtail.example", + ".ddev/commands/solr/README.txt", + ".ddev/commands/.gitattributes", + ".ddev/commands/db/README.txt", + ".ddev/.global_commands/host/sequelpro", + ".ddev/.global_commands/host/heidisql", + ".ddev/.global_commands/host/tableplus", + ".ddev/.global_commands/host/launch", + ".ddev/.global_commands/host/phpstorm.example", + ".ddev/.global_commands/host/yarn", + ".ddev/.global_commands/host/README.txt", + ".ddev/.global_commands/host/mysqlworkbench.example", + ".ddev/.global_commands/host/sequelace", + ".ddev/.global_commands/web/xdebug", + ".ddev/.global_commands/web/magento", + ".ddev/.global_commands/web/typo3cms", + ".ddev/.global_commands/web/xhprof", + ".ddev/.global_commands/web/php", + ".ddev/.global_commands/web/nvm", + ".ddev/.global_commands/web/wp", + ".ddev/.global_commands/web/artisan", + ".ddev/.global_commands/web/blackfire", + ".ddev/.global_commands/web/typo3", + ".ddev/.global_commands/web/README.txt", + ".ddev/.global_commands/web/drush.example", + ".ddev/.global_commands/web/drush", + ".ddev/.global_commands/.gitattributes", + ".ddev/.global_commands/db/psql", + ".ddev/.global_commands/db/mysql", + ".ddev/.global_commands/db/README.txt", + ".ddev/.global_commands/db/mysqldump.example", + ".ddev/.webimageBuild/Dockerfile", + ".ddev/.webimageBuild/Dockerfile.example", + ".ddev/.ddev-docker-compose-full.yaml", + ".ddev/.homeadditions/README.txt", + ".ddev/.homeadditions/bash_aliases.example", + ".ddev/apache/apache-site.conf", + ".ddev/apache/README.apache.txt", + ".ddev/apache/seconddocroot.conf.example" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/drupal9/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/drupal9.git /Users/chadcarlson/template-builder/templates/drupal9/build/", + "git remote add project https://github.com/drupal/recommended-project.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/drupal9/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/drupal9/files/ /Users/chadcarlson/template-builder/templates/drupal9/build/", + "composer require platformsh/config-reader drush/drush drupal/redis --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php", + "composer config -g allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins", + "composer config allow-plugins.drupal/core-project-message true --no-plugins", + "composer config allow-plugins.cweagans/composer-patches true --no-plugins ", + "rsync -aP /Users/chadcarlson/template-builder/common/drupal9/ /Users/chadcarlson/template-builder/templates/drupal9/build/" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir drupal9 && cd drupal9", + "git init", + "git remote add upstream https://github.com/drupal/recommended-project.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs 9.3.9" + ], + "deps": [ + "composer require platformsh/config-reader drush/drush drupal/redis", + "composer config allow-plugins.composer/installers true --no-plugins", + "composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins", + "composer config allow-plugins.drupal/core-project-message true --no-plugins", + "composer config allow-plugins.cweagans/composer-patches true --no-plugins " + ] + } + } +} \ No newline at end of file diff --git a/migrations/gatsby.migrate.json b/migrations/gatsby.migrate.json new file mode 100644 index 000000000..730066dd4 --- /dev/null +++ b/migrations/gatsby.migrate.json @@ -0,0 +1,69 @@ +{ + "template": "gatsby", + "type": "nodejs", + "type_version": "16", + "remote": { + "major_version": "master", + "repository": "https://github.com/gatsbyjs/gatsby-starter-blog.git", + "latest_tag": null + }, + "last_updated_on": "2022-04-05-13:59:54", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/gatsby/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/gatsby/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/gatsby/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/gatsby/master/.platform/routes.yaml" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml" + ], + "rel_root": [ + "README.md", + ".platform.app.yaml", + ".platform/services.yaml", + ".platform/routes.yaml" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/gatsby/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/gatsby.git /Users/chadcarlson/template-builder/templates/gatsby/build/", + "git remote add project https://github.com/gatsbyjs/gatsby-starter-blog.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs --squash project/master" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/gatsby/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/gatsby/files/ /Users/chadcarlson/template-builder/templates/gatsby/build/", + "rm -rf package-lock.json" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir gatsby && cd gatsby", + "git init", + "git remote add upstream https://github.com/gatsbyjs/gatsby-starter-blog.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs master" + ], + "deps": [] + } + } +} \ No newline at end of file diff --git a/migrations/laravel.migrate.json b/migrations/laravel.migrate.json new file mode 100644 index 000000000..0e2138633 --- /dev/null +++ b/migrations/laravel.migrate.json @@ -0,0 +1,74 @@ +{ + "template": "laravel", + "type": "php", + "type_version": "7.4", + "remote": { + "major_version": "v8", + "repository": "https://github.com/laravel/laravel.git", + "latest_tag": null + }, + "last_updated_on": "2022-04-05-14:00:17", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/laravel/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/laravel/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/laravel/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/laravel/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/laravel/master/.platform/routes.yaml" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml" + ], + "rel_root": [ + "README.md", + ".lando.upstream.yml", + ".platform.app.yaml", + ".platform/services.yaml", + ".platform/routes.yaml" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/laravel/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/laravel.git /Users/chadcarlson/template-builder/templates/laravel/build/", + "git remote add project https://github.com/laravel/laravel.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/laravel/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/laravel/files/ /Users/chadcarlson/template-builder/templates/laravel/build/", + "patch -p1 < /Users/chadcarlson/template-builder/templates/laravel/gitignore.patch", + "composer require platformsh/laravel-bridge --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir laravel && cd laravel", + "git init", + "git remote add upstream https://github.com/laravel/laravel.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs v8" + ], + "deps": [ + "composer require platformsh/laravel-bridge" + ] + } + } +} \ No newline at end of file diff --git a/migrations/magento2ce.migrate.json b/migrations/magento2ce.migrate.json new file mode 100644 index 000000000..09a5c75da --- /dev/null +++ b/migrations/magento2ce.migrate.json @@ -0,0 +1,83 @@ +{ + "template": "magento2ce", + "type": "php", + "type_version": "7.2", + "remote": { + "major_version": "2.4", + "repository": "https://github.com/magento/magento2.git", + "latest_tag": null + }, + "last_updated_on": "2022-04-05-13:59:53", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/magento2ce/master/app/etc/local.xml", + "https://raw.githubusercontent.com/platformsh-templates/magento2ce/master/deploy", + "https://raw.githubusercontent.com/platformsh-templates/magento2ce/master/disable-cron-workers.php", + "https://raw.githubusercontent.com/platformsh-templates/magento2ce/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/magento2ce/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/magento2ce/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/magento2ce/master/pub/static-versioned.php", + "https://raw.githubusercontent.com/platformsh-templates/magento2ce/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/magento2ce/master/.platform/routes.yaml" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/app/etc/local.xml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/deploy", + "https://raw.githubusercontent.com/platformsh/template-builder/master/disable-cron-workers.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/pub/static-versioned.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml" + ], + "rel_root": [ + "app/etc/local.xml", + "deploy", + "disable-cron-workers.php", + "README.md", + ".lando.upstream.yml", + ".platform.app.yaml", + "pub/static-versioned.php", + ".platform/services.yaml", + ".platform/routes.yaml" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/magento2ce/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/magento2ce.git /Users/chadcarlson/template-builder/templates/magento2ce/build/", + "git remote add project https://github.com/magento/magento2.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/magento2ce/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/magento2ce/files/ /Users/chadcarlson/template-builder/templates/magento2ce/build/", + "patch -p1 < /Users/chadcarlson/template-builder/templates/magento2ce/platformsh.patch" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir magento2ce && cd magento2ce", + "git init", + "git remote add upstream https://github.com/magento/magento2.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs 2.4" + ], + "deps": [] + } + } +} \ No newline at end of file diff --git a/migrations/pimcore.migrate.json b/migrations/pimcore.migrate.json new file mode 100644 index 000000000..65e9ced11 --- /dev/null +++ b/migrations/pimcore.migrate.json @@ -0,0 +1,81 @@ +{ + "template": "pimcore", + "type": "php", + "type_version": "7.4", + "remote": { + "major_version": "v2.7", + "repository": "https://github.com/pimcore/skeleton.git", + "latest_tag": null + }, + "last_updated_on": "2022-04-05-13:59:52", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/pimcore/master/app/config/installer.yml", + "https://raw.githubusercontent.com/platformsh-templates/pimcore/master/app/config/parameters.yml", + "https://raw.githubusercontent.com/platformsh-templates/pimcore/master/app/config/parameters_platformsh.php", + "https://raw.githubusercontent.com/platformsh-templates/pimcore/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/pimcore/master/install-redis.sh", + "https://raw.githubusercontent.com/platformsh-templates/pimcore/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/pimcore/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/pimcore/master/.platform/routes.yaml" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/app/config/installer.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/app/config/parameters.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/app/config/parameters_platformsh.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/install-redis.sh", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml" + ], + "rel_root": [ + "app/config/installer.yml", + "app/config/parameters.yml", + "app/config/parameters_platformsh.php", + "README.md", + "install-redis.sh", + ".platform.app.yaml", + ".platform/services.yaml", + ".platform/routes.yaml" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/pimcore/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/pimcore.git /Users/chadcarlson/template-builder/templates/pimcore/build/", + "git remote add project https://github.com/pimcore/skeleton.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/pimcore/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/pimcore/files/ /Users/chadcarlson/template-builder/templates/pimcore/build/", + "patch -p1 < /Users/chadcarlson/template-builder/templates/pimcore/config.patch", + "patch -p1 < /Users/chadcarlson/template-builder/templates/pimcore/gitignore.patch" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir pimcore && cd pimcore", + "git init", + "git remote add upstream https://github.com/pimcore/skeleton.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs v2.7" + ], + "deps": [] + } + } +} \ No newline at end of file diff --git a/migrations/sculpin.migrate.json b/migrations/sculpin.migrate.json new file mode 100644 index 000000000..7e0c5b544 --- /dev/null +++ b/migrations/sculpin.migrate.json @@ -0,0 +1,70 @@ +{ + "template": "sculpin", + "type": "php", + "type_version": "8.1", + "remote": { + "major_version": "3", + "repository": "https://github.com/sculpin/sculpin-blog-skeleton.git", + "latest_tag": null + }, + "last_updated_on": "2022-04-05-13:59:52", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/sculpin/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/sculpin/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/sculpin/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/sculpin/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/sculpin/master/.platform/routes.yaml" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml" + ], + "rel_root": [ + "README.md", + ".lando.upstream.yml", + ".platform.app.yaml", + ".platform/services.yaml", + ".platform/routes.yaml" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/sculpin/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/sculpin.git /Users/chadcarlson/template-builder/templates/sculpin/build/", + "git remote add project https://github.com/sculpin/sculpin-blog-skeleton.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/sculpin/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/sculpin/files/ /Users/chadcarlson/template-builder/templates/sculpin/build/" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir sculpin && cd sculpin", + "git init", + "git remote add upstream https://github.com/sculpin/sculpin-blog-skeleton.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs 3" + ], + "deps": [] + } + } +} \ No newline at end of file diff --git a/migrations/sylius.migrate.json b/migrations/sylius.migrate.json new file mode 100644 index 000000000..c8daa4d26 --- /dev/null +++ b/migrations/sylius.migrate.json @@ -0,0 +1,73 @@ +{ + "template": "sylius", + "type": "php", + "type_version": "8.0", + "remote": { + "major_version": "v1.11.0", + "repository": "https://github.com/Sylius/Sylius-Standard.git", + "latest_tag": "v1.11.0" + }, + "last_updated_on": "2022-04-05-14:00:09", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/sylius/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/sylius/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/sylius/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/sylius/master/.platform/routes.yaml" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml" + ], + "rel_root": [ + "README.md", + ".platform.app.yaml", + ".platform/services.yaml", + ".platform/routes.yaml" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/sylius/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/sylius.git /Users/chadcarlson/template-builder/templates/sylius/build/", + "git remote add project https://github.com/Sylius/Sylius-Standard.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "cp README.md README_upstream.md", + "ls -a", + "rm -rf .github", + "composer require platformsh/symfonyflex-bridge --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php", + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/sylius/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/sylius/files/ /Users/chadcarlson/template-builder/templates/sylius/build/" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir sylius && cd sylius", + "git init", + "git remote add upstream https://github.com/Sylius/Sylius-Standard.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs v1.11.0" + ], + "deps": [ + "composer require platformsh/symfonyflex-bridge" + ] + } + } +} \ No newline at end of file diff --git a/migrations/typo3.migrate.json b/migrations/typo3.migrate.json new file mode 100644 index 000000000..3438e1c83 --- /dev/null +++ b/migrations/typo3.migrate.json @@ -0,0 +1,94 @@ +{ + "template": "typo3", + "type": "php", + "type_version": "7.4", + "remote": { + "major_version": "v10", + "repository": "https://github.com/TYPO3/TYPO3.CMS.BaseDistribution.git", + "latest_tag": null + }, + "last_updated_on": "2022-04-05-13:59:59", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/typo3/master/config/sites/main/config.yaml", + "https://raw.githubusercontent.com/platformsh-templates/typo3/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/typo3/master/public/typo3conf/AdditionalConfiguration.php", + "https://raw.githubusercontent.com/platformsh-templates/typo3/master/public/typo3conf/PlatformshConfiguration.php", + "https://raw.githubusercontent.com/platformsh-templates/typo3/master/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/typo3/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/typo3/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/typo3/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/typo3/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh-templates/typo3/master/src/SetupDatabase.yaml", + "https://raw.githubusercontent.com/platformsh-templates/typo3/master/src/SetupConfiguration.yaml" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/config/sites/main/config.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/public/typo3conf/AdditionalConfiguration.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/public/typo3conf/PlatformshConfiguration.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/src/SetupDatabase.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/src/SetupConfiguration.yaml" + ], + "rel_root": [ + "config/sites/main/config.yaml", + "README.md", + "public/typo3conf/AdditionalConfiguration.php", + "public/typo3conf/PlatformshConfiguration.php", + ".gitignore", + ".lando.upstream.yml", + ".platform.app.yaml", + ".platform/services.yaml", + ".platform/routes.yaml", + "src/SetupDatabase.yaml", + "src/SetupConfiguration.yaml" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/typo3/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/typo3.git /Users/chadcarlson/template-builder/templates/typo3/build/", + "git remote add project https://github.com/TYPO3/TYPO3.CMS.BaseDistribution.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/typo3/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/typo3/files/ /Users/chadcarlson/template-builder/templates/typo3/build/", + "composer config extra.typo3/cms.web-dir public", + "composer update --no-scripts --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php", + "composer require \"php:<8.0\" psr/cache:^1.0 typo3/cms-introduction:~4.3.2 platformsh/config-reader pixelant/pxa-lpeh --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php", + "composer update --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip --ignore-platform-req=php" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir typo3 && cd typo3", + "git init", + "git remote add upstream https://github.com/TYPO3/TYPO3.CMS.BaseDistribution.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs v10" + ], + "deps": [ + "composer require \"php:<8.0\" psr/cache:^1.0 typo3/cms-introduction:~4.3.2 platformsh/config-reader pixelant/pxa-lpeh" + ] + } + } +} \ No newline at end of file diff --git a/migrations/wordpress-bedrock.migrate.json b/migrations/wordpress-bedrock.migrate.json new file mode 100644 index 000000000..51c724115 --- /dev/null +++ b/migrations/wordpress-bedrock.migrate.json @@ -0,0 +1,81 @@ +{ + "template": "wordpress-bedrock", + "type": "php", + "type_version": "8.1", + "remote": { + "major_version": "1.19.2", + "repository": "https://github.com/roots/bedrock.git", + "latest_tag": "1.19.2" + }, + "last_updated_on": "2022-04-05-14:17:18", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/wordpress-bedrock/master/.lando.upstream.yaml", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-bedrock/master/.environment", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-bedrock/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-bedrock/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-bedrock/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-bedrock/master/.platform/routes.yaml" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.environment", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml" + ], + "rel_root": [ + ".lando.upstream.yaml", + ".environment", + "README.md", + ".platform.app.yaml", + ".platform/services.yaml", + ".platform/routes.yaml" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/wordpress-bedrock/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/wordpress-bedrock.git /Users/chadcarlson/template-builder/templates/wordpress-bedrock/build/", + "git remote add project https://github.com/roots/bedrock.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "echo 'Adding composer config:platform:php'", + "composer config platform.php 8.1", + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/wordpress-bedrock/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/wordpress-bedrock/files/ /Users/chadcarlson/template-builder/templates/wordpress-bedrock/build/", + "echo 'Removing composer config:platform'", + "composer config --unset platform", + "composer require platformsh/config-reader wp-cli/wp-cli-bundle psy/psysh --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip", + "composer update" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir wordpress-bedrock && cd wordpress-bedrock", + "git init", + "git remote add upstream https://github.com/roots/bedrock.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs 1.19.2" + ], + "deps": [ + "composer require platformsh/config-reader wp-cli/wp-cli-bundle psy/psysh" + ] + } + } +} \ No newline at end of file diff --git a/migrations/wordpress-composer.migrate.json b/migrations/wordpress-composer.migrate.json new file mode 100644 index 000000000..da0ac9ad9 --- /dev/null +++ b/migrations/wordpress-composer.migrate.json @@ -0,0 +1,98 @@ +{ + "template": "wordpress-composer", + "type": "php", + "type_version": "7.4", + "remote": { + "major_version": "5", + "repository": "https://github.com/johnpbloch/wordpress.git", + "latest_tag": null + }, + "last_updated_on": "2022-04-05-13:59:53", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/wordpress-composer/master/wp-config.php", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-composer/master/wp-cli.yml", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-composer/master/plugins/README.txt", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-composer/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-composer/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-composer/master/.gitignore", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-composer/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-composer/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-composer/master/example.wp-config-local.php", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-composer/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-composer/master/.platform/routes.yaml" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/wp-config.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/wp-cli.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/plugins/README.txt", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.editorconfig", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.gitignore", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/example.wp-config-local.php", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml" + ], + "rel_root": [ + "wp-config.php", + "wp-cli.yml", + "plugins/README.txt", + ".editorconfig", + "README.md", + ".gitignore", + ".lando.upstream.yml", + ".platform.app.yaml", + "example.wp-config-local.php", + ".platform/services.yaml", + ".platform/routes.yaml" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/wordpress-composer/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/wordpress-composer.git /Users/chadcarlson/template-builder/templates/wordpress-composer/build/", + "git remote add project https://github.com/johnpbloch/wordpress.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "echo 'Adding composer config:platform:php'", + "composer config platform.php 7.4", + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/wordpress-composer/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/wordpress-composer/files/ /Users/chadcarlson/template-builder/templates/wordpress-composer/build/", + "composer update --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip", + "composer require platformsh/config-reader wp-cli/wp-cli-bundle psy/psysh --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip", + "composer require None --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip", + "echo 'Removing composer config:platform'", + "composer config --unset platform" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir wordpress-composer && cd wordpress-composer", + "git init", + "git remote add upstream https://github.com/johnpbloch/wordpress.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs 5" + ], + "deps": [ + "composer require platformsh/config-reader wp-cli/wp-cli-bundle psy/psysh", + "composer require None" + ] + } + } +} \ No newline at end of file diff --git a/migrations/wordpress-woocommerce.migrate.json b/migrations/wordpress-woocommerce.migrate.json new file mode 100644 index 000000000..16e57df7f --- /dev/null +++ b/migrations/wordpress-woocommerce.migrate.json @@ -0,0 +1,80 @@ +{ + "template": "wordpress-woocommerce", + "type": "php", + "type_version": "8.1", + "remote": { + "major_version": "1", + "repository": "https://github.com/roots/bedrock.git", + "latest_tag": null + }, + "last_updated_on": "2022-04-05-13:59:58", + "migration": { + "files": { + "rel_template": [ + "https://raw.githubusercontent.com/platformsh-templates/wordpress-woocommerce/master/.lando.upstream.yaml", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-woocommerce/master/.environment", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-woocommerce/master/README.md", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-woocommerce/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-woocommerce/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh-templates/wordpress-woocommerce/master/.platform/routes.yaml" + ], + "rel_tb": [ + "https://raw.githubusercontent.com/platformsh/template-builder/master/.lando.upstream.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.environment", + "https://raw.githubusercontent.com/platformsh/template-builder/master/README.md", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform.app.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/services.yaml", + "https://raw.githubusercontent.com/platformsh/template-builder/master/.platform/routes.yaml" + ], + "rel_root": [ + ".lando.upstream.yaml", + ".environment", + "README.md", + ".platform.app.yaml", + ".platform/services.yaml", + ".platform/routes.yaml" + ] + }, + "commands": { + "cleanup": [ + "rm -rf /Users/chadcarlson/template-builder/templates/wordpress-woocommerce/build/" + ], + "init": [ + "git clone git@github.com:platformsh-templates/wordpress-woocommerce.git /Users/chadcarlson/template-builder/templates/wordpress-woocommerce/build/", + "git remote add project https://github.com/roots/bedrock.git" + ], + "update": [ + "git checkout master", + "git fetch --all --depth=2", + "git fetch --all --tags" + ], + "platformify": [ + "echo 'Adding composer config:platform:php'", + "composer config platform.php 8.1", + "rsync -aP /Users/chadcarlson/template-builder/common/all/ /Users/chadcarlson/template-builder/templates/wordpress-woocommerce/build/", + "rsync -aP /Users/chadcarlson/template-builder/templates/wordpress-woocommerce/files/ /Users/chadcarlson/template-builder/templates/wordpress-woocommerce/build/", + "echo 'Removing composer config:platform'", + "composer config --unset platform", + "composer require wpackagist-plugin/woocommerce wpackagist-plugin/jetpack --prefer-dist --no-interaction --ignore-platform-req=ext-redis --ignore-platform-req=ext-apcu --ignore-platform-req=ext-intl --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-imagick --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-memcache --ignore-platform-req=ext-pdo --ignore-platform-req=ext-openssl --ignore-platform-req=ext-zip" + ], + "branch": [ + "git checkout -b updatesLocal" + ], + "push": [] + }, + "migrate": { + "init": [ + "mkdir wordpress-woocommerce && cd wordpress-woocommerce", + "git init", + "git remote add upstream https://github.com/roots/bedrock.git", + "git branch -m main", + "git fetch --all --depth=2", + "git fetch --all --tags", + "git merge --allow-unrelated-histories -X theirs 1" + ], + "deps": [ + "composer require wpackagist-plugin/woocommerce wpackagist-plugin/jetpack" + ] + } + } +} \ No newline at end of file diff --git a/notes.md b/notes.md index c9cab82ce..84e67c5cb 100644 --- a/notes.md +++ b/notes.md @@ -28,6 +28,25 @@ class Template(BaseProject): } ``` +## `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: + +```bash +$ export GITHUB_TOKEN=XXXXXXXXXXXXXXXXXXXXXXX +``` + ## New templates - [ ] sylius diff --git a/poetry.lock b/poetry.lock index 76a83969c..b376b2aeb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -79,6 +79,22 @@ category = "main" optional = false python-versions = ">=3.5" +[[package]] +name = "importlib-metadata" +version = "4.11.3" +description = "Read metadata from Python packages" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +zipp = ">=0.5" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)"] +perf = ["ipython"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "importlib-resources (>=1.3)"] + [[package]] name = "isort" version = "5.10.1" @@ -109,6 +125,20 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "markdown" +version = "3.3.6" +description = "Python implementation of Markdown." +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +importlib-metadata = {version = ">=4.4", markers = "python_version < \"3.10\""} + +[package.extras] +testing = ["coverage", "pyyaml"] + [[package]] name = "mccabe" version = "0.6.1" @@ -259,10 +289,22 @@ category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" +[[package]] +name = "zipp" +version = "3.7.0" +description = "Backport of pathlib-compatible object wrapper for zip files" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"] + [metadata] lock-version = "1.1" python-versions = "!=2.7.*, ^3.8" -content-hash = "693e2b8d8f2a9ef8cfc2c7c79b127879a6238ea7cb0d20322cb9f0400696ff79" +content-hash = "e497bc1d3cf0cbebff18c0c5d7526829f303d7c0f3c0e46fe374101b9817f964" [metadata.files] astroid = [ @@ -297,6 +339,10 @@ idna = [ {file = "idna-3.3-py3-none-any.whl", hash = "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff"}, {file = "idna-3.3.tar.gz", hash = "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"}, ] +importlib-metadata = [ + {file = "importlib_metadata-4.11.3-py3-none-any.whl", hash = "sha256:1208431ca90a8cca1a6b8af391bb53c1a2db74e5d1cef6ddced95d4b2062edc6"}, + {file = "importlib_metadata-4.11.3.tar.gz", hash = "sha256:ea4c597ebf37142f827b8f39299579e31685c31d3a438b59f469406afd0f2539"}, +] isort = [ {file = "isort-5.10.1-py3-none-any.whl", hash = "sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7"}, {file = "isort-5.10.1.tar.gz", hash = "sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951"}, @@ -343,6 +389,10 @@ lazy-object-proxy = [ macfsevents = [ {file = "MacFSEvents-0.8.1.tar.gz", hash = "sha256:1324b66b356051de662ba87d84f73ada062acd42b047ed1246e60a449f833e10"}, ] +markdown = [ + {file = "Markdown-3.3.6-py3-none-any.whl", hash = "sha256:9923332318f843411e9932237530df53162e29dc7a4e2b91e35764583c46c9a3"}, + {file = "Markdown-3.3.6.tar.gz", hash = "sha256:76df8ae32294ec39dcf89340382882dfa12975f87f45c3ed1ecdb1e8cefc7006"}, +] mccabe = [ {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, @@ -377,18 +427,26 @@ pyyaml = [ {file = "PyYAML-5.4.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185"}, {file = "PyYAML-5.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253"}, {file = "PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc"}, + {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347"}, + {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_s390x.whl", hash = "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541"}, {file = "PyYAML-5.4.1-cp36-cp36m-win32.whl", hash = "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5"}, {file = "PyYAML-5.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df"}, {file = "PyYAML-5.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018"}, {file = "PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63"}, + {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa"}, + {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_s390x.whl", hash = "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0"}, {file = "PyYAML-5.4.1-cp37-cp37m-win32.whl", hash = "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b"}, {file = "PyYAML-5.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf"}, {file = "PyYAML-5.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46"}, {file = "PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb"}, + {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247"}, + {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_s390x.whl", hash = "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc"}, {file = "PyYAML-5.4.1-cp38-cp38-win32.whl", hash = "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc"}, {file = "PyYAML-5.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696"}, {file = "PyYAML-5.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77"}, {file = "PyYAML-5.4.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183"}, + {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122"}, + {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_s390x.whl", hash = "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6"}, {file = "PyYAML-5.4.1-cp39-cp39-win32.whl", hash = "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10"}, {file = "PyYAML-5.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db"}, {file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"}, @@ -466,3 +524,7 @@ wrapt = [ {file = "wrapt-1.13.3-cp39-cp39-win_amd64.whl", hash = "sha256:81bd7c90d28a4b2e1df135bfbd7c23aee3050078ca6441bead44c42483f9ebfb"}, {file = "wrapt-1.13.3.tar.gz", hash = "sha256:1fea9cd438686e6682271d36f3481a9f3636195578bab9ca3382e2f5f01fc185"}, ] +zipp = [ + {file = "zipp-3.7.0-py3-none-any.whl", hash = "sha256:b47250dd24f92b7dd6a0a8fc5244da14608f3ca90a5efcd37a3b1642fac9a375"}, + {file = "zipp-3.7.0.tar.gz", hash = "sha256:9f50f446828eb9d45b267433fd3e9da8d801f614129124863f9c51ebceafb87d"}, +] diff --git a/project/__init__.py b/project/__init__.py index 513cdf762..87ca4e302 100644 --- a/project/__init__.py +++ b/project/__init__.py @@ -125,15 +125,20 @@ def update(self): def platformify(self): """ The default implementation of this method will - 1) Copy the contents of the files/ directory in the project over the + 1) Copy the contents of common files that we want in all templates. + 2) Copy the contents of the files/ directory in the project over the application, replacing what's there. - 2) Apply any *.patch files found in the project directory, in alphabetical order. + 3) Apply any *.patch files found in the project directory, in alphabetical order. Individual projects may expand on these tasks as needed. """ actions = ['rsync -aP {0} {1}'.format( + os.path.join(ROOTDIR,'common/all/'), self.builddir + ), + 'rsync -aP {0} {1}'.format( os.path.join(TEMPLATEDIR, self.name, 'files/'), self.builddir - )] + ) + ] patches = glob(os.path.join(TEMPLATEDIR, self.name, "*.patch")) for patch in patches: actions.append('cd {0} && patch -p1 < {1}'.format( diff --git a/project/drupal.py b/project/drupal.py index 42c6b4112..0b5c44e5d 100644 --- a/project/drupal.py +++ b/project/drupal.py @@ -1,8 +1,12 @@ from . import BaseProject from .remote import RemoteProject import json +import os from collections import OrderedDict +ROOTDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +TEMPLATEDIR = os.path.join(ROOTDIR, 'templates') + class Drupal7_vanilla(BaseProject): version = '7.67' @@ -20,13 +24,34 @@ class Drupal8(RemoteProject): major_version = '8.9' remote = 'https://github.com/drupal/recommended-project.git' + @property + def update(self): + projectName = "drupal8" + def drupal8_modify_composer(composer): + """ + This change makes the template loadable via Composer (see https://github.com/platformsh-templates/drupal9/pull/33). + """ + + composer['name']= "platformsh/{0}".format(projectName) + composer['description']= "This template builds Drupal 8 for Platform.sh based the \"Drupal Recommended\" Composer project." + + return composer + + return super(Drupal8, self).update + [ + (self.modify_composer, [drupal8_modify_composer]) + ] + + @property def platformify(self): return super(Drupal8, self).platformify + [ - # 'cd {0} && composer update -W'.format(self.builddir) + self.composer_defaults() - # 'cd {0} && composer require platformsh/config-reader drush/drush drupal/console drupal/redis'.format(self.builddir) + self.composer_defaults(), 'cd {0} && composer require platformsh/config-reader drush/drush:^10.6 drupal/console drupal/redis'.format(self.builddir) + self.composer_defaults(), - # 'cd {0} && composer update -W'.format(self.builddir) + self.composer_defaults() + 'cd {0} && composer config -g allow-plugins.composer/installers true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.composer/installers true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.drupal/core-project-message true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.cweagans/composer-patches true --no-plugins '.format(self.builddir), + 'rsync -aP {0} {1}'.format(os.path.join(ROOTDIR,'common/drupal8/'), self.builddir), ] class Drupal9(RemoteProject): @@ -34,32 +59,127 @@ class Drupal9(RemoteProject): major_version = "9.3" remote = 'https://github.com/drupal/recommended-project.git' + @property + def update(self): + projectName = "drupal9" + def drupal9_modify_composer(composer): + """ + This change makes the template loadable via Composer (see https://github.com/platformsh-templates/drupal9/pull/33). + """ + + composer['name']= "platformsh/{0}".format(projectName) + composer['description']= "This template builds Drupal 9 for Platform.sh based the \"Drupal Recommended\" Composer project." + + return composer + + return super(Drupal9, self).update + [ + (self.modify_composer, [drupal9_modify_composer]) + ] + + @property def platformify(self): return super(Drupal9, self).platformify + [ - 'cd {0} && composer require platformsh/config-reader drush/drush drupal/redis'.format(self.builddir) + self.composer_defaults() + 'cd {0} && composer require platformsh/config-reader drush/drush drupal/redis'.format(self.builddir) + self.composer_defaults(), + 'cd {0} && composer config -g allow-plugins.composer/installers true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.composer/installers true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.drupal/core-project-message true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.cweagans/composer-patches true --no-plugins '.format(self.builddir), + 'rsync -aP {0} {1}'.format(os.path.join(ROOTDIR,'common/drupal9/'), self.builddir), + ] + +class Drupal9_multisite(Drupal9): + @property + def update(self): + projectName = "drupal9-multisite" + def drupal9_multisite_modify_composer(composer): + """ + This change makes the template loadable via Composer (see https://github.com/platformsh-templates/drupal9/pull/33). + """ + + composer['name']= "platformsh/{0}".format(projectName) + composer['description']= "This template builds Drupal 9 in the multi-site configuration for Platform.sh based the \"Drupal Recommended\" Composer project." + + return composer + + return super(Drupal9_multisite, self).update + [ + (self.modify_composer, [drupal9_multisite_modify_composer]) ] class Drupal8_multisite(Drupal8): - pass + @property + def update(self): + projectName = "drupal8-multisite" + def drupal8_multisite_modify_composer(composer): + """ + This change makes the template loadable via Composer (see https://github.com/platformsh-templates/drupal9/pull/33). + """ + + composer['name']= "platformsh/{0}".format(projectName) + composer['description']= "This template builds Drupal 8 in the multi-site configuration for Platform.sh based the \"Drupal Recommended\" Composer project." + + return composer + + return super(Drupal8_multisite, self).update + [ + (self.modify_composer, [drupal8_multisite_modify_composer]) + ] class Drupal8_opigno(RemoteProject): major_version = '2' remote = 'https://bitbucket.org/opigno/opigno-composer.git' + @property + def update(self): + projectName = "drupal8-opigno" + def drupal8_opigno_modify_composer(composer): + """ + This change makes the template loadable via Composer (see https://github.com/platformsh-templates/drupal9/pull/33). + """ + + composer['name']= "platformsh/{0}".format(projectName) + composer['description']= "This template builds the Opigno Drupal 8 distribution using the \"Drupal Recommended\" Composer project." + + return composer + + return super(Drupal8_opigno, self).update + [ + (self.modify_composer, [drupal8_opigno_modify_composer]) + ] + + @property def platformify(self): return super(Drupal8_opigno, self).platformify + [ - # 'cd {0} && composer update -W'.format(self.builddir) + self.composer_defaults() - # 'cd {0} && composer require platformsh/config-reader drush/drush drupal/console drupal/redis'.format(self.builddir) + self.composer_defaults(), 'cd {0} && composer require platformsh/config-reader drush/drush:^9.1 drupal/console drupal/redis psr/cache:^1.0'.format(self.builddir) + self.composer_defaults(), + 'cd {0} && composer config -g allow-plugins.composer/installers true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.composer/installers true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.drupal/core-project-message true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.cweagans/composer-patches true --no-plugins '.format(self.builddir), 'cd {0} && composer update -W'.format(self.builddir) + self.composer_defaults(), + 'rsync -aP {0} {1}'.format(os.path.join(ROOTDIR,'common/drupal8/'), self.builddir), ] - class Drupal8_govcms8(RemoteProject): - major_version = '2.11' - remote = 'https://github.com/govCMS/govCMS.git' + major_version = '2.12' + remote = 'https://github.com/govCMS/GovCMS.git' + + @property + def update(self): + projectName = "govcms9" + def drupal8_govcms8_modify_composer(composer): + """ + This change makes the template loadable via Composer (see https://github.com/platformsh-templates/drupal9/pull/33). + """ + + composer['name']= "platformsh/{0}".format(projectName) + composer['description']= "This template builds the Australian government's GovCMS Drupal 9 distribution using the \"Drupal Recommended\" Composer project." + + return composer + + return super(Drupal8_govcms8, self).update + [ + (self.modify_composer, [drupal8_govcms8_modify_composer]) + ] @property def update(self): @@ -79,7 +199,47 @@ def platformify(self): # It should work to remove the lock file first, but for some reason that is still failing. # For now, just skip installing console on GovCMS. I don't know if anyone uses it anyway. # 'cd {0} && composer require platformsh/config-reader drush/drush drupal/redis'.format(self.builddir) + self.composer_defaults(), - 'cd {0} && composer require platformsh/config-reader drush/drush:^10 drupal/redis'.format(self.builddir) + self.composer_defaults(), + 'cd {0} && composer require platformsh/config-reader drush/drush:^10 drupal/redis'.format(self.builddir) + self.composer_defaults(), + 'cd {0} && composer config -g allow-plugins.composer/installers true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.composer/installers true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.drupal/core-project-message true --no-plugins'.format(self.builddir), + 'cd {0} && composer config allow-plugins.cweagans/composer-patches true --no-plugins '.format(self.builddir), 'cd {0} && composer update -W'.format(self.builddir) + self.composer_defaults(), 'cd {0} && rm -rf web/profiles/govcms'.format(self.builddir), + 'rsync -aP {0} {1}'.format(os.path.join(ROOTDIR,'common/drupal9/'), self.builddir), ] + +class Contentacms(BaseProject): + + @property + def update(self): + + ROOTDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + TEMPLATEDIR = os.path.join(ROOTDIR, 'templates/contentacms') + + # Quickstart project package name, used in the block below. + projectName = "contentacms-platformsh" + + return [ + # Create a quickstart ContentaCMS app using Composer. + 'cd {0} && composer create-project contentacms/contenta-jsonapi-project {1} --stability dev --no-interaction --remove-vcs --no-progress --prefer-dist --no-plugins'.format(TEMPLATEDIR, projectName), + 'cd {0}/{1} && composer config -g allow-plugins.composer/installers true --no-plugins'.format(TEMPLATEDIR, projectName), + 'cd {0}/{1} && composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true --no-plugins'.format(TEMPLATEDIR, projectName), + 'cd {0}/{1} && composer config allow-plugins.cweagans/composer-patches true --no-plugins'.format(TEMPLATEDIR, projectName), + 'cd {0}/{1} && composer config allow-plugins.drupal/core-project-message true --no-plugins'.format(TEMPLATEDIR, projectName), + 'cd {0}/{1} && composer config allow-plugins.cweagans/composer-patches true --no-plugins'.format(TEMPLATEDIR, projectName), + 'cd {0}/{1} && composer config allow-plugins.drupal/core-vendor-hardening true --no-plugins'.format(TEMPLATEDIR, projectName), + 'cd {0}/{1} && composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins'.format(TEMPLATEDIR, projectName), + 'cd {0}/{1} && composer config allow-plugins.oomphinc/composer-installers-extender true --no-plugins'.format(TEMPLATEDIR, projectName), + 'cd {0} && cp -r {1}/{2}/* .'.format(self.builddir, TEMPLATEDIR, projectName), + 'rm -rf {0}/{1}'.format(TEMPLATEDIR, projectName), + ] + super(Contentacms, self).update + + @property + def platformify(self): + return super(Contentacms, self).platformify + [ + 'cd {0} && composer require platformsh/config-reader drush/drush drupal/redis drush/drush:^10'.format(self.builddir) + self.composer_defaults(), + 'cd {0} && composer update -W'.format(self.builddir) + self.composer_defaults(), + ] + diff --git a/project/elasticapm.py b/project/elasticapm.py index c5347d7df..cff7b9482 100644 --- a/project/elasticapm.py +++ b/project/elasticapm.py @@ -1,4 +1,5 @@ from . import BaseProject +import os import json import requests @@ -7,13 +8,16 @@ class Elastic_apm(BaseProject): @property def platformify(self): - # Kibana - response = requests.get('https://api.github.com/repos/elastic/kibana/releases') - kibana_version = response.json()[0]["tag_name"][1:] + if os.environ.get("GITHUB_TOKEN"): + headers = {"Authorization": "token {0}".format(os.environ.get("GITHUB_TOKEN"))} + responseKibana = requests.get('https://api.github.com/repos/elastic/kibana/releases', headers=headers) + responseAPM = requests.get('https://api.github.com/repos/elastic/apm-server/releases', headers=headers) + else: + responseKibana = requests.get('https://api.github.com/repos/elastic/kibana/releases') + responseAPM = requests.get('https://api.github.com/repos/elastic/apm-server/releases') - # APM - response = requests.get('https://api.github.com/repos/elastic/apm-server/releases') - apm_version = response.json()[0]["tag_name"][1:] + kibana_version = responseKibana.json()[0]["tag_name"][1:] + apm_version = responseAPM.json()[0]["tag_name"][1:] return super(Elastic_apm, self).platformify + [ 'cd {0}/kibana && echo {1} > kibana_version'.format(self.builddir, kibana_version), diff --git a/project/hugo.py b/project/hugo.py index b258e228e..973c45184 100644 --- a/project/hugo.py +++ b/project/hugo.py @@ -1,5 +1,6 @@ from . import BaseProject +import os import json import requests @@ -10,7 +11,11 @@ def platformify(self): major_version = "0.91" - response = requests.get('https://api.github.com/repos/gohugoio/hugo/releases') + if os.environ.get("GITHUB_TOKEN"): + headers = {"Authorization": "token {0}".format(os.environ.get("GITHUB_TOKEN"))} + response = requests.get('https://api.github.com/repos/gohugoio/hugo/releases', headers=headers) + else: + response = requests.get('https://api.github.com/repos/gohugoio/hugo/releases') 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"]] diff --git a/project/mattermost.py b/project/mattermost.py index 844c7ab49..18f45d69f 100644 --- a/project/mattermost.py +++ b/project/mattermost.py @@ -1,4 +1,5 @@ from . import BaseProject +import os import json import requests @@ -9,7 +10,11 @@ def platformify(self): major_version = "6.1" - response = requests.get('https://api.github.com/repos/mattermost/mattermost-server/releases') + if os.environ.get("GITHUB_TOKEN"): + headers = {"Authorization": "token {0}".format(os.environ.get("GITHUB_TOKEN"))} + response = requests.get('https://api.github.com/repos/mattermost/mattermost-server/releases', headers=headers) + else: + response = requests.get('https://api.github.com/repos/mattermost/mattermost-server/releases') 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"]] diff --git a/pyproject.toml b/pyproject.toml index 4e97c6330..9c9e1f4c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ pyyaml = "^5.0" requests = "^2.26.0" slack-sdk = "^3.11.2" certifi = "^2021.10.8" +Markdown = "^3.3.6" [tool.poetry.dev-dependencies] autopep8 = "^1.5.4" diff --git a/readme-builder.py b/readme-builder.py new file mode 100644 index 000000000..e709f09fa --- /dev/null +++ b/readme-builder.py @@ -0,0 +1,643 @@ +import os +import sys +import json +import yaml + +############################################################################################################ +# Helpers +############################################################################################################ +templates=os.listdir("{}/templates".format(os.getcwd())) +templates.remove("__init__.py") +templates.remove(".DS_Store") +readme_file = "README.md" +header_file = "header.svg" + +# Generic read file function. +def read_file(file_location): + with open(file_location, "r") as data: + content = data.read() + return content + +############################################################################################################ +# Header image +############################################################################################################ +# Create the header graphic so we can test template logos that show up in console. +def create_header_image(data, image_destination): + image_height = 150 + translate_x = image_height/2 + translate_y = image_height/2 + banner_width = 1080 + banner_height = 250 + banner_fill = "#f4f2f3" + + header = """ + +""".format(banner_width, banner_height, banner_fill) + + if len(data["logo"]["images"]) == 2: + header += """ + + +""".format(data["logo"]["images"][0], data["logo"]["images"][1], str(-1*translate_x), str(-1*translate_x)) + else: + header += """ + + +""".format(data["logo"]["images"][0], str(image_height), str(-1*translate_x), str(-1*translate_x)) + + with open(image_destination, "w") as header_img: + header_img.write(header) +############################################################################################################ +# Header +############################################################################################################ +# Create the common header text, with title, CTAs, and badges. +def create_header(data, template, header_file): + body = """ +

+ + + +

+ +

+ + + +

+ +

{2}

+ +

+Contribute, request a feature, or check out our resources +
+
+Join our community       +Documentation       +Blog       +Report a bug       +Request a feature +

+

+ +

+ +Open issues +   + +Open PRs +   + +License +   +

+ +

+

+ +
+""".format(data["logo"]["link"], header_file, data["title"], template, data["license"]["location"], data["license"]["type"]) + + return body + +# Table of contents. +def create_toc(): + content = """ +

+Contents +

+About       +Getting started       +Migrate       +Learn       +Contribute       +
+

+
+""" + return content +############################################################################################################ +# About +############################################################################################################ +# About the template, its features, and a short about Platform.sh. +def create_about(data): + + description = "\n\n".join(data["description"]) + features = "- " + "\n- ".join(data["features"]) + + content = """ +## About + +{0} + +### Features + +{1} + +""".format(description, features) + return content +############################################################################################################ +# Getting started +############################################################################################################ +# Quickstart instructions (DoP repeat). +def create_quickstart(template): + content = """ +The quickest way to deploy this template on Platform.sh is by clicking the button below. +This will automatically create a new project and initialize the repository for you. + +

+ + Deploy on Platform.sh + +

+
+""".format(template) + return content +# Getting started: Alt deploy options. + +def create_project_options(data): + content = "" + about_dev_flag = "" + + if "create-project" in data["sections"]: + + if "-s dev" in data["sections"]["create-project"]: + about_dev_flag = """ +> **Note:** +> +> Platform.sh templates prioritize upstream release versions over our own. Despite this, we update template dependencies on a scheduled basis independent of those upstreams. Because of this, template repos do not contain releases. This may change in the future, but until then the `-s dev` flag is necessary to use `composer create-project`. +""" + + content = """ +You can also quickly recreate this project locally with the following command: + +```bash +{0} +``` + +{1} +""".format(data["sections"]["create-project"], about_dev_flag) + return content + +def create_deploy_options(): + + direct = read_file("{}/common/readme/deploy_direct.md".format(os.getcwd())) + github = read_file("{}/common/readme/deploy_github.md".format(os.getcwd())) + gitlab = read_file("{}/common/readme/deploy_gitlab.md".format(os.getcwd())) + bitbucket = read_file("{}/common/readme/deploy_bitbucket.md".format(os.getcwd())) + + content = """ +{0} +{1} +{2} +{3} +""".format(direct, github, gitlab, bitbucket) + return content +# Getting started main. +def create_getting_started(template, data): + quickstart = create_quickstart(template) + deploy_options = create_deploy_options() + createProject_options = create_project_options(data) + + content = """ +## Getting started + +### Deploy + +#### Quickstart + +{0} + +{1} + +#### Other deployment options + +For all of the other options below, clone this repository first: + +```bash +git clone https://github.com/platformsh-templates/{2} +``` + +If you're trying to deploy from GitHub, you can generate a copy of this repository first in your own namespace by clicking the [Use this template](https://github.com/platformsh-templates/{2}/generate) button at the top of this page. + +Then you can clone a copy of it locally with `git clone git@github.com:YOUR_NAMESPACE/{2}.git`. + +{3} + +""".format(quickstart, createProject_options, template, deploy_options) + return content +# Getting started: post-install. +def create_post_install(data): + defaultContent = "" + if "postinstall" in data["sections"]: + return read_file("{0}/{1}".format(os.getcwd(), data["sections"]["postinstall"])) + return defaultContent +# Getting started: local dev. +def create_local_dev(template, data): + defaultContent = "" + if "local" in data["sections"]: + + local_options = "" + config = data["sections"]["local"] + for file in data["sections"]["local"]: + local_options += read_file("{0}/{1}".format(os.getcwd(), file)) + "\n" + + content = """ +### Local development + +This section provides instructions for running the `{0}` template locally, connected to a live database instance on an active Platform.sh environment. + +In all cases for developing with Platform.sh, it's important to develop on an isolated environment - do not connect to data on your production environment when developing locally. +Each of the options below assume that you have already deployed this template to Platform.sh, as well as the following starting commands: + +```bash +$ platform get PROJECT_ID +$ cd project-name +$ platform environment:branch updates +``` + +{1} + +> **Note:** +> +> For many of the steps above, you may need to include the CLI flags `-p PROJECT_ID` and `-e ENVIRONMENT_ID` if you are not in the project directory or if the environment is associated with an existing pull request. + +""".format(template, local_options) + return content + return defaultContent +# Create customizations. +def create_customizations(): + return """ +### Customizations + +A number of changes have been made to this repository from its source that you may already be familiar with. +Configuration files have been added, and other small changes were necessary to deploy on Platform.sh + +See [Migrate](#migrate) for more details. +""" +############################################################################################################ +# Migrate +############################################################################################################ +# Migration: Adding/updating files. +def create_migration_file_descriptions(template, data): + + ignore_files = ["README.md", "README_test.md", "header_test.svg", ".editorconfig"] + + with open("{0}/common/readme/file_ignore.json".format(os.getcwd(), template), 'r') as ignore_file: + ignore_data=ignore_file.read() + + with open("{0}/migrations/{1}.migrate.json".format(os.getcwd(), template), 'r') as myfile: + migrate_data=myfile.read() + + ignore_files = json.loads(ignore_data) + migration_files = json.loads(migrate_data) + + migrate_content = """ +| File | Purpose | +|:-----------|:--------| +""" + + for file in migration_files["migration"]["files"]["rel_root"]: + if file not in ignore_files: + if "migration" in data["sections"]: + if file in data["sections"]["migration"]["files"]: + content = "| [`{0}`]({0}) |".format(file, file) + for entry in data["sections"]["migration"]["files"][file]: + if isinstance(entry, str): + content += " {0}".format(entry) + else: + content += " {0}".format(read_file("{0}/{1}".format(os.getcwd(), entry["file"]))) + migrate_content += content + " |\n" + else: + migrate_content += "| [`{0}`]({0}) | |\n".format(file) + + return """ +{0} +""".format(migrate_content) +# Migrate: getting started. +def create_migration_getting_started(template, data): + with open("{0}/migrations/{1}.migrate.json".format(os.getcwd(), template), 'r') as myfile: + migrate_data=myfile.read() + migration_files = json.loads(migrate_data) + deps_content = "" + for commands in migration_files["migration"]["migrate"]["init"]: + deps_content += "$ {0}\n".format(commands) + + return """ + +```bash +{0} +``` + +""".format(deps_content) +# Migrate: dependencies. +def create_migration_dependencies(template, data): + with open("{0}/migrations/{1}.migrate.json".format(os.getcwd(), template), 'r') as myfile: + migrate_data=myfile.read() + migration_files = json.loads(migrate_data) + deps_content = "" + for commands in migration_files["migration"]["migrate"]["deps"]: + deps_content += "$ {0}\n".format(commands) + + return """ + +```bash +{0} +``` + +""".format(deps_content) + +# Migrate: data. +def create_migration_data(template, data): + + mounts = "" + for mount in data["sections"]["migration"]["mounts"]: + mounts += """ +$ platform mount:upload -e main --mount {0} --source ./{0}""".format(mount) + return """ +If you are moving an existing site to Platform.sh, then in addition to code you also need to migrate your data. That means your database and your files. + +
+Importing the database
+ +First, obtain a database dump from your current site and save your dump file as `database.sql`. Then, import the database into your Platform.sh site using the CLI: + +```bash +platform sql -e main < database.sql +``` + +
+
+Importing files
+ +You first need to download your files from your current hosting environment. +The easiest way is likely with rsync, but consult your old host's documentation. + +The `platform mount:upload` command provides a straightforward way to upload an entire directory to your site at once to a `mount` defined in a `.platform.app.yaml` file. +Under the hood, it uses an SSH tunnel and rsync, so it is as efficient as possible. +(There is also a `platform mount:download` command you can use to download files later.) +Run the following from your local Git repository root (modifying the `--source` path if needed and setting `BRANCH_NAME` to the branch you are using). + +A few examples are listed below, but repeat for all directories that contain data you would like to migrate. + +```bash{0} +``` + +Note that `rsync` is picky about its trailing slashes, so be sure to include those. + +
+ +""".format(mounts) +# Migrate: Main. +def create_migration(template, data): + + getting_started = create_migration_getting_started(template, data) + file_descriptions = create_migration_file_descriptions(template, data) + dependencies = create_migration_dependencies(template, data) + deploy_options = create_deploy_options() + data_migrate = create_migration_data(template, data) + + return """ +## Migrate + +The steps below outline the important steps for migrating your application to Platform.sh - adding the required configuration files and dependencies, for example. +Not every step will be applicable to each person's migration. +These steps actually assume the earliest starting point possible - that there is no code at all locally, and that this template repository will be rebuilt completely from scratch. + +- [Getting started](#getting-started-1) +- [Adding and updating files](#adding-and-updating-files) +- [Dependencies](#dependencies) +- [Deploying to Platform.sh](#deploying-to-platformsh) +- [Migrating your data](#migrating-your-data) +- [Next steps](#next-steps) + +If you already have code you'd like to migrate, feel free to focus on the steps most relevant to your application and skip the first section. + +### Getting started + +Assuming that your starting point is no local code, the steps below will setup a starting repository we can begin to make changes to to rebuild this template and migrate to Platform.sh. +If you already have a codebase you are trying to migrate, move onto the next step - [Adding and updating files](#adding-and-updating-files) - and substitute any reference to the default branch `main` with some other branch name. + +{0} + +### Adding and updating files + +A small number of files need to be added to or modified in your repository at this point. +Some of them explicitly configure how the application is built and deployed on Platform.sh, while others simply modify files you may already have locally, in which case you will need to replicate those changes. + +Open the dropdown below to view all of the **Added** and **Updated** files you'll need to reproduce in your migration. + +
+View files
+ +{1} + +
+ +### Dependencies and configuration + +Sometimes it is necessary to install additional dependencies to and modify the configuration of an upstream project to deploy on Platform.sh. +When it is, we do our best to keep these modifications to the minimum necessary. +Run the commands below to reproduce the dependencies in this template. + +{2} + +### Deploying to Platform.sh + +Your repository now has all of the code it needs in order to deploy to Platform.sh. + +{3} + +### Migrating your data + +{4} + +### Next steps + +With your application now deployed on Platform.sh, things get more interesting. +Run the command `platform environment:branch new-feature` for your project, or open a trivial pull request off of your current branch. + +The resulting environment is an *exact* copy of production. +It contains identical infrastructure to what's been defined in your configuration files, and even includes data copied from your production environment in its services. +On this isolated environment, you're free to make any changes to your application you need to, and really test how they will behave on production. + +After that, here are a collection of additional resources you might find interesting as you continue with your migration to Platform.sh: + +- [Local development](#local-development) +- [Troubleshooting](#troubleshooting) +- [Adding a domain and going live](https://docs.platform.sh/domains/steps.html) +- [(CDN) Content Delivery Networks](https://docs.platform.sh/domains/cdn.html) +- [Performance and observability with Blackfire.io](https://docs.platform.sh/integrations/observability/blackfire.html) +- [Pricing](https://docs.platform.sh/overview/pricing.html) +- [Security and compliance](https://docs.platform.sh/security.html) + +""".format(getting_started, file_descriptions, dependencies, deploy_options, data_migrate) +############################################################################################################ +# Learn +############################################################################################################ +# Learn: Troubleshooting +def create_troubleshooting(data): + + troubleshoot_content = "" + if "troubleshoot" in data["sections"]: + for file in data["sections"]["troubleshoot"]: + troubleshoot_content += """ +{0} +""".format(read_file("{0}/{1}".format(os.getcwd(), file["file"]))) + + return troubleshoot_content +# Learn: Resources +def create_resources(template, data): + if "resources" in data["sections"]: + resource_links = "" + for resource in data["sections"]["resources"]: + resource_links += "- {0}\n".format(resource) + content = """ +{0} +""".format(resource_links) + return content + return "" +# Learn: Contact +def create_contact(): + return read_file("{0}/{1}".format(os.getcwd(), "common/readme/contact.md")) +# Learn: About Platform.sh. +def create_about_platformsh(): + return read_file("{0}/{1}".format(os.getcwd(), "common/readme/platformsh_desc.md")) +def create_metrics(data): + content = "" + if "metrics" in data["sections"]: + if data["sections"]["metrics"] == True: + content = read_file("{0}/{1}".format(os.getcwd(), "common/readme/metrics.md")) + return content + +def create_blackfire(data): + content = "" + if "blackfire" in data["sections"]: + if data["sections"]["blackfire"] == True: + content = read_file("{0}/{1}".format(os.getcwd(), "common/readme/blackfire.md")) + return content +def create_learn(template, data): + troubleshooting = create_troubleshooting(data) + metrics = create_metrics(data) + blackfire = create_blackfire(data) + resources = create_resources(template, data) + contact = create_contact() + about_platformsh = create_about_platformsh() + return """ +## Learn + +### Troubleshooting + +{0} + +{1} + +{2} + +### Resources + +{3} + +### Contact + +{4} + +### About Platform.sh + +{5} +""".format(troubleshooting, metrics, blackfire, resources, contact, about_platformsh) +############################################################################################################ +# Contribute +############################################################################################################ +# Contributing +def create_contributing(template): + + content = """ + +## Contribute + +

Help us keep top-notch templates!

+ +Every one of our templates is open source, and they're important resources for users trying to deploy to Platform.sh for the first time or better understand the platform. They act as getting started guides, but also contain a number of helpful tips and best practices when working with certain languages and frameworks. + +See something that's wrong with this template that needs to be fixed? Something in the documentation unclear or missing? Let us know! + +

+How to contribute +

+Report a bug       +Submit a feature request       +Open a pull request       +
+

+
+

+Need help? +

+Ask the Platform.sh Community       +Join us on Slack       +
+

+
+

Thanks to all of our amazing contributors!

+
+

+ + + +

+ +

+Made with contrib.rocks +

+ +
+""".format(template) + return content +############################################################################################################ +# Main loop through all templates (if info.yaml file is present). +############################################################################################################ +def generate_readme(template): + info_file = "{0}/templates/{1}/info/info.yaml".format(os.getcwd(), template) + if os.path.isfile(info_file): + print("\n{0}".format(template)) + print("- Build readme") + + with open(info_file) as file: + try: + data = yaml.safe_load(file) + + # First create the header image. + image_destination = "{0}/templates/{1}/files/{2}".format(os.getcwd(), template, header_file) + create_header_image(data, image_destination) + # Header. + body = create_header(data, template, header_file) + body += create_toc() + # About. + body += create_about(data) + # Getting started. + body += create_getting_started(template, data) + body += create_post_install(data) + body += create_local_dev(template, data) + # Migrate. + body += create_migration(template, data) + # Learn. + body += create_learn(template, data) + # Contribute. + body += create_contributing(template) + + readme_destination = "{0}/templates/{1}/files/{2}".format(os.getcwd(), template, readme_file) + with open(readme_destination, "w") as readme: + readme.write(body) + + except yaml.YAMLError as exc: + print(exc) +def run(args): + if len(args) > 1: + template = args[1] + generate_readme(template) + else: + for template in templates: + generate_readme(template) + +if __name__ == "__main__": + run(sys.argv) diff --git a/templates/contentacms/.platform.template.yaml b/templates/contentacms/.platform.template.yaml new file mode 100644 index 000000000..494d00671 --- /dev/null +++ b/templates/contentacms/.platform.template.yaml @@ -0,0 +1,32 @@ +version: 1 + +info: + id: platformsh/drupal9 + name: Drupal 9 + description: | +

This template builds Drupal 9 using the "Drupal Recommended" Composer project. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided.

+

Drupal is a flexible and extensible PHP-based CMS framework.

+ + tags: + - PHP + - Drupal + - CMS + - Symfony + related_blog_tags: + - Drupal + image: data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNi4yIDMuOUMxNi4yIDMuOSAxNC44MiAzLjMgMTQuMDQgMi44MkMxNC4wNCAyLjgyIDEzLjAyIDIuMjIgMTEuMzQgMEMxMS4zNCAwIDExLjQgMi41MiA4LjcgMy44NEM0LjQ0IDUuNTIgMS44IDkuMDYgMS44IDEzLjU2QzEuOCAxOS4yNiA2LjQ4IDIzLjk0IDEyLjE4IDIzLjk0QzE3Ljk0IDIzLjk0IDIyLjU2IDE5LjI2IDIyLjU2IDEzLjU2QzIyLjYyIDYuNiAxNi4yIDMuOSAxNi4yIDMuOVpNNC42OCA5LjZDMy4wNiA5Ljk2IDMuMTggOS4xMiAzLjQ4IDguNEMzLjYgNy45OCA0LjAyIDcuNSA0LjAyIDcuNUM1LjEgNS43NiA3LjUgNC41IDcuNSA0LjVDNy44IDQuMzggOC4zNCA0LjA4IDguODIgMy44NEM5Ljc4IDMuMyAxMC4wMiAzIDEwLjAyIDNDMTEuNCAxLjY4IDExLjI4IDAuMDYgMTEuMjggMEMxMi40OCAyLjQgMTEuMDQgMy40OCAxMS4wNCAzLjQ4QzExLjQgMy44NCAxMS4yOCA0LjIgMTEuMjggNC4yQzkuNDIgOC4yMiA0LjY4IDkuNiA0LjY4IDkuNlpNMTcuMjIgMjIuMkMxNy4xIDIyLjI2IDE1LjYgMjIuOTggMTMuODYgMjIuOThDMTIuOSAyMi45OCAxMS44OCAyMi43NCAxMC45OCAyMi4xNEMxMC42OCAyMS45IDEwLjU2IDIxLjQ4IDEwLjc0IDIxLjE4QzEwLjggMjEuMDYgMTEuMTYgMjAuNjQgMTIgMjEuMThDMTIuMDYgMjEuMjQgMTQuMDQgMjIuNTYgMTcuMSAyMC44OEMxNy4zNCAyMC43NiAxNy42NCAyMC44MiAxNy43NiAyMS4wNkMxNy45NCAyMS4zIDE4IDIxLjc4IDE3LjIyIDIyLjJaTTEzLjAyIDE5LjY4TDEzLjA4IDE5LjYyQzEzLjE0IDE5LjU2IDE0LjE2IDE4LjI0IDE1LjY2IDE4LjQyQzE1LjkgMTguNDIgMTYuNzQgMTguNDggMTcuMjggMTkuNUMxNy4zNCAxOS42MiAxNy40NiAyMC4wNCAxNy4yMiAyMC4zNEMxNy4xIDIwLjQ2IDE2LjkyIDIwLjU4IDE2LjU2IDIwLjQ2QzE2LjMyIDIwLjQgMTYuMiAyMC4xNiAxNi4yIDIwLjA0QzE2LjE0IDE5Ljg2IDE2LjA4IDE5Ljc0IDE1LjQ4IDE5LjY4QzE1IDE5LjYyIDE0LjcgMTkuODYgMTQuMzQgMjAuMTZDMTQuMTYgMjAuMzQgMTMuOTIgMjAuNTIgMTMuNjggMjAuNThDMTMuNjIgMjAuNjQgMTMuNTYgMjAuNjQgMTMuNDQgMjAuNjRDMTMuMzIgMjAuNjQgMTMuMiAyMC41OCAxMy4wOCAyMC41MkMxMi45IDIwLjM0IDEyLjg0IDIwLjEgMTMuMDIgMTkuNjhaTTE5Ljg2IDE5LjhDMTkuODYgMTkuOCAxOS4zMiAxOS45OCAxOC43OCAxOS4zOEMxOC43OCAxOS4zOCAxNy4xNiAxNy41MiAxNi4zOCAxNy4yMkMxNi4zOCAxNy4yMiAxNS45IDE3LjA0IDE1LjMgMTcuMjhDMTUuMyAxNy4yOCAxNC44OCAxNy4zNCAxMy4yNiAxOC40MkMxMy4yNiAxOC40MiAxMC41IDIwLjE2IDkuMTIgMTkuOTJDOS4xMiAxOS45MiA2IDE5Ljk4IDYuNDIgMTYuNjhDNi40MiAxNi42OCA3LjA4IDEyLjk2IDExLjQgMTMuOEMxMS40IDEzLjggMTIuMzYgMTMuOTggMTQuMSAxNS4zNkMxNC4xIDE1LjM2IDE1LjMgMTYuMjYgMTUuOSAxNi4yNkMxNS45IDE2LjI2IDE2LjM4IDE2LjMyIDE3LjQ2IDE1LjY2QzE3LjQ2IDE1LjY2IDE5LjU2IDE0LjA0IDIwLjM0IDE0LjFDMjAuNDYgMTQuMSAyMS44NCAxNC4wNCAyMS44NCAxNi4zMkMyMS43OCAxNi4yNiAyMS44NCAxOC45IDE5Ljg2IDE5LjhaIiBmaWxsPSIjMDA4RUNFIi8+Cjwvc3ZnPgo= + notes: + - heading: "Features" + content: | + PHP 8.1
+ MariaDB 10.4
+ Redis 6
+ Drush included
+ Automatic TLS certificates
+ Composer-based build
+ +initialize: + repository: https://github.com/platformsh-templates/drupal9.git@master + config: null + files: [] + profile: Drupal 9 diff --git a/templates/contentacms/files/.editorconfig b/templates/contentacms/files/.editorconfig new file mode 100644 index 000000000..76b0d7c09 --- /dev/null +++ b/templates/contentacms/files/.editorconfig @@ -0,0 +1,20 @@ +# Drupal editor configuration normalization +# @see http://editorconfig.org/ + +# This is the top-most .editorconfig file; do not search in parent directories. +root = true + +# All files. +[*] +end_of_line = LF +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[composer.{json,lock}] +indent_size = 4 + +[.platform.app.yaml] +indent_size = 4 diff --git a/templates/contentacms/files/.environment b/templates/contentacms/files/.environment new file mode 100644 index 000000000..3e0014164 --- /dev/null +++ b/templates/contentacms/files/.environment @@ -0,0 +1,11 @@ +# Statements in this file will be executed (sourced) by the shell in SSH +# sessions, in deploy hooks, in cron jobs, and in the application's runtime +# environment. This file must be placed in the root of the application, not +# necessarily the git repository's root. In case of multiple applications, +# each application can have its own .environment file. + +# Allow executable app dependencies from Composer to be run from the path. +if [ -n "$PLATFORM_APP_DIR" -a -f "$PLATFORM_APP_DIR"/composer.json ] ; then + bin=$(composer config bin-dir --working-dir="$PLATFORM_APP_DIR" --no-interaction 2>/dev/null) + export PATH="${PLATFORM_APP_DIR}/${bin:-vendor/bin}:${PATH}" +fi diff --git a/templates/contentacms/files/.gitignore b/templates/contentacms/files/.gitignore new file mode 100644 index 000000000..6b6444a2c --- /dev/null +++ b/templates/contentacms/files/.gitignore @@ -0,0 +1,32 @@ +# Ignore directories generated by Composer +/drush/contrib/ +/vendor/ +/web/core/ +/web/modules/contrib/ +/web/themes/contrib/ +/web/profiles/contrib/ +/web/libraries/ +console/ + +# Ignore sensitive information +/web/sites/*/settings.local.php + +# Ignore Drupal's file directory +/web/sites/*/files/ + +# Ignore SimpleTest multi-site environment. +/web/sites/simpletest + +# Ignore files generated by PhpStorm +/.idea/ + +# Ignore .env files as they are personal +/.env + +# Ignore mounts +web/sites/default/files +tmp +private +.drush +drush-backups +.console diff --git a/templates/drupal9/files/.lando.upstream.yml b/templates/contentacms/files/.lando.upstream.yml similarity index 100% rename from templates/drupal9/files/.lando.upstream.yml rename to templates/contentacms/files/.lando.upstream.yml diff --git a/templates/contentacms/files/.platform.app.yaml b/templates/contentacms/files/.platform.app.yaml new file mode 100644 index 000000000..b65f0b760 --- /dev/null +++ b/templates/contentacms/files/.platform.app.yaml @@ -0,0 +1,155 @@ +# This file describes an application. You can have multiple applications +# in the same project. +# +# See https://docs.platform.sh/configuration/app.html + +# The name of this app. Must be unique within a project. +name: 'app' + +# The runtime the application uses. +type: 'php:8.1' + +dependencies: + php: + composer/composer: '^2' + +runtime: + # Enable the redis extension so Drupal can communicate with the Redis cache. + extensions: + - redis + - sodium + +# The relationships of the application with services or other applications. +# +# The left-hand side is the name of the relationship as it will be exposed +# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand +# side is in the form `:`. +relationships: + database: 'db:mysql' + redis: 'cache:redis' + +# The size of the persistent disk of the application (in MB). +disk: 2048 + +# The 'mounts' describe writable, persistent filesystem mounts in the application. +mounts: + # The default Drupal files directory. + '/web/sites/default/files': + source: local + source_path: 'files' + # Drupal gets its own dedicated tmp directory. The settings.platformsh.php + # file will automatically configure Drupal to use this directory. + '/tmp': + source: local + source_path: 'tmp' + # Private file uploads are stored outside the web root. The settings.platformsh.php + # file will automatically configure Drupal to use this directory. + '/private': + source: local + source_path: 'private' + # Drush needs a scratch space for its own caches. + '/.drush': + source: local + source_path: 'drush' + # Drush will try to save backups to this directory, so it must be + # writeable even though you will almost never need to use it. + '/drush-backups': + source: local + source_path: 'drush-backups' + # Drupal Console will try to save backups to this directory, so it must be + # writeable even though you will almost never need to use it. + '/.console': + source: local + source_path: 'console' + +# Configuration of the build of this application. +build: + # Automatically run `composer install` on every build. + flavor: composer + +# The hooks executed at various points in the lifecycle of the application. +hooks: + # The build hook runs after Composer to finish preparing up your code. + # No services are available but the disk is writeable. + build: | + set -e + # The deploy hook runs after your application has been deployed and started. + # Code cannot be modified at this point but the database is available. + # The site is not accepting requests while this script runs so keep it + # fast. + deploy: | + set -e + php ./drush/platformsh_generate_drush_yml.php + cd web + drush -y cache-rebuild + drush -y updatedb + drush -y config-import + +# The configuration of app when it is exposed to the web. +web: + locations: + # All requests not otherwise specified follow these rules. + '/': + # The folder from which to serve static assets, for this location. + # + # This is a filesystem path, relative to the application root. + root: 'web' + + # How long to allow static assets from this location to be cached. + # + # Can be a time in seconds, or -1 for no caching. Times can be + # suffixed with "s" (seconds), "m" (minutes), "h" (hours), "d" + # (days), "w" (weeks), "M" (months, as 30 days) or "y" (years, as + # 365 days). + expires: 5m + + # Redirect any incoming request to Drupal's front controller. + passthru: '/index.php' + + # Deny access to all static files, except those specifically allowed below. + allow: false + + # Rules for specific URI patterns. + rules: + # Allow access to common static files. + '\.(jpe?g|png|gif|svgz?|css|js|map|ico|bmp|eot|woff2?|otf|ttf)$': + allow: true + '^/robots\.txt$': + allow: true + '^/sitemap\.xml$': + allow: true + + # Deny direct access to configuration files. + '^/sites/sites\.php$': + scripts: false + '^/sites/[^/]+/settings.*?\.php$': + scripts: false + + # The files directory has its own special configuration rules. + '/sites/default/files': + # Allow access to all files in the public files directory. + allow: true + expires: 5m + passthru: '/index.php' + root: 'web/sites/default/files' + + # Do not execute PHP scripts from the writeable mount. + scripts: false + + rules: + # Provide a longer TTL (2 weeks) for aggregated CSS and JS files. + '^/sites/default/files/(css|js)': + expires: 2w + +crons: + # Run Drupal's cron tasks every 19 minutes. + drupal: + spec: '*/19 * * * *' + cmd: 'cd web ; drush core-cron' + +source: + operations: + auto-update: + command: | + curl -fsS https://raw.githubusercontent.com/platformsh/source-operations/main/setup.sh | { bash /dev/fd/3 sop-autoupdate; } 3<&0 + diff --git a/templates/contentacms/files/.platform/routes.yaml b/templates/contentacms/files/.platform/routes.yaml new file mode 100644 index 000000000..425c96292 --- /dev/null +++ b/templates/contentacms/files/.platform/routes.yaml @@ -0,0 +1,17 @@ +# The routes of the project. +# +# Each route describes how an incoming URL is going +# to be processed by Platform.sh. + +"https://{default}/": + type: upstream + upstream: "app:http" + cache: + enabled: true + + # Base the cache on the session cookie and custom Drupal cookies. Ignore all other cookies. + cookies: ['/^SS?ESS/', '/^Drupal.visitor/'] + +"https://www.{default}/": + type: redirect + to: "https://{default}/" diff --git a/templates/contentacms/files/.platform/services.yaml b/templates/contentacms/files/.platform/services.yaml new file mode 100644 index 000000000..6eae3c595 --- /dev/null +++ b/templates/contentacms/files/.platform/services.yaml @@ -0,0 +1,11 @@ +# The services of the project. +# +# Each service listed will be deployed +# to power your Platform.sh project. + +db: + type: mariadb:10.4 + disk: 2048 + +cache: + type: redis:6.0 diff --git a/templates/contentacms/files/README.md b/templates/contentacms/files/README.md new file mode 100644 index 000000000..9debdb57c --- /dev/null +++ b/templates/contentacms/files/README.md @@ -0,0 +1,46 @@ +# Drupal 9 for Platform.sh + +

+ + Deploy on Platform.sh + +

+ +This template builds Drupal 9 using the "Drupal Recommended" Composer project. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. + +Drupal is a flexible and extensible PHP-based CMS framework. + +## Features + +* PHP 8.1 +* MariaDB 10.4 +* Redis 5 +* Drush included +* Automatic TLS certificates +* Composer-based build + +## Post-install + +Run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. + +## Customizations + +The following changes have been made relative to Drupal 9 "Recommended" project as it is downloaded from Drupal.org or Packagist. If using this project as a reference for your own existing project, replicate the changes below to your project. + +* The `.platform.app.yaml`, `.platform/services.yaml`, and `.platform/routes.yaml` files have been added. These provide Platform.sh-specific configuration and are present in all projects on Platform.sh. You may customize them as you see fit. +* An additional Composer library, [`platformsh/config-reader`](https://github.com/platformsh/config-reader-php), has been added. It provides convenience wrappers for accessing the Platform.sh environment variables. +* Drush and Drupal Console have been pre-included in `composer.json`. You are free to remove one or both if you do not wish to use them. (Note that the default cron and deploy hooks make use of Drush commands, however.) +* A `.environment` file has been added, which allows executable app dependencies from Composer to be run from the path. +* The Drupal Redis module comes pre-installed. The placeholder module is not pre-installed, but it is enabled via `settings.platformsh.php` out of the box. +* The `settings.platformsh.php` file contains Platform.sh-specific code to map environment variables into Drupal configuration. You can add to it as needed. See the documentation for more examples of common snippets to include here. It uses the Config Reader library. +* The `settings.php` file has been heavily customized to only define those values needed for both Platform.sh and local development. It calls out to `settings.platformsh.php` if available. You can add additional values as documented in `default.settings.php` as desired. It is also setup such that when you install Drupal on Platform.sh the installer will not ask for database credentials as they will already be defined. + +## Migration + +If you are looking to replicate the changes in this template to migrate your own Drupal 9 project, be sure to checkout the [Deploying Drupal 9 guide](https://docs.platform.sh/guides/drupal9/deploy.html) in the documentation as a reference. + +## References + +* [Drupal](https://www.drupal.org/) +* [Drupal on Platform.sh](https://docs.platform.sh/frameworks/drupal8.html) +* [PHP on Platform.sh](https://docs.platform.sh/languages/php.html) diff --git a/templates/contentacms/files/config/sync/.gitkeep b/templates/contentacms/files/config/sync/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/templates/contentacms/files/drush/platformsh_generate_drush_yml.php b/templates/contentacms/files/drush/platformsh_generate_drush_yml.php new file mode 100644 index 000000000..19f09554f --- /dev/null +++ b/templates/contentacms/files/drush/platformsh_generate_drush_yml.php @@ -0,0 +1,80 @@ +inRuntime()) { + return; + } + + $routes = $platformsh->getUpstreamRoutes($platformsh->applicationName); + + // Sort URLs, with the primary route first, then by HTTPS before HTTP, then by length. + usort($routes, function (array $a, array $b) { + // false sorts before true, normally, so negate the comparison. + return + [!$a['primary'], strpos($a['url'], 'https://') !== 0, strlen($a['url'])] + <=> + [!$a['primary'], strpos($a['url'], 'https://') !== 0, strlen($b['url'])]; + }); + + // Return the url of the first one. + return reset($routes)['url'] ?: NULL; +} + +$appRoot = dirname(__DIR__); +$filename = $appRoot . '/.drush/drush.yml'; + +$siteUrl = _platformsh_drush_site_url(); + +if (empty($siteUrl)) { + echo "Failed to find a site URL\n"; + + if (file_exists($filename)) { + echo "The file exists but may be invalid: $filename\n"; + } + + exit(1); +} + +$siteUrlYamlEscaped = json_encode($siteUrl, JSON_UNESCAPED_SLASHES); +$scriptPath = __FILE__; + +$success = file_put_contents($filename, <<hasRelationship('database')) { + $creds = $platformsh->credentials('database'); + $databases['default']['default'] = [ + 'driver' => $creds['scheme'], + 'database' => $creds['path'], + 'username' => $creds['username'], + 'password' => $creds['password'], + 'host' => $creds['host'], + 'port' => $creds['port'], + 'pdo' => [PDO::MYSQL_ATTR_COMPRESS => !empty($creds['query']['compression'])] + ]; +} + +// Enable verbose error messages on development branches, but not on the production branch. +// You may add more debug-centric settings here if desired to have them automatically enable +// on development but not production. +if (isset($platformsh->branch)) { + // Production type environment. + if ($platformsh->branch == 'master' || $platformsh->onDedicated()) { + $config['system.logging']['error_level'] = 'hide'; + } // Development type environment. + else { + $config['system.logging']['error_level'] = 'verbose'; + } +} + +// Enable Redis caching. +if ($platformsh->hasRelationship('redis') && !InstallerKernel::installationAttempted() && extension_loaded('redis') && class_exists('Drupal\redis\ClientFactory')) { + $redis = $platformsh->credentials('redis'); + + // Set Redis as the default backend for any cache bin not otherwise specified. + $settings['cache']['default'] = 'cache.backend.redis'; + $settings['redis.connection']['host'] = $redis['host']; + $settings['redis.connection']['port'] = $redis['port']; + + // Apply changes to the container configuration to better leverage Redis. + // This includes using Redis for the lock and flood control systems, as well + // as the cache tag checksum. Alternatively, copy the contents of that file + // to your project-specific services.yml file, modify as appropriate, and + // remove this line. + $settings['container_yamls'][] = 'modules/contrib/redis/example.services.yml'; + + // Allow the services to work before the Redis module itself is enabled. + $settings['container_yamls'][] = 'modules/contrib/redis/redis.services.yml'; + + // Manually add the classloader path, this is required for the container cache bin definition below + // and allows to use it without the redis module being enabled. + $class_loader->addPsr4('Drupal\\redis\\', 'modules/contrib/redis/src'); + + // Use redis for container cache. + // The container cache is used to load the container definition itself, and + // thus any configuration stored in the container itself is not available + // yet. These lines force the container cache to use Redis rather than the + // default SQL cache. + $settings['bootstrap_container_definition'] = [ + 'parameters' => [], + 'services' => [ + 'redis.factory' => [ + 'class' => 'Drupal\redis\ClientFactory', + ], + 'cache.backend.redis' => [ + 'class' => 'Drupal\redis\Cache\CacheBackendFactory', + 'arguments' => ['@redis.factory', '@cache_tags_provider.container', '@serialization.phpserialize'], + ], + 'cache.container' => [ + 'class' => '\Drupal\redis\Cache\PhpRedis', + 'factory' => ['@cache.backend.redis', 'get'], + 'arguments' => ['container'], + ], + 'cache_tags_provider.container' => [ + 'class' => 'Drupal\redis\Cache\RedisCacheTagsChecksum', + 'arguments' => ['@redis.factory'], + ], + 'serialization.phpserialize' => [ + 'class' => 'Drupal\Component\Serialization\PhpSerialize', + ], + ], + ]; +} + +if ($platformsh->inRuntime()) { + // Configure private and temporary file paths. + if (!isset($settings['file_private_path'])) { + $settings['file_private_path'] = $platformsh->appDir . '/private'; + } + if (!isset($settings['file_temp_path'])) { + $settings['file_temp_path'] = $platformsh->appDir . '/tmp'; + } + +// Configure the default PhpStorage and Twig template cache directories. + if (!isset($settings['php_storage']['default'])) { + $settings['php_storage']['default']['directory'] = $settings['file_private_path']; + } + if (!isset($settings['php_storage']['twig'])) { + $settings['php_storage']['twig']['directory'] = $settings['file_private_path']; + } + + // Set the project-specific entropy value, used for generating one-time + // keys and such. + $settings['hash_salt'] = $settings['hash_salt'] ?? $platformsh->projectEntropy; + + // Set the deployment identifier, which is used by some Drupal cache systems. + $settings['deployment_identifier'] = $settings['deployment_identifier'] ?? $platformsh->treeId; +} + +// The 'trusted_hosts_pattern' setting allows an admin to restrict the Host header values +// that are considered trusted. If an attacker sends a request with a custom-crafted Host +// header then it can be an injection vector, depending on how the Host header is used. +// However, Platform.sh already replaces the Host header with the route that was used to reach +// Platform.sh, so it is guaranteed to be safe. The following line explicitly allows all +// Host headers, as the only possible Host header is already guaranteed safe. +$settings['trusted_host_patterns'] = ['.*']; + +// Import variables prefixed with 'drupalsettings:' into $settings +// and 'drupalconfig:' into $config. +foreach ($platformsh->variables() as $name => $value) { + $parts = explode(':', $name); + list($prefix, $key) = array_pad($parts, 3, null); + switch ($prefix) { + // Variables that begin with `d8settings` or `drupal` get mapped + // to the $settings array verbatim, even if the value is an array. + // For example, a variable named d8settings:example-setting' with + // value 'foo' becomes $settings['example-setting'] = 'foo'; + case 'drupalsettings': + case 'drupal': + $settings[$key] = $value; + break; + // Variables that begin with `d8config` get mapped to the $config + // array. Deeply nested variable names, with colon delimiters, + // get mapped to deeply nested array elements. Array values + // get added to the end just like a scalar. Variables without + // both a config object name and property are skipped. + // Example: Variable `d8config:conf_file:prop` with value `foo` becomes + // $config['conf_file']['prop'] = 'foo'; + // Example: Variable `d8config:conf_file:prop:subprop` with value `foo` becomes + // $config['conf_file']['prop']['subprop'] = 'foo'; + // Example: Variable `d8config:conf_file:prop:subprop` with value ['foo' => 'bar'] becomes + // $config['conf_file']['prop']['subprop']['foo'] = 'bar'; + // Example: Variable `d8config:prop` is ignored. + case 'drupalconfig': + if (count($parts) > 2) { + $temp = &$config[$key]; + foreach (array_slice($parts, 2) as $n) { + $prev = &$temp; + $temp = &$temp[$n]; + } + $prev[$n] = $value; + } + break; + } +} diff --git a/templates/contentacms/platformsh.wizard.yaml b/templates/contentacms/platformsh.wizard.yaml new file mode 100644 index 000000000..e91063e22 --- /dev/null +++ b/templates/contentacms/platformsh.wizard.yaml @@ -0,0 +1,89 @@ +steps: + - id: "understanding_platformsh" + label: "Preparing for development" + title: "Preparing for development on Platform.sh" + required: true + bodyText: "

Congrats! We’ve started the first deployment to production for you.

\n

Once complete, select your default environment to see your production URL. Feel free to visit your website to complete the Drupal 9 installation steps.

\n

Git-driven development

\n

Platform.sh supports Git-driven development by design. Changes happen right in your code.  When SSH’ing into your website, all files are read-only by default.

\n

Mark the directories that you want to edit as write access. (See mounts documentation).

" + copyCode: [] + - id: "download_cli" + label: "Download the CLI" + title: "Download the Platform.sh CLI" + required: false + bodyText: "

To install the CLI, use the command for either macOS or Windows as shown.

\n

For more info about our CLI check out our documentation or take a look at our CLI source code.

" + copyCode: + - label: "macOS and Linux Installer" + code: + - "curl -sS https://platform.sh/cli/installer | php" + - label: "Windows Installer" + code: + - "curl https://platform.sh/cli/installer -o cli-installer.php" + - "php cli-installer.php" + - id: "download_project" + label: "Download your project" + title: "Download your project to start using it" + required: true + bodyText: "

The easiest way to download your project and prepare your SSH authentication is to use the Platform CLI.

\n

The platform get command will not only download your project but will also take care of your SSH authentication.

\n

Manually authenticate by adding your SSH key to your account.

" + copyCode: + - label: "Download your project" + code: + - "platform get" + - "" + - "# Using Git? Add your SSH Key and git clone " + - id: "prepare_staging" + label: "Creating dev branches" + title: "Clone production to your first development environment!" + required: true + bodyText: "

You'll now create a perfect live replica of production on Platform.sh and switch to that branch locally. Cool, huh!

\n

You can now modify your code and test your changes locally before pushing them to your live site on Platform.sh.

" + copyCode: + - label: 'Clone production environment to "develop" on Platform.sh and check it out locally.' + code: + - "platform environment:branch develop" + - label: "Using Git?" + code: + - "git checkout -b develop" + - "git push platform develop" + - "" + - "# Head to console.platform.sh to see live URL for your develop branch" + - id: "development" + label: "The first development change!" + title: "Making your first change in development" + required: false + bodyText: "

Let's try modifying your code and reviewing it locally. We’ll install the Pathauto extension.

" + copyCode: + - label: "Install the Pathauto extension to see it listed within the Drupal “Extend” page." + code: + - "composer require drupal/pathauto" + - "" + - '# Confirm it’s installed. "- Installing drupal/pathauto…"' + - id: "deploy" + label: "Deploy your changes" + title: "You're ready to deploy some code!" + required: false + bodyText: "

Congrats. You’ve installed drupal/pathauto.

\n

Let's publish those changes to Platform.sh and review them before merging them into production!

" + copyCode: + - label: "Save your changes and review your live develop website." + code: + - 'git add composer.json composer.lock && git commit -m "My first Platform.sh update";' + - "" + - "platform push" + - label: "Happy? Merge into production!" + code: + - "platform merge" + - "" + - "#Using git?" + - "git checkout main" + - "git merge develop" + - "git push platform main" + - id: "understanding_infrastructure" + label: "Know your infrastructure" + title: "Customize your infrastructure on Platform.sh" + required: false + bodyText: "

Finally, your project is a typical Drupal 9 installation, with 3 new files to help you deploy on Platform.sh.

\n

.platform.app.yaml Build steps, jobs, storage mounts, and more

\n

.platform/services.yaml Add services, e.g., databases, Redis

\n

.platform/routes.yaml Add domains, subdomains, and redirects

\n

< Default Strapi Code >

\n

See the readme.md in your project files for more info

\n

Explore these files to create additional apps, services, and routes for your project.

" + copyCode: + - label: "Application code structure" + code: + - "├── .platform" + - "│ ├── routes.yaml" + - "│ └── services.yaml" + - "├── .platform.app.yaml" + - "└── < application code >" diff --git a/templates/drupal8-govcms8/files/.platform.app.yaml b/templates/drupal8-govcms8/files/.platform.app.yaml index 169f2ad69..c9a35c426 100644 --- a/templates/drupal8-govcms8/files/.platform.app.yaml +++ b/templates/drupal8-govcms8/files/.platform.app.yaml @@ -4,15 +4,18 @@ # See https://docs.platform.sh/configuration/app.html # The name of this app. Must be unique within a project. -name: 'app' +name: 'drupal' # The runtime the application uses. -type: 'php:7.4' +type: 'php:8.0' runtime: # Enable the redis extension so Drupal can communicate with the Redis cache. extensions: - redis + - blackfire + - sodium + - apcu # The relationships of the application with services or other applications. # diff --git a/templates/drupal8-govcms8/files/.platform/routes.yaml b/templates/drupal8-govcms8/files/.platform/routes.yaml index 425c96292..69ba2fcd0 100644 --- a/templates/drupal8-govcms8/files/.platform/routes.yaml +++ b/templates/drupal8-govcms8/files/.platform/routes.yaml @@ -5,7 +5,7 @@ "https://{default}/": type: upstream - upstream: "app:http" + upstream: "drupal:http" cache: enabled: true diff --git a/templates/drupal8-govcms8/files/README.md b/templates/drupal8-govcms8/files/README.md index 7399eb28e..b49aec376 100644 --- a/templates/drupal8-govcms8/files/README.md +++ b/templates/drupal8-govcms8/files/README.md @@ -1,43 +1,835 @@ -# GovCMS Drupal Distribution for Platform.sh + +

+ + + +

- - Deploy on Platform.sh + +

-This template builds the Australian government's GovCMS Drupal 8 distribution using the [Drupal Composer project](https://github.com/drupal-composer/drupal-project) for better flexibility. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. +

Deploy the GovCMS Drupal Distribution on Platform.sh

+ +

+Contribute, request a feature, or check out our resources +
+
+Join our community       +Documentation       +Blog       +Report a bug       +Request a feature +

+

+ +

+ +Open issues +   + +Open PRs +   + +License +   +

+ +

+

+ +
+ +

+Contents +

+About       +Getting started       +Migrate       +Learn       +Contribute       +
+

+
+ +## About + +This template builds the Australian government's GovCMS Drupal 9 distribution using the [Drupal Composer project](https://github.com/drupal-composer/drupal-project) for better flexibility. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. GovCMS is a Drupal distribution built for the Australian government, and includes configuration optimized for managing government websites. -## Features +### Features + +- PHP 8.0 +- MariaDB 10.4 +- Redis 6 +- Drush included +- Automatic TLS certificates +- Composer-based build + + +## Getting started + +### Deploy + +#### Quickstart + + +The quickest way to deploy this template on Platform.sh is by clicking the button below. +This will automatically create a new project and initialize the repository for you. + +

+ + Deploy on Platform.sh + +

+
+ + + +You can also quickly recreate this project locally with the following command: + +```bash +composer create-project platformsh/govcms9 -s dev +``` + + +> **Note:** +> +> Platform.sh templates prioritize upstream release versions over our own. Despite this, we update template dependencies on a scheduled basis independent of those upstreams. Because of this, template repos do not contain releases. This may change in the future, but until then the `-s dev` flag is necessary to use `composer create-project`. + + + +#### Other deployment options + +For all of the other options below, clone this repository first: + +```bash +git clone https://github.com/platformsh-templates/drupal8-govcms8 +``` + +If you're trying to deploy from GitHub, you can generate a copy of this repository first in your own namespace by clicking the [Use this template](https://github.com/platformsh-templates/drupal8-govcms8/generate) button at the top of this page. + +Then you can clone a copy of it locally with `git clone git@github.com:YOUR_NAMESPACE/drupal8-govcms8.git`. + + +
+Deploy directly to Platform.sh from the command line + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
+ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
+ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
+ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
+ + + +### Post-install + +Run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. + +### Local development + +This section provides instructions for running the `drupal8-govcms8` template locally, connected to a live database instance on an active Platform.sh environment. + +In all cases for developing with Platform.sh, it's important to develop on an isolated environment - do not connect to data on your production environment when developing locally. +Each of the options below assume that you have already deployed this template to Platform.sh, as well as the following starting commands: + +```bash +$ platform get PROJECT_ID +$ cd project-name +$ platform environment:branch updates +``` + +
+Drupal: using ddev
+ +ddev provides an integration with Platform.sh that makes it simple to develop Drupal locally. Check the [providers documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for the most up-to-date information. + +In general, the steps are as follows: + +1. [Install ddev](https://ddev.readthedocs.io/en/stable/#installation). +1. A configuration file has already been provided at `.ddev/providers/platform.yaml`, so you should not need to run `ddev config`. +1. [Retrieve an API token](https://docs.platform.sh/development/cli/api-tokens.html#get-a-token) for your organization via the management console. +1. Update your dedev global configuration file to use the token you've just retrieved: + ```yaml + web_environment: + - PLATFORMSH_CLI_TOKEN=abcdeyourtoken` + ``` +1. Run `ddev restart`. +1. Get your project ID with `platform project:info`. If you have not already connected your local repo with the project (as is the case with a source integration, by default), you can run `platform project:list` to locate the project ID, and `platform project:set-remote PROJECT_ID` to configure Platform.sh locally. +1. Update the `.ddev/providers/platform.yaml` file for your current setup: + ```yaml + environment_variables: + project_id: PROJECT_ID + environment: CURRENT_ENVIRONMENT + application: drupal + ``` +1. Get the current environment's data with `ddev pull platform`. +1. When you have finished with your work, run `ddev stop` and `ddev poweroff`. + +
+
+Drupal: using Lando
+ +Lando supports PHP applications [configured to run on Platform.sh](https://docs.platform.sh/development/local/lando.html), and pulls from the same container registry Platform.sh uses on your remote environments during your local builds through its own [recipe and plugin](https://docs.lando.dev/platformsh/). + +1. [Install Lando](https://docs.lando.dev/getting-started/installation.html). +1. Make sure Docker is already running - Lando will attempt to start Docker for you, but it's best to have it running in the background before beginning. +1. Start your apps and services with the command `lando start`. +1. To get up-to-date data from your Platform.sh environment ([services *and* mounts](https://docs.lando.dev/platformsh/sync.html#pulling)), run the command `lando pull`. +1. If at any time you have updated your Platform.sh configuration files, run the command `lando rebuild`. +1. When you have finished with your work, run `lando stop` and `lando poweroff`. + +
+ + + +> **Note:** +> +> For many of the steps above, you may need to include the CLI flags `-p PROJECT_ID` and `-e ENVIRONMENT_ID` if you are not in the project directory or if the environment is associated with an existing pull request. + + +## Migrate + +The steps below outline the important steps for migrating your application to Platform.sh - adding the required configuration files and dependencies, for example. +Not every step will be applicable to each person's migration. +These steps actually assume the earliest starting point possible - that there is no code at all locally, and that this template repository will be rebuilt completely from scratch. + +- [Getting started](#getting-started-1) +- [Adding and updating files](#adding-and-updating-files) +- [Dependencies](#dependencies) +- [Deploying to Platform.sh](#deploying-to-platformsh) +- [Migrating your data](#migrating-your-data) +- [Next steps](#next-steps) + +If you already have code you'd like to migrate, feel free to focus on the steps most relevant to your application and skip the first section. + +### Getting started + +Assuming that your starting point is no local code, the steps below will setup a starting repository we can begin to make changes to to rebuild this template and migrate to Platform.sh. +If you already have a codebase you are trying to migrate, move onto the next step - [Adding and updating files](#adding-and-updating-files) - and substitute any reference to the default branch `main` with some other branch name. + + + +```bash +$ mkdir drupal8-govcms8 && cd drupal8-govcms8 +$ git init +$ git remote add upstream https://github.com/govCMS/GovCMS.git +$ git branch -m main +$ git fetch --all --depth=2 +$ git fetch --all --tags +$ git merge --allow-unrelated-histories -X theirs 2.12.0 + +``` + + + +### Adding and updating files + +A small number of files need to be added to or modified in your repository at this point. +Some of them explicitly configure how the application is built and deployed on Platform.sh, while others simply modify files you may already have locally, in which case you will need to replicate those changes. + +Open the dropdown below to view all of the **Added** and **Updated** files you'll need to reproduce in your migration. + +
+View files
+ + + +| File | Purpose | +|:-----------|:--------| +| [`config/sync/.gitkeep`](config/sync/.gitkeep) | **Added** | +| [`.environment`](.environment) | **Added:**

The `.environment` file is a convenient place to [set environment variables](https://docs.platform.sh/development/variables/set-variables.html#set-variables-via-script) relevant to your applications that may be dependent on the current environment. It is sourced before the start command is run, as the first step in the `deploy` and `post_deploy` hooks, and at the beginning of each session when you SSH into an application container. It is written in dash, so be aware of the differences to bash.

It can be used to set any environment variable, including ones that depend on Platform.sh-provided variables like `PLATFORM_RELATIONSHIPS` and `PLATFORM_ROUTES`, or to modify `PATH`. This file should not [produce output](https://docs.platform.sh/development/variables/set-variables.html#testing-environment-scripts).

Here, the Composer config and `PATH` are updated to allow executable app dependencies from Composer to be run from the path (i.e. `drush`). | +| [`.gitignore`](.gitignore) | **Added:**

A `.gitignore` file is not included in the upstream, so one has been added. | +| [`scripts/composer/ScriptHandler.php`](scripts/composer/ScriptHandler.php) | | +| [`.lando.upstream.yml`](.lando.upstream.yml) | **Added:**

This file configures [Lando](https://docs.platform.sh/development/local/lando.html) as a local development option for this template. See the [Platform.sh Lando plugin documentation](https://docs.lando.dev/platformsh/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. | +| [`.platform.app.yaml`](.platform.app.yaml) | **Added:**

This file is required to define the build and deploy process for all application containers on Platform.sh. Within this file, the runtime version, relationships to service containers, and writable mounts are configured. It's also in this file that it is defined what dependencies are installed, when they are installed, and that package manager will be used to do so.

Take a look at the [Application](https://docs.platform.sh/configuration/app.html) documentation for more details about configuration. For more information about the sequence of events that lead from a build to deployment, see the [Build and deploy timeline documentation](https://docs.platform.sh/overview/build-deploy.html).

This template uses Composer 2 to install dependencies using the default `composer` [build flavor](https://docs.platform.sh/languages/php.html#build-flavor) prior to the `build` hook. Drush tasks are run during the `deploy` hook, and referenced again during the defined `cron` job. | +| [`docroot/sites/default/settings.php`](docroot/sites/default/settings.php) | | +| [`docroot/sites/default/settings.platformsh.php`](docroot/sites/default/settings.platformsh.php) | | +| [`drush/platformsh_generate_drush_yml.php`](drush/platformsh_generate_drush_yml.php) | **Added:**

This file has been included to generate the drush yaml configuration on every deployment. | +| [`.platform/services.yaml`](.platform/services.yaml) | **Added:**

Platform.sh provides a number of on-demand managed services that can easily be added to your projects. It's within this file that each service's version, name, resources, and additional configuration are set. See the [Services documentation](https://docs.platform.sh/configuration/services.html) for more details on configuration, version and service availability.

In this template, MariaDB and Redis have been configured. | +| [`.platform/routes.yaml`](.platform/routes.yaml) | **Added:**

This file is require to deploy on Platform.sh, as it defines how requests should be handled on the platform. It's within this file that redirects and basic caching can be configured. See the [Routes documentation](https://docs.platform.sh/configuration/routes.html) for more configuration details.

| +| [`php.ini`](php.ini) | **Added:**

An initial `php.ini` file has also beed added. The settings are a result of performance testing and best practice recommendations coming from [Blackfire.io](https://blackfire.io). They will initialize Drupal with a number of good baseline performance settings for production applications, and complement many of the tests specified in [`.blackfire.yml`](.blackfire.yml). | +| [`.blackfire.yml`](.blackfire.yml) | **Added:**

This file has been added to help you get started using [Blackfire.io](https://blackfire.io) on your project. See [the Blackfire section below](#blackfireio-creating-a-continuous-observability-strategy) for more information on how to get started. | +| [`.lando.upstream.yml`](.lando.upstream.yml) | **Added:**

This file configures [Lando](https://docs.platform.sh/development/local/lando.html) as a local development option for this template. See the [Platform.sh Lando plugin documentation](https://docs.lando.dev/platformsh/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. | +| [`.ddev/providers/platform.yaml`](.ddev/providers/platform.yaml) | **Added:**

This file configures [ddev](https://ddev.readthedocs.io/en/latest/users/providers/platform/) as a local development option for this template. See the [Platform.sh ddev integration documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. Be sure to follow the instructions provided through the ddev CLI and in the comments section of that file to correctly configure ddev for your project. | + + + +
+ +### Dependencies and configuration + +Sometimes it is necessary to install additional dependencies to and modify the configuration of an upstream project to deploy on Platform.sh. +When it is, we do our best to keep these modifications to the minimum necessary. +Run the commands below to reproduce the dependencies in this template. + + + +```bash +$ composer require platformsh/config-reader drush/drush:^10 drupal/redis +$ composer config allow-plugins.composer/installers true --no-plugins +$ composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins +$ composer config allow-plugins.drupal/core-project-message true --no-plugins +$ composer config allow-plugins.cweagans/composer-patches true --no-plugins + +``` + + + +### Deploying to Platform.sh + +Your repository now has all of the code it needs in order to deploy to Platform.sh. + + +
+Deploy directly to Platform.sh from the command line + -* PHP 7.4 -* MariaDB 10.4 -* Redis 6 -* Drush and Drupal Console included -* Automatic TLS certificates -* Composer-based build +1. Create a free trial: -## Post-install + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. -Run through the GovCMS installer as normal. You will not be asked for database credentials as those are already provided. +1. Install the Platform.sh CLI -## Customizations + #### Linux/OSX -The following changes have been made relative to Drupal 8 / GovCMS as it is downloaded from Drupal.org. If using this project as a reference for your own existing project, replicate the changes below to your project. + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` -* It uses the Drupal Composer project, which allow the site to be managed entirely with Composer. That also causes the `vendor` and `config` directories to be placed outside of the web root for added security. See the [Drupal documentation](https://www.drupal.org/node/2404989) for tips on how best to leverage Composer with Drupal 8. -* The `.platform.app.yaml`, `.platform/services.yaml`, and `.platform/routes.yaml` files have been added. These provide Platform.sh-specific configuration and are present in all projects on Platform.sh. You may customize them as you see fit. -* An additional Composer library, [`platformsh/config-reader`](https://github.com/platformsh/config-reader-php), has been added. It provides convenience wrappers for accessing the Platform.sh environment variables. -* A `.environment` file has been added, which allows executable app dependencies from Composer to be run from the path. -* The `settings.platformsh.php` file contains Platform.sh-specific code to map environment variables into Drupal configuration. You can add to it as needed. See the documentation for more examples of common snippets to include here. It uses the Config Reader library. -* The `composer.json` file has been modified to skip the `phing push` step, as that results in the entire site being duplicated within the install profile. -* The `settings.php` file has been heavily customized to only define those values needed for both Platform.sh and local development. It calls out to `settings.platformsh.php` if available. You can add additional values as documented in `default.settings.php` as desired. It is also setup such that when you install Drupal on Platform.sh the installer will not ask for database credentials as they will already be defined. + #### Windows -## References + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
+ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
+ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
+ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
+ + + +### Migrating your data + + +If you are moving an existing site to Platform.sh, then in addition to code you also need to migrate your data. That means your database and your files. + +
+Importing the database
+ +First, obtain a database dump from your current site and save your dump file as `database.sql`. Then, import the database into your Platform.sh site using the CLI: + +```bash +platform sql -e main < database.sql +``` + +
+
+Importing files
+ +You first need to download your files from your current hosting environment. +The easiest way is likely with rsync, but consult your old host's documentation. + +The `platform mount:upload` command provides a straightforward way to upload an entire directory to your site at once to a `mount` defined in a `.platform.app.yaml` file. +Under the hood, it uses an SSH tunnel and rsync, so it is as efficient as possible. +(There is also a `platform mount:download` command you can use to download files later.) +Run the following from your local Git repository root (modifying the `--source` path if needed and setting `BRANCH_NAME` to the branch you are using). + +A few examples are listed below, but repeat for all directories that contain data you would like to migrate. + +```bash +$ platform mount:upload -e main --mount web/sites/default/files --source ./web/sites/default/files +$ platform mount:upload -e main --mount private --source ./private +``` + +Note that `rsync` is picky about its trailing slashes, so be sure to include those. + +
+ + + +### Next steps + +With your application now deployed on Platform.sh, things get more interesting. +Run the command `platform environment:branch new-feature` for your project, or open a trivial pull request off of your current branch. + +The resulting environment is an *exact* copy of production. +It contains identical infrastructure to what's been defined in your configuration files, and even includes data copied from your production environment in its services. +On this isolated environment, you're free to make any changes to your application you need to, and really test how they will behave on production. + +After that, here are a collection of additional resources you might find interesting as you continue with your migration to Platform.sh: + +- [Local development](#local-development) +- [Troubleshooting](#troubleshooting) +- [Adding a domain and going live](https://docs.platform.sh/domains/steps.html) +- [(CDN) Content Delivery Networks](https://docs.platform.sh/domains/cdn.html) +- [Performance and observability with Blackfire.io](https://docs.platform.sh/integrations/observability/blackfire.html) +- [Pricing](https://docs.platform.sh/overview/pricing.html) +- [Security and compliance](https://docs.platform.sh/security.html) + + +## Learn + +### Troubleshooting + + +
+Accessing logs
+ +After the environment has finished its deployment, you can investigate issues that occured on startup, `deploy` and `post_deploy` hooks, and generally at runtime using the CLI. Run the command: + +```bash +platform ssh +``` + +If you are running the command outside of a local copy of the project, you will need to include the `-p` (project) and/or `-e` (environment) flags as well. +Once you have connected to the container, [logs](https://docs.platform.sh/development/logs.html#container-logs) are available within `/var/log/` for you to investigate. + +
+ + +
+Rebuilding cache
+ +You may run into a database error after installing Drupal on your production environment initially. +To fix, SSH into the application container (`platform ssh`) and rebuild the cache using Drush: + +```bash +drush cache-rebuild +``` + +
+ + +
+Default hash_salt behavior
+ +Drupal's [default settings set](https://github.com/drupal/drupal/blob/9.3.x/core/assets/scaffold/files/default.settings.php#L252) `hash_salt` to an empty string: + +```php +$settings['hash_salt'] = ''; +``` + +In the past, Platform.sh templates have overridden this value: + +```php +$settings['hash_salt'] = $settings['hash_salt'] ?? $platformsh->projectEntropy; +``` + +This setting was insufficient to cover some user configurations - such as those cases when an application depends on a `Null` value for `hash_salt`. + +Now, the setting looks like this in `settings.platformsh.php`: + +```bash +$settings['hash_salt'] = empty($settings['hash_salt']) ? $platformsh->projectEntropy : $settings['hash_salt']; +``` + +This change sets `hash_salt` to the built-in environment variable `PLATFORM_PROJECT_ENTROPY` value if the project contains the default settings OR `Null`. +If your application code *depends* on an empty value, feel free to comment out that line, or reset again later in that file. + +Feel free to visit [`platformsh-templates/drupal9#73`](https://github.com/platformsh-templates/drupal9/pull/73) for more details on this discussion. + +
+ + + + +### Blackfire.io: creating a Continuous Observability Strategy + +This template includes a starting [`.blackfire.yml`](.blackfire.yml) file that can be used to enable [Application Performance Monitoring](https://blackfire.io/docs/monitoring-cookbooks/index), [Profiling](https://blackfire.io/docs/profiling-cookbooks/index), [Builds](https://blackfire.io/docs/builds-cookbooks/index) and [Performance Testing](https://blackfire.io/docs/testing-cookbooks/index) on your project. Platform.sh comes with Blackfire pre-installed on application containers, and [setting up requires minimal configuration](https://docs.platform.sh/integrations/observability/blackfire.html). + +* [What is Blackfire?](https://blackfire.io/docs/introduction) +* [Configuring Blackfire.io on a Platform.sh project](https://docs.platform.sh/integrations/observability/blackfire.html) +* [Blackfire.io Platform.sh documentation](https://blackfire.io/docs/integrations/paas/platformsh) +* [Profiling Cookbooks](https://blackfire.io/docs/profiling-cookbooks/index) +* [Monitoring Cookbooks](https://blackfire.io/docs/monitoring-cookbooks/index) +* [Testing Cookbooks](https://blackfire.io/docs/testing-cookbooks/index) +* [Using Builds](https://blackfire.io/docs/builds-cookbooks/index) +* [Configuring Integrations](https://blackfire.io/docs/integrations/index) + + +### Resources + + +- [GovCMS](https://www.govcms.gov.au/) +- [Drupal](https://www.drupal.org/) +- [Drupal 8 on Platform.sh](https://docs.platform.sh/guides/drupal9/deploy.html) +- [Platform.sh PHP documentation](https://docs.platform.sh/languages/php.html) + + + +### Contact + +This template is maintained by the Platform.sh Developer Relations team, and they will be notified of all issues and pull requests you open here. + +- **Community:** Share your question with the community, or see if it's already been asked on our [Community site](https://community.platform.sh). +- **Slack:** If you haven't done so already, you can join Platform.sh's [public Slack](https://chat.platform.sh/) channels and ping the `@devrel_team` with any questions. + + +### About Platform.sh + +This template has been specifically designed to deploy on Platform.sh. + +
+What is Platform.sh?
+ +Platform.sh is a unified, secure, enterprise-grade platform for building, running and scaling web applications. We’re the leader in Fleet Ops: Everything you need to manage your fleet of websites and apps is available from the start. Because infrastructure and workflows are handled from the start, apps just work, so teams can focus on what really matters: making faster changes, collaborating confidently, and scaling responsibly. Whether managing a fleet of ten or ten thousand sites and apps, Platform.sh is the Developer- preferred solution that scales right. + +Our key features include: + +* **GitOps: Git as the source of truth** + + Every branch becomes a development environment, and nothing can change without a commit. + +* **Batteries included: Managed infrastructure** + + [Simple abstraction in YAML](https://docs.platform.sh/configuration/yaml.html) for [committing and configuring infrastructure](https://docs.platform.sh/overview/structure.html), fully managed patch updates, and 24 [runtimes](https://docs.platform.sh/languages.html) & [services](https://docs.platform.sh/configuration/services.html) that can be added with a single line of code. + +* **Instant cloning: Branch, merge, repeat** + + [Reusable builds](https://docs.platform.sh/overview/build-deploy.html) and automatically inherited production data provide true staging environments - experiment in isolation, test, then destroy or merge. + +* **FleetOps: Fleet management platform** + + Leverage our public API along with custom tools like [Source Operations](https://docs.platform.sh/configuration/app/source-operations.html) and [Activity Scripts](https://docs.platform.sh/integrations/activity.html) to [manage thousands of applications](https://youtu.be/MILHG9OqhmE) - their dependency updates, fresh content, and upstream code. + + +To find out more, check out the demo below and go to our [website](https://platform.sh/product/). + +
+

+The Platform.sh demo +

+ + +
+ + + +## Contribute + +

Help us keep top-notch templates!

+ +Every one of our templates is open source, and they're important resources for users trying to deploy to Platform.sh for the first time or better understand the platform. They act as getting started guides, but also contain a number of helpful tips and best practices when working with certain languages and frameworks. + +See something that's wrong with this template that needs to be fixed? Something in the documentation unclear or missing? Let us know! + +

+How to contribute +

+Report a bug       +Submit a feature request       +Open a pull request       +
+

+
+

+Need help? +

+Ask the Platform.sh Community       +Join us on Slack       +
+

+
+

Thanks to all of our amazing contributors!

+
+

+ + + +

+ +

+Made with contrib.rocks +

-* [Drupal](https://www.drupal.org/) -* [GovCMS](https://www.govcms.gov.au/) -* [Drupal on Platform.sh](https://docs.platform.sh/frameworks/drupal8.html) -* [PHP on Platform.sh](https://docs.platform.sh/languages/php.html) +
diff --git a/templates/drupal8-govcms8/files/docroot/sites/default/settings.platformsh.php b/templates/drupal8-govcms8/files/docroot/sites/default/settings.platformsh.php index f181d832f..62c9cbd5b 100644 --- a/templates/drupal8-govcms8/files/docroot/sites/default/settings.platformsh.php +++ b/templates/drupal8-govcms8/files/docroot/sites/default/settings.platformsh.php @@ -108,7 +108,7 @@ // Set the project-specific entropy value, used for generating one-time // keys and such. - $settings['hash_salt'] = $settings['hash_salt'] ?? $platformsh->projectEntropy; + $settings['hash_salt'] = empty($settings['hash_salt']) ? $platformsh->projectEntropy : $settings['hash_salt']; // Set the deployment identifier, which is used by some Drupal cache systems. $settings['deployment_identifier'] = $settings['deployment_identifier'] ?? $platformsh->treeId; diff --git a/templates/drupal8-govcms8/files/drush/platformsh_generate_drush_yml.php b/templates/drupal8-govcms8/files/drush/platformsh_generate_drush_yml.php index 19f09554f..9dbb98c17 100644 --- a/templates/drupal8-govcms8/files/drush/platformsh_generate_drush_yml.php +++ b/templates/drupal8-govcms8/files/drush/platformsh_generate_drush_yml.php @@ -31,7 +31,7 @@ function _platformsh_drush_site_url() { return [!$a['primary'], strpos($a['url'], 'https://') !== 0, strlen($a['url'])] <=> - [!$a['primary'], strpos($a['url'], 'https://') !== 0, strlen($b['url'])]; + [!$b['primary'], strpos($b['url'], 'https://') !== 0, strlen($b['url'])]; }); // Return the url of the first one. diff --git a/templates/drupal8-govcms8/files/header.svg b/templates/drupal8-govcms8/files/header.svg new file mode 100644 index 000000000..b330106bf --- /dev/null +++ b/templates/drupal8-govcms8/files/header.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/templates/drupal8-govcms8/info/info.yaml b/templates/drupal8-govcms8/info/info.yaml new file mode 100644 index 000000000..b67cc66fe --- /dev/null +++ b/templates/drupal8-govcms8/info/info.yaml @@ -0,0 +1,94 @@ +title: "Deploy the GovCMS Drupal Distribution on Platform.sh" +id: platformsh/drupal9-govcms9 +profile: GovCMS 9 +name: GovCMS 9 +default_branch: master +tags: + - PHP + - Drupal + - CMS + - Symfony +related_blog_tags: + - Drupal +license: + type: "GPL-2.0" + location: "LICENSE.txt" +features: + - PHP 8.0 + - MariaDB 10.4 + - Redis 6 + - Drush included + - Automatic TLS certificates + - Composer-based build +# Use Markdown for links and formatting. They will be converted to HTML automatically when the .platform.template.yaml file is generated. +description: + - This template builds the Australian government's GovCMS Drupal 9 distribution using the [Drupal Composer project](https://github.com/drupal-composer/drupal-project) for better flexibility. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. + - GovCMS is a Drupal distribution built for the Australian government, and includes configuration optimized for managing government websites. +logo: + link: "https://www.drupal.org/" + images: + - "data:image/svg+xml,%3Csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390.52 390.5'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23222e5b;stroke:%23e72483;stroke-miterlimit:10;stroke-width:10px;%7D.cls-2%7Bfill:%23fff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M388.26,103.3v288h-288A92.65,92.65,0,0,1,7.74,298.71v-288h288A92.65,92.65,0,0,1,388.26,103.3Z' transform='translate(-2.74 -5.75)'/%3E%3Cpath class='cls-2' d='M120,199.28V183.19h41.58v38.05q-6.06,5.87-17.56,10.33a63.87,63.87,0,0,1-23.3,4.46q-15,0-26.13-6.28a40,40,0,0,1-16.74-18,58,58,0,0,1-5.61-25.44A55,55,0,0,1,78.5,159.8,42.14,42.14,0,0,1,96.81,142q9.18-4.75,22.87-4.76,17.79,0,27.79,7.46t12.87,20.63l-19.16,3.58a20.29,20.29,0,0,0-7.59-11.11q-5.57-4.06-13.91-4.07-12.65,0-20.1,8t-7.46,23.79q0,17,7.55,25.51t19.81,8.5a33.2,33.2,0,0,0,12.16-2.38,41.72,41.72,0,0,0,10.45-5.77V199.28Z' transform='translate(-2.74 -5.75)'/%3E%3Cpath class='cls-2' d='M175,198.83a37.52,37.52,0,0,1,4.49-17.66,30.87,30.87,0,0,1,12.74-13,37.79,37.79,0,0,1,18.41-4.5q15.71,0,25.74,10.2t10,25.77q0,15.7-10.13,26T210.77,236a40.18,40.18,0,0,1-18.15-4.3,29.56,29.56,0,0,1-13.13-12.61Q175,210.75,175,198.83Zm18.76,1q0,10.29,4.89,15.76a16,16,0,0,0,24.08,0q4.85-5.48,4.85-15.9,0-10.15-4.85-15.63a16,16,0,0,0-24.08,0Q193.76,189.52,193.76,199.81Z' transform='translate(-2.74 -5.75)'/%3E%3Cpath class='cls-2' d='M279.78,234.4l-27.89-69.19h19.22l13,35.31,3.78,11.8q1.5-4.5,1.89-5.93c.61-2,1.26-3.91,1.95-5.87l13.17-35.31h18.83l-27.5,69.19Z' transform='translate(-2.74 -5.75)'/%3E%3Cpath class='cls-2' d='M135.94,315.46l11.27,2.84q-3.56,13.88-12.75,21.16T112,346.75q-13.75,0-22.38-5.6a35,35,0,0,1-13.12-16.23A57.88,57.88,0,0,1,72,302.11q0-13.31,5.08-23.19a34.76,34.76,0,0,1,14.46-15,42.12,42.12,0,0,1,20.63-5.14q12.78,0,21.48,6.5t12.13,18.29l-11.08,2.61q-3-9.28-8.6-13.52t-14.16-4.24q-9.81,0-16.4,4.7a24.85,24.85,0,0,0-9.26,12.63,50.82,50.82,0,0,0-2.67,16.34A52.1,52.1,0,0,0,86.74,321a23.58,23.58,0,0,0,9.84,12.11,27.6,27.6,0,0,0,14.46,4,24.2,24.2,0,0,0,16-5.46Q133.62,326.21,135.94,315.46Z' transform='translate(-2.74 -5.75)'/%3E%3Cpath class='cls-2' d='M160.73,345.3V260.19h17l20.15,60.26q2.78,8.42,4.06,12.6,1.46-4.65,4.53-13.64l20.37-59.22h15.15V345.3H231.09V274.07L206.36,345.3H196.2l-24.61-72.45V345.3Z' transform='translate(-2.74 -5.75)'/%3E%3Cpath class='cls-2' d='M256.28,318l10.63-.92a23.36,23.36,0,0,0,3.51,10.47,19.14,19.14,0,0,0,8.56,6.62A32.3,32.3,0,0,0,292,336.65a31.23,31.23,0,0,0,11.38-1.92,15.79,15.79,0,0,0,7.34-5.25,12.19,12.19,0,0,0,2.41-7.29,11,11,0,0,0-2.32-7q-2.33-3-7.66-5A150.87,150.87,0,0,0,288,306q-11.73-2.81-16.43-5.31a23.08,23.08,0,0,1-9.09-7.92,19.44,19.44,0,0,1-3-10.59,21.61,21.61,0,0,1,3.66-12.05,22.73,22.73,0,0,1,10.68-8.51,40.62,40.62,0,0,1,15.62-2.9,42.69,42.69,0,0,1,16.69,3.05,24.08,24.08,0,0,1,11.12,9,25.76,25.76,0,0,1,4.17,13.41l-10.79.81q-.87-8.07-5.89-12.19T290,268.67q-10.21,0-14.89,3.74a11.25,11.25,0,0,0-4.67,9A9.68,9.68,0,0,0,273.7,289q3.26,3,17,6.06t18.84,5.43q7.43,3.43,11,8.68a21.15,21.15,0,0,1,3.54,12.1,23.15,23.15,0,0,1-3.89,12.8A25.63,25.63,0,0,1,309,343.41a39,39,0,0,1-16.4,3.34q-11.56,0-19.36-3.37A27.05,27.05,0,0,1,261,333.25,28.79,28.79,0,0,1,256.28,318Z' transform='translate(-2.74 -5.75)'/%3E%3Cpolygon class='cls-2' points='186.28 60.68 162.91 53.52 175.09 74.71 154.92 88.53 179.08 92.22 177.31 116.6 195.26 100.01 213.22 116.6 211.44 92.22 235.6 88.53 215.43 74.71 227.62 53.52 204.24 60.68 195.26 37.94 186.28 60.68'/%3E%3C/svg%3E" +sections: + "create-project": "composer create-project platformsh/govcms9 -s dev" + metrics: false + blackfire: true + postinstall: "templates/drupal8-govcms8/info/post_install.md" + local: + - "common/readme/drupal/local_ddev.md" + - "common/readme/drupal/local_lando.md" + resources: + - "[GovCMS](https://www.govcms.gov.au/)" + - "[Drupal](https://www.drupal.org/)" + - "[Drupal 8 on Platform.sh](https://docs.platform.sh/guides/drupal9/deploy.html)" + - "[Platform.sh PHP documentation](https://docs.platform.sh/languages/php.html)" + migration: + mounts: + - "web/sites/default/files" + - "private" + files: + "web/sites/default/settings.platformsh.php": + - "**Added:**

" + - "Contains Platform.sh-specific configuration, namely setting up the database connection to the MariaDB service and caching via Redis." + "config/sync/.gitkeep": + - "**Added**" + "web/sites/default/settings.php": + - "**Updated:**

" + - "The Drupal settings file has been updated to import and use `web/sites/default/settings.platformsh.php`." + ".environment": + - "**Added:**

" + - file: "common/readme/file_descriptions/.environment.md" + - "Here, the Composer config and `PATH` are updated to allow executable app dependencies from Composer to be run from the path (i.e. `drush`)." + ".blackfire.yml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.blackfire.yml.md" + ".gitignore": + - "**Added:**

" + - "A `.gitignore` file is not included in the upstream, so one has been added." + ".lando.upstream.yml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.lando.upstream.yml.md" + ".platform.app.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.app.yaml.md" + - "This template uses Composer 2 to install dependencies using the default `composer` [build flavor](https://docs.platform.sh/languages/php.html#build-flavor) prior to the `build` hook." + - "Drush tasks are run during the `deploy` hook, and referenced again during the defined `cron` job." + "drush/platformsh_generate_drush_yml.php": + - "**Added:**

" + - "This file has been included to generate the drush yaml configuration on every deployment." + ".ddev/providers/platform.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.ddev.providers.platform.yaml.md" + "php.ini": + - "**Added:**

" + - file: "common/readme/drupal/php.ini.md" + ".platform/services.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.services.yaml.md" + - "In this template, MariaDB and Redis have been configured." + ".platform/routes.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.routes.yaml.md" + troubleshoot: + - file: "common/readme/troubleshoot_ssh.md" + - file: "common/readme/drupal/troubleshoot_cache.md" + - file: "common/readme/drupal/troubleshoot_hashsalt.md" diff --git a/templates/drupal8-govcms8/info/post_install.md b/templates/drupal8-govcms8/info/post_install.md new file mode 100644 index 000000000..795b018e1 --- /dev/null +++ b/templates/drupal8-govcms8/info/post_install.md @@ -0,0 +1,3 @@ +### Post-install + +Run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. diff --git a/templates/drupal8-multisite/files/.platform.app.yaml b/templates/drupal8-multisite/files/.platform.app.yaml index 1d7cf1388..04d10ab3e 100644 --- a/templates/drupal8-multisite/files/.platform.app.yaml +++ b/templates/drupal8-multisite/files/.platform.app.yaml @@ -4,7 +4,7 @@ # See https://docs.platform.sh/configuration/app.html # The name of this app. Must be unique within a project. -name: 'app' +name: 'drupal' # The runtime the application uses. type: 'php:7.4' @@ -17,6 +17,9 @@ runtime: # Enable the redis extension so Drupal can communicate with the Redis cache. extensions: - redis + - sodium + - blackfire + - apcu # The relationships of the application with services or other applications. # diff --git a/templates/drupal8-multisite/files/.platform/routes.yaml b/templates/drupal8-multisite/files/.platform/routes.yaml index 125434d0e..3f4b56943 100644 --- a/templates/drupal8-multisite/files/.platform/routes.yaml +++ b/templates/drupal8-multisite/files/.platform/routes.yaml @@ -5,7 +5,7 @@ "https://first.{default}/": type: upstream - upstream: "app:http" + upstream: "drupal:http" cache: enabled: true # Base the cache on the session cookie and custom Drupal cookies. Ignore all other cookies. @@ -13,8 +13,21 @@ "https://second.{default}/": type: upstream - upstream: "app:http" + upstream: "drupal:http" cache: enabled: true # Base the cache on the session cookie and custom Drupal cookies. Ignore all other cookies. cookies: ['/^SS?ESS/', '/^Drupal.visitor/'] + +"https://main.{default}/": + type: upstream + upstream: "drupal:http" + primary: true + cache: + enabled: true + # Base the cache on the session cookie and custom Drupal cookies. Ignore all other cookies. + cookies: ['/^SS?ESS/', '/^Drupal.visitor/'] + +"https://{default}/": + type: redirect + to: "https://main.{default}/" diff --git a/templates/drupal8-multisite/files/README.md b/templates/drupal8-multisite/files/README.md index 00e6d601d..981556de2 100644 --- a/templates/drupal8-multisite/files/README.md +++ b/templates/drupal8-multisite/files/README.md @@ -1,43 +1,733 @@ -# Drupal 8 Multisite for Platform.sh + +

+ + + +

- - Deploy on Platform.sh + +

-This template builds Drupal 8 in a multisite configuration using the "Drupal Recommended" Composer project. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. +

Drupal 8 Multisite for Platform.sh

+ +

+Contribute, request a feature, or check out our resources +
+
+Join our community       +Documentation       +Blog       +Report a bug       +Request a feature +

+

+ +

+ +Open issues +   + +Open PRs +   + +License +   +

+ +

+

+ +
+ +

+Contents +

+About       +Getting started       +Migrate       +Learn       +Contribute       +
+

+
+ +## About + +This template builds Drupal 8 in a multisite configuration using the "Drupal Recommended" Composer project, creating three subsite installations from the same codebase. + +It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. It also includes instructions and a script to help with setting up additional multisite instances, although depending on your particular needs it may require some customization. Drupal is a flexible and extensible PHP-based CMS framework capable of hosting multiple sites on a single code base. -## Features +### Features + +- PHP 7.4 +- MariaDB 10.4 +- Redis 6 +- Drush included +- Pre-configured for multiple sites +- Automatic TLS certificates +- Composer-based build + + +## Getting started + +### Deploy + +#### Quickstart + + +The quickest way to deploy this template on Platform.sh is by clicking the button below. +This will automatically create a new project and initialize the repository for you. + +

+ + Deploy on Platform.sh + +

+
+ + + +You can also quickly recreate this project locally with the following command: + +```bash +composer create-project platformsh/drupal8-multisite -s dev +``` + + +> **Note:** +> +> Platform.sh templates prioritize upstream release versions over our own. Despite this, we update template dependencies on a scheduled basis independent of those upstreams. Because of this, template repos do not contain releases. This may change in the future, but until then the `-s dev` flag is necessary to use `composer create-project`. + + + +#### Other deployment options + +For all of the other options below, clone this repository first: + +```bash +git clone https://github.com/platformsh-templates/drupal8-multisite +``` + +If you're trying to deploy from GitHub, you can generate a copy of this repository first in your own namespace by clicking the [Use this template](https://github.com/platformsh-templates/drupal8-multisite/generate) button at the top of this page. + +Then you can clone a copy of it locally with `git clone git@github.com:YOUR_NAMESPACE/drupal8-multisite.git`. + + +
+Deploy directly to Platform.sh from the command line + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
+ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
+ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
+ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
+ + + +### Post-install + +Each subsite installs separately. As configured, this project uses a subdomain for each subsite. For each subsite, run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. +### Local development + +This section provides instructions for running the `drupal8-multisite` template locally, connected to a live database instance on an active Platform.sh environment. + +In all cases for developing with Platform.sh, it's important to develop on an isolated environment - do not connect to data on your production environment when developing locally. +Each of the options below assume that you have already deployed this template to Platform.sh, as well as the following starting commands: + +```bash +$ platform get PROJECT_ID +$ cd project-name +$ platform environment:branch updates +``` + +
+Drupal: using ddev
+ +ddev provides an integration with Platform.sh that makes it simple to develop Drupal locally. Check the [providers documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for the most up-to-date information. + +In general, the steps are as follows: + +1. [Install ddev](https://ddev.readthedocs.io/en/stable/#installation). +1. A configuration file has already been provided at `.ddev/providers/platform.yaml`, so you should not need to run `ddev config`. +1. [Retrieve an API token](https://docs.platform.sh/development/cli/api-tokens.html#get-a-token) for your organization via the management console. +1. Update your dedev global configuration file to use the token you've just retrieved: + ```yaml + web_environment: + - PLATFORMSH_CLI_TOKEN=abcdeyourtoken` + ``` +1. Run `ddev restart`. +1. Get your project ID with `platform project:info`. If you have not already connected your local repo with the project (as is the case with a source integration, by default), you can run `platform project:list` to locate the project ID, and `platform project:set-remote PROJECT_ID` to configure Platform.sh locally. +1. Update the `.ddev/providers/platform.yaml` file for your current setup: + ```yaml + environment_variables: + project_id: PROJECT_ID + environment: CURRENT_ENVIRONMENT + application: drupal + ``` +1. Get the current environment's data with `ddev pull platform`. +1. When you have finished with your work, run `ddev stop` and `ddev poweroff`. + +
+
+Drupal: using Lando
+ +Lando supports PHP applications [configured to run on Platform.sh](https://docs.platform.sh/development/local/lando.html), and pulls from the same container registry Platform.sh uses on your remote environments during your local builds through its own [recipe and plugin](https://docs.lando.dev/platformsh/). + +1. [Install Lando](https://docs.lando.dev/getting-started/installation.html). +1. Make sure Docker is already running - Lando will attempt to start Docker for you, but it's best to have it running in the background before beginning. +1. Start your apps and services with the command `lando start`. +1. To get up-to-date data from your Platform.sh environment ([services *and* mounts](https://docs.lando.dev/platformsh/sync.html#pulling)), run the command `lando pull`. +1. If at any time you have updated your Platform.sh configuration files, run the command `lando rebuild`. +1. When you have finished with your work, run `lando stop` and `lando poweroff`. + +
+ + + +> **Note:** +> +> For many of the steps above, you may need to include the CLI flags `-p PROJECT_ID` and `-e ENVIRONMENT_ID` if you are not in the project directory or if the environment is associated with an existing pull request. + + +## Migrate + +The steps below outline the important steps for migrating your application to Platform.sh - adding the required configuration files and dependencies, for example. +Not every step will be applicable to each person's migration. +These steps actually assume the earliest starting point possible - that there is no code at all locally, and that this template repository will be rebuilt completely from scratch. + +- [Getting started](#getting-started-1) +- [Adding and updating files](#adding-and-updating-files) +- [Dependencies](#dependencies) +- [Deploying to Platform.sh](#deploying-to-platformsh) +- [Migrating your data](#migrating-your-data) +- [Next steps](#next-steps) + +If you already have code you'd like to migrate, feel free to focus on the steps most relevant to your application and skip the first section. + +### Getting started + +Assuming that your starting point is no local code, the steps below will setup a starting repository we can begin to make changes to to rebuild this template and migrate to Platform.sh. +If you already have a codebase you are trying to migrate, move onto the next step - [Adding and updating files](#adding-and-updating-files) - and substitute any reference to the default branch `main` with some other branch name. + + + +```bash +$ mkdir drupal8-multisite && cd drupal8-multisite +$ git init +$ git remote add upstream https://github.com/drupal/recommended-project.git +$ git branch -m main +$ git fetch --all --depth=2 +$ git fetch --all --tags +$ git merge --allow-unrelated-histories -X theirs 8.9.20 + +``` + + + +### Adding and updating files + +A small number of files need to be added to or modified in your repository at this point. +Some of them explicitly configure how the application is built and deployed on Platform.sh, while others simply modify files you may already have locally, in which case you will need to replicate those changes. + +Open the dropdown below to view all of the **Added** and **Updated** files you'll need to reproduce in your migration. + +
+View files
+ + + +| File | Purpose | +|:-----------|:--------| +| [`psh-subsite-add.php`](psh-subsite-add.php) | **Added:**

A script has been added to simplify adding additional sites to your Drupal installation. See [Adding a new subsite](#troubleshooting) for more information. | +| [`web/sites/sites.php`](web/sites/sites.php) | **Added:**

Configuration file for multi-site support and directory aliasing feature. | +| [`web/sites/default/settings.php`](web/sites/default/settings.php) | **Added:**

The Drupal settings file has been updated to import and use `web/sites/settings.platformsh.php`. You will also need an identical file for each subsite (i.e. `main`, `first`, and `second`). | +| [`web/sites/default/services.yml`](web/sites/default/services.yml) | **Added:**

Default services configuration. You will also need an identical file for each subsite (i.e. `main`, `first`, and `second`). | +| [`web/sites/default/drushrc.php`](web/sites/default/drushrc.php) | **Added:**

Drush configuration file for a Platform.sh Drupal site. You will also need an identical file for each subsite (i.e. `main`, `first`, and `second`). | +| [`web/sites/settings.platformsh.php`](web/sites/settings.platformsh.php) | **Added:**

Contains Platform.sh-specific configuration, namely setting up the database connection to the MariaDB service and caching via Redis. | +| [`.environment`](.environment) | **Added:**

The `.environment` file is a convenient place to [set environment variables](https://docs.platform.sh/development/variables/set-variables.html#set-variables-via-script) relevant to your applications that may be dependent on the current environment. It is sourced before the start command is run, as the first step in the `deploy` and `post_deploy` hooks, and at the beginning of each session when you SSH into an application container. It is written in dash, so be aware of the differences to bash.

It can be used to set any environment variable, including ones that depend on Platform.sh-provided variables like `PLATFORM_RELATIONSHIPS` and `PLATFORM_ROUTES`, or to modify `PATH`. This file should not [produce output](https://docs.platform.sh/development/variables/set-variables.html#testing-environment-scripts).

Here, the Composer config and `PATH` are updated to allow executable app dependencies from Composer to be run from the path (i.e. `drush`). | +| [`.gitignore`](.gitignore) | **Added:**

A `.gitignore` file is not included in the upstream, so one has been added. | +| [`.lando.upstream.yml`](.lando.upstream.yml) | **Added:**

This file configures [Lando](https://docs.platform.sh/development/local/lando.html) as a local development option for this template. See the [Platform.sh Lando plugin documentation](https://docs.lando.dev/platformsh/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. | +| [`.platform.app.yaml`](.platform.app.yaml) | **Added:**

This file is required to define the build and deploy process for all application containers on Platform.sh. Within this file, the runtime version, relationships to service containers, and writable mounts are configured. It's also in this file that it is defined what dependencies are installed, when they are installed, and that package manager will be used to do so.

Take a look at the [Application](https://docs.platform.sh/configuration/app.html) documentation for more details about configuration. For more information about the sequence of events that lead from a build to deployment, see the [Build and deploy timeline documentation](https://docs.platform.sh/overview/build-deploy.html).

This template uses Composer 2 to install dependencies using the default `composer` [build flavor](https://docs.platform.sh/languages/php.html#build-flavor) prior to the `build` hook. Drush tasks are run during the `deploy` hook, and referenced again during the defined `cron` job. | +| [`drush/platformsh_generate_drush_yml.php`](drush/platformsh_generate_drush_yml.php) | **Added:**

This file has been included to generate the drush yaml configuration on every deployment. | +| [`.platform/services.yaml`](.platform/services.yaml) | **Added:**

Platform.sh provides a number of on-demand managed services that can easily be added to your projects. It's within this file that each service's version, name, resources, and additional configuration are set. See the [Services documentation](https://docs.platform.sh/configuration/services.html) for more details on configuration, version and service availability.

In this template, MariaDB and Redis have been configured. | +| [`.platform/routes.yaml`](.platform/routes.yaml) | **Added:**

This file is require to deploy on Platform.sh, as it defines how requests should be handled on the platform. It's within this file that redirects and basic caching can be configured. See the [Routes documentation](https://docs.platform.sh/configuration/routes.html) for more configuration details.

| +| [`php.ini`](php.ini) | **Added:**

An initial `php.ini` file has also beed added. The settings are a result of performance testing and best practice recommendations coming from [Blackfire.io](https://blackfire.io). They will initialize Drupal with a number of good baseline performance settings for production applications, and complement many of the tests specified in [`.blackfire.yml`](.blackfire.yml). | +| [`.blackfire.yml`](.blackfire.yml) | **Added:**

This file has been added to help you get started using [Blackfire.io](https://blackfire.io) on your project. See [the Blackfire section below](#blackfireio-creating-a-continuous-observability-strategy) for more information on how to get started. | +| [`.lando.upstream.yml`](.lando.upstream.yml) | **Added:**

This file configures [Lando](https://docs.platform.sh/development/local/lando.html) as a local development option for this template. See the [Platform.sh Lando plugin documentation](https://docs.lando.dev/platformsh/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. | +| [`.ddev/providers/platform.yaml`](.ddev/providers/platform.yaml) | **Added:**

This file configures [ddev](https://ddev.readthedocs.io/en/latest/users/providers/platform/) as a local development option for this template. See the [Platform.sh ddev integration documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. Be sure to follow the instructions provided through the ddev CLI and in the comments section of that file to correctly configure ddev for your project. | + + + +
+ +### Dependencies and configuration + +Sometimes it is necessary to install additional dependencies to and modify the configuration of an upstream project to deploy on Platform.sh. +When it is, we do our best to keep these modifications to the minimum necessary. +Run the commands below to reproduce the dependencies in this template. + + + +```bash +$ composer require platformsh/config-reader drush/drush:^10.6 drupal/console drupal/redis +$ composer config allow-plugins.composer/installers true --no-plugins +$ composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins +$ composer config allow-plugins.drupal/core-project-message true --no-plugins +$ composer config allow-plugins.cweagans/composer-patches true --no-plugins + +``` + + + +### Deploying to Platform.sh + +Your repository now has all of the code it needs in order to deploy to Platform.sh. + + +
+Deploy directly to Platform.sh from the command line + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. -* PHP 7.4 -* MariaDB 10.4 -* Redis 6 -* Drush and Drupal Console included -* Pre-configured for multiple sites -* Automatic TLS certificates -* Composer-based build +1. Install the Platform.sh CLI -## Post-install + #### Linux/OSX -Each subsite installs separately. As configured, this project uses a subdomain for each subsite. For each subsite, run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` -## Customizations + #### Windows -The following changes have been made relative to Drupal 8 as it is downloaded from Drupal.org. If using this project as a reference for your own existing project, replicate the changes below to your project. + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` -* The `.platform.app.yaml`, `.platform/services.yaml`, and `.platform/routes.yaml` files have been added. These provide Platform.sh-specific configuration and are present in all projects on Platform.sh. You may customize them as you see fit. However, the multi-site logic will only work if the conventions documented below are retained. -* An additional Composer library, [`platformsh/config-reader`](https://github.com/platformsh/config-reader-php), has been added. It provides convenience wrappers for accessing the Platform.sh environment variables. -* Drush and Drupal Console have been pre-included in `composer.json`. You are free to remove one or both if you do not wish to use them. (Note that the default cron and deploy hooks make use of Drush commands, however.) -* The Drupal Redis module comes pre-installed. The placeholder module is not pre-installed, but it is enabled via `settings.platformsh.php` out of the box. -* The `sites/sites.php` file has been modified to dynamically build a `$sites` index based on the available routes. If you wish to alter the subsite logic you will need to change the contents of the `foreach()` loop in that file. -* The `sites/settings.platformsh.php` file contains Platform.sh-specific code to map environment variables into Drupal configuration. You can add to it as needed. See the documentation for more examples of common snippets to include here. It uses the Config Reader library. -* The `sites/default` site directory is unused. It is retained as an example for copy-and-paste-ing only. -* The `settings.php` file has been heavily customized to only define those values needed for both Platform.sh and local development. It calls out to `settings.platformsh.php` if available. You can add additional values as documented in `default.settings.php` as desired. It is also setup such that when you install Drupal on Platform.sh the installer will not ask for database credentials as they will already be defined. + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
+ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
+ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
+ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
+ + + +### Migrating your data + + +If you are moving an existing site to Platform.sh, then in addition to code you also need to migrate your data. That means your database and your files. + +
+Importing the database
+ +First, obtain a database dump from your current site and save your dump file as `database.sql`. Then, import the database into your Platform.sh site using the CLI: + +```bash +platform sql -e main < database.sql +``` + +
+
+Importing files
+ +You first need to download your files from your current hosting environment. +The easiest way is likely with rsync, but consult your old host's documentation. + +The `platform mount:upload` command provides a straightforward way to upload an entire directory to your site at once to a `mount` defined in a `.platform.app.yaml` file. +Under the hood, it uses an SSH tunnel and rsync, so it is as efficient as possible. +(There is also a `platform mount:download` command you can use to download files later.) +Run the following from your local Git repository root (modifying the `--source` path if needed and setting `BRANCH_NAME` to the branch you are using). + +A few examples are listed below, but repeat for all directories that contain data you would like to migrate. + +```bash +$ platform mount:upload -e main --mount web/sites/default/files --source ./web/sites/default/files +$ platform mount:upload -e main --mount private --source ./private +``` + +Note that `rsync` is picky about its trailing slashes, so be sure to include those. + +
+ + + +### Next steps + +With your application now deployed on Platform.sh, things get more interesting. +Run the command `platform environment:branch new-feature` for your project, or open a trivial pull request off of your current branch. + +The resulting environment is an *exact* copy of production. +It contains identical infrastructure to what's been defined in your configuration files, and even includes data copied from your production environment in its services. +On this isolated environment, you're free to make any changes to your application you need to, and really test how they will behave on production. + +After that, here are a collection of additional resources you might find interesting as you continue with your migration to Platform.sh: + +- [Local development](#local-development) +- [Troubleshooting](#troubleshooting) +- [Adding a domain and going live](https://docs.platform.sh/domains/steps.html) +- [(CDN) Content Delivery Networks](https://docs.platform.sh/domains/cdn.html) +- [Performance and observability with Blackfire.io](https://docs.platform.sh/integrations/observability/blackfire.html) +- [Pricing](https://docs.platform.sh/overview/pricing.html) +- [Security and compliance](https://docs.platform.sh/security.html) + + +## Learn + +### Troubleshooting + + +
+Accessing logs
+ +After the environment has finished its deployment, you can investigate issues that occured on startup, `deploy` and `post_deploy` hooks, and generally at runtime using the CLI. Run the command: + +```bash +platform ssh +``` + +If you are running the command outside of a local copy of the project, you will need to include the `-p` (project) and/or `-e` (environment) flags as well. +Once you have connected to the container, [logs](https://docs.platform.sh/development/logs.html#container-logs) are available within `/var/log/` for you to investigate. + +
+ + +
+Rebuilding cache
+ +You may run into a database error after installing Drupal on your production environment initially. +To fix, SSH into the application container (`platform ssh`) and rebuild the cache using Drush: + +```bash +drush cache-rebuild +``` + +
+ + +
+Default hash_salt behavior
+ +Drupal's [default settings set](https://github.com/drupal/drupal/blob/9.3.x/core/assets/scaffold/files/default.settings.php#L252) `hash_salt` to an empty string: + +```php +$settings['hash_salt'] = ''; +``` + +In the past, Platform.sh templates have overridden this value: + +```php +$settings['hash_salt'] = $settings['hash_salt'] ?? $platformsh->projectEntropy; +``` + +This setting was insufficient to cover some user configurations - such as those cases when an application depends on a `Null` value for `hash_salt`. + +Now, the setting looks like this in `settings.platformsh.php`: + +```bash +$settings['hash_salt'] = empty($settings['hash_salt']) ? $platformsh->projectEntropy : $settings['hash_salt']; +``` + +This change sets `hash_salt` to the built-in environment variable `PLATFORM_PROJECT_ENTROPY` value if the project contains the default settings OR `Null`. +If your application code *depends* on an empty value, feel free to comment out that line, or reset again later in that file. + +Feel free to visit [`platformsh-templates/drupal9#73`](https://github.com/platformsh-templates/drupal9/pull/73) for more details on this discussion. + +
+ +
+How Drupal multi-site works on Platform.sh
Multisite on Platform.sh can be tricky. Drupal multisite bases its logic off of the domain name of the incoming request. However, the domain name of the request is by design highly variable on Platform.sh as every environment has a unique domain. As a result, this template establishes a number of conventions and custom configuration to make multi-site work. @@ -51,7 +741,10 @@ Multisite on Platform.sh can be tricky. Drupal multisite bases its logic off of * Including a cache prefix in Redis so that each site has its own effective cache pool. * Setting the files and private files directories, which are subsite ID prefixes of top-level `files` and `private` directories rather than under each site directory. -## Adding a new subsite +
+ +
+Adding a new subsite
Adding a new subsite requires the following steps. For these steps, assume we're adding a subdomain named `stuff`. @@ -63,11 +756,13 @@ Adding a new subsite requires the following steps. For these steps, assume we'r 6. In your browser, go to the `stuff.example.com` domain (or equivalent on a dev environment) and run through the Drupal installer as usual. Alternatively, you can use Drush as described bellow. 7. Edit the `sites/stuff/settings.php` file again and enable Redis by setting `$platformsh_enable_redis` to true. 8. Commit and push that change. -9. Profit. Alternatively, a PHP shell script is provided that automates steps 1-4. See [`psh-subsite-add.php`](psh-subsite-add.php). -## Using Drush in multi-site +
+ +
+Using Drush in multi-site
In a Drupal multi-site setup, sites ID are defined in [web/sites/sites.php](https://github.com/platformsh-templates/drupal8-multisite/blob/master/web/sites/sites.php). By default in this multi-site template, 2 subsites are defined in [routes.yaml](https://github.com/platformsh-templates/drupal8-multisite/blob/master/.platform/routes.yaml): `first` and `second` @@ -75,8 +770,118 @@ Any Drush command can therefore be used on a specific subsite by using `--uri=`. * `drush status --uri=first` * `drush status --uri=second` -## References +
+ + + + +### Blackfire.io: creating a Continuous Observability Strategy + +This template includes a starting [`.blackfire.yml`](.blackfire.yml) file that can be used to enable [Application Performance Monitoring](https://blackfire.io/docs/monitoring-cookbooks/index), [Profiling](https://blackfire.io/docs/profiling-cookbooks/index), [Builds](https://blackfire.io/docs/builds-cookbooks/index) and [Performance Testing](https://blackfire.io/docs/testing-cookbooks/index) on your project. Platform.sh comes with Blackfire pre-installed on application containers, and [setting up requires minimal configuration](https://docs.platform.sh/integrations/observability/blackfire.html). + +* [What is Blackfire?](https://blackfire.io/docs/introduction) +* [Configuring Blackfire.io on a Platform.sh project](https://docs.platform.sh/integrations/observability/blackfire.html) +* [Blackfire.io Platform.sh documentation](https://blackfire.io/docs/integrations/paas/platformsh) +* [Profiling Cookbooks](https://blackfire.io/docs/profiling-cookbooks/index) +* [Monitoring Cookbooks](https://blackfire.io/docs/monitoring-cookbooks/index) +* [Testing Cookbooks](https://blackfire.io/docs/testing-cookbooks/index) +* [Using Builds](https://blackfire.io/docs/builds-cookbooks/index) +* [Configuring Integrations](https://blackfire.io/docs/integrations/index) + + +### Resources + + +- [Drupal](https://www.drupal.org/) +- [Drupal 8 on Platform.sh](https://docs.platform.sh/guides/drupal9/deploy.html) +- [Platform.sh PHP documentation](https://docs.platform.sh/languages/php.html) +- [Multi-site best practices on Platform.sh](https://docs.platform.sh/bestpractices/oneormany.html) + + + +### Contact + +This template is maintained by the Platform.sh Developer Relations team, and they will be notified of all issues and pull requests you open here. + +- **Community:** Share your question with the community, or see if it's already been asked on our [Community site](https://community.platform.sh). +- **Slack:** If you haven't done so already, you can join Platform.sh's [public Slack](https://chat.platform.sh/) channels and ping the `@devrel_team` with any questions. + + +### About Platform.sh + +This template has been specifically designed to deploy on Platform.sh. + +
+What is Platform.sh?
+ +Platform.sh is a unified, secure, enterprise-grade platform for building, running and scaling web applications. We’re the leader in Fleet Ops: Everything you need to manage your fleet of websites and apps is available from the start. Because infrastructure and workflows are handled from the start, apps just work, so teams can focus on what really matters: making faster changes, collaborating confidently, and scaling responsibly. Whether managing a fleet of ten or ten thousand sites and apps, Platform.sh is the Developer- preferred solution that scales right. + +Our key features include: + +* **GitOps: Git as the source of truth** + + Every branch becomes a development environment, and nothing can change without a commit. + +* **Batteries included: Managed infrastructure** + + [Simple abstraction in YAML](https://docs.platform.sh/configuration/yaml.html) for [committing and configuring infrastructure](https://docs.platform.sh/overview/structure.html), fully managed patch updates, and 24 [runtimes](https://docs.platform.sh/languages.html) & [services](https://docs.platform.sh/configuration/services.html) that can be added with a single line of code. + +* **Instant cloning: Branch, merge, repeat** + + [Reusable builds](https://docs.platform.sh/overview/build-deploy.html) and automatically inherited production data provide true staging environments - experiment in isolation, test, then destroy or merge. + +* **FleetOps: Fleet management platform** + + Leverage our public API along with custom tools like [Source Operations](https://docs.platform.sh/configuration/app/source-operations.html) and [Activity Scripts](https://docs.platform.sh/integrations/activity.html) to [manage thousands of applications](https://youtu.be/MILHG9OqhmE) - their dependency updates, fresh content, and upstream code. + + +To find out more, check out the demo below and go to our [website](https://platform.sh/product/). + +
+

+The Platform.sh demo +

+ + +
+ + + +## Contribute + +

Help us keep top-notch templates!

+ +Every one of our templates is open source, and they're important resources for users trying to deploy to Platform.sh for the first time or better understand the platform. They act as getting started guides, but also contain a number of helpful tips and best practices when working with certain languages and frameworks. + +See something that's wrong with this template that needs to be fixed? Something in the documentation unclear or missing? Let us know! + +

+How to contribute +

+Report a bug       +Submit a feature request       +Open a pull request       +
+

+
+

+Need help? +

+Ask the Platform.sh Community       +Join us on Slack       +
+

+
+

Thanks to all of our amazing contributors!

+
+

+ + + +

+ +

+Made with contrib.rocks +

-* [Drupal](https://www.drupal.org/) -* [Drupal on Platform.sh](https://docs.platform.sh/frameworks/drupal8.html) -* [PHP on Platform.sh](https://docs.platform.sh/languages/php.html) +
diff --git a/templates/drupal8-multisite/files/config/sync/main/.gitkeep b/templates/drupal8-multisite/files/config/sync/main/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/templates/drupal8-multisite/files/header.svg b/templates/drupal8-multisite/files/header.svg new file mode 100644 index 000000000..9e8219f59 --- /dev/null +++ b/templates/drupal8-multisite/files/header.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/templates/drupal8-multisite/files/web/sites/main/drushrc.php b/templates/drupal8-multisite/files/web/sites/main/drushrc.php new file mode 100644 index 000000000..873128564 --- /dev/null +++ b/templates/drupal8-multisite/files/web/sites/main/drushrc.php @@ -0,0 +1,22 @@ + $route) { + if ($route['type'] === 'upstream' + && $route['upstream'] === $_ENV['PLATFORM_APPLICATION_NAME'] + && in_array($route['original_url'], $expected_route_urls)) { + $options['uri'] = $url; + break; + } + } +} diff --git a/templates/drupal8-multisite/files/web/sites/main/services.yml b/templates/drupal8-multisite/files/web/sites/main/services.yml new file mode 100644 index 000000000..23f6483cc --- /dev/null +++ b/templates/drupal8-multisite/files/web/sites/main/services.yml @@ -0,0 +1,155 @@ +parameters: + session.storage.options: + # Default ini options for sessions. + # + # Some distributions of Linux (most notably Debian) ship their PHP + # installations with garbage collection (gc) disabled. Since Drupal depends + # on PHP's garbage collection for clearing sessions, ensure that garbage + # collection occurs by using the most common settings. + # @default 1 + gc_probability: 1 + # @default 100 + gc_divisor: 100 + # + # Set session lifetime (in seconds), i.e. the time from the user's last + # visit to the active session may be deleted by the session garbage + # collector. When a session is deleted, authenticated users are logged out, + # and the contents of the user's $_SESSION variable is discarded. + # @default 200000 + gc_maxlifetime: 200000 + # + # Set session cookie lifetime (in seconds), i.e. the time from the session + # is created to the cookie expires, i.e. when the browser is expected to + # discard the cookie. The value 0 means "until the browser is closed". + # @default 2000000 + cookie_lifetime: 2000000 + # + # Drupal automatically generates a unique session cookie name based on the + # full domain name used to access the site. This mechanism is sufficient + # for most use-cases, including multi-site deployments. However, if it is + # desired that a session can be reused across different subdomains, the + # cookie domain needs to be set to the shared base domain. Doing so assures + # that users remain logged in as they cross between various subdomains. + # To maximize compatibility and normalize the behavior across user agents, + # the cookie domain should start with a dot. + # + # @default none + # cookie_domain: '.example.com' + # + twig.config: + # Twig debugging: + # + # When debugging is enabled: + # - The markup of each Twig template is surrounded by HTML comments that + # contain theming information, such as template file name suggestions. + # - Note that this debugging markup will cause automated tests that directly + # check rendered HTML to fail. When running automated tests, 'debug' + # should be set to FALSE. + # - The dump() function can be used in Twig templates to output information + # about template variables. + # - Twig templates are automatically recompiled whenever the source code + # changes (see auto_reload below). + # + # For more information about debugging Twig templates, see + # https://www.drupal.org/node/1906392. + # + # Not recommended in production environments + # @default false + debug: false + # Twig auto-reload: + # + # Automatically recompile Twig templates whenever the source code changes. + # If you don't provide a value for auto_reload, it will be determined + # based on the value of debug. + # + # Not recommended in production environments + # @default null + auto_reload: null + # Twig cache: + # + # By default, Twig templates will be compiled and stored in the filesystem + # to increase performance. Disabling the Twig cache will recompile the + # templates from source each time they are used. In most cases the + # auto_reload setting above should be enabled rather than disabling the + # Twig cache. + # + # Not recommended in production environments + # @default true + cache: true + renderer.config: + # Renderer required cache contexts: + # + # The Renderer will automatically associate these cache contexts with every + # render array, hence varying every render array by these cache contexts. + # + # @default ['languages:language_interface', 'theme', 'user.permissions'] + required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions'] + # Renderer automatic placeholdering conditions: + # + # Drupal allows portions of the page to be automatically deferred when + # rendering to improve cache performance. That is especially helpful for + # cache contexts that vary widely, such as the active user. On some sites + # those may be different, however, such as sites with only a handful of + # users. If you know what the high-cardinality cache contexts are for your + # site, specify those here. If you're not sure, the defaults are fairly safe + # in general. + # + # For more information about rendering optimizations see + # https://www.drupal.org/developing/api/8/render/arrays/cacheability#optimizing + auto_placeholder_conditions: + # Max-age at or below which caching is not considered worthwhile. + # + # Disable by setting to -1. + # + # @default 0 + max-age: 0 + # Cache contexts with a high cardinality. + # + # Disable by setting to []. + # + # @default ['session', 'user'] + contexts: ['session', 'user'] + # Tags with a high invalidation frequency. + # + # Disable by setting to []. + # + # @default [] + tags: [] + # Cacheability debugging: + # + # Responses with cacheability metadata (CacheableResponseInterface instances) + # get X-Drupal-Cache-Tags and X-Drupal-Cache-Contexts headers. + # + # For more information about debugging cacheable responses, see + # https://www.drupal.org/developing/api/8/response/cacheable-response-interface + # + # Not recommended in production environments + # @default false + http.response.debug_cacheability_headers: false + factory.keyvalue: + {} + # Default key/value storage service to use. + # @default keyvalue.database + # default: keyvalue.database + # Collection-specific overrides. + # state: keyvalue.database + factory.keyvalue.expirable: + {} + # Default key/value expirable storage service to use. + # @default keyvalue.database.expirable + # default: keyvalue.database.expirable + # Allowed protocols for URL generation. + filter_protocols: + - http + - https + - ftp + - news + - nntp + - tel + - telnet + - mailto + - irc + - ssh + - sftp + - webcal + - rtsp diff --git a/templates/drupal8-multisite/files/web/sites/main/settings.php b/templates/drupal8-multisite/files/web/sites/main/settings.php new file mode 100644 index 000000000..c81c78583 --- /dev/null +++ b/templates/drupal8-multisite/files/web/sites/main/settings.php @@ -0,0 +1,44 @@ +inRuntime()) { if (!isset($settings['file_public_path'])) { diff --git a/templates/drupal8-multisite/info/info.yaml b/templates/drupal8-multisite/info/info.yaml new file mode 100644 index 000000000..04bc2fd7d --- /dev/null +++ b/templates/drupal8-multisite/info/info.yaml @@ -0,0 +1,113 @@ +title: "Drupal 8 Multisite for Platform.sh" +id: platformsh/drupal8-multisite +profile: Drupal 8 Multisite +name: Drupal 8 Multisite +default_branch: master +tags: + - PHP + - Drupal + - CMS + - Symfony +related_blog_tags: + - Drupal +license: + type: "MIT" + location: "LICENSE" +features: + - PHP 7.4 + - MariaDB 10.4 + - Redis 6 + - Drush included + - Pre-configured for multiple sites + - Automatic TLS certificates + - Composer-based build +# Use Markdown for links and formatting. They will be converted to HTML automatically when the .platform.template.yaml file is generated. +description: + - This template builds Drupal 8 in a multisite configuration using the "Drupal Recommended" Composer project, creating three subsite installations from the same codebase. + - It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. + - It also includes instructions and a script to help with setting up additional multisite instances, although depending on your particular needs it may require some customization. + - Drupal is a flexible and extensible PHP-based CMS framework capable of hosting multiple sites on a single code base. +logo: + link: "https://www.drupal.org/" + images: + - "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNi4yIDMuOUMxNi4yIDMuOSAxNC44MiAzLjMgMTQuMDQgMi44MkMxNC4wNCAyLjgyIDEzLjAyIDIuMjIgMTEuMzQgMEMxMS4zNCAwIDExLjQgMi41MiA4LjcgMy44NEM0LjQ0IDUuNTIgMS44IDkuMDYgMS44IDEzLjU2QzEuOCAxOS4yNiA2LjQ4IDIzLjk0IDEyLjE4IDIzLjk0QzE3Ljk0IDIzLjk0IDIyLjU2IDE5LjI2IDIyLjU2IDEzLjU2QzIyLjYyIDYuNiAxNi4yIDMuOSAxNi4yIDMuOVpNNC42OCA5LjZDMy4wNiA5Ljk2IDMuMTggOS4xMiAzLjQ4IDguNEMzLjYgNy45OCA0LjAyIDcuNSA0LjAyIDcuNUM1LjEgNS43NiA3LjUgNC41IDcuNSA0LjVDNy44IDQuMzggOC4zNCA0LjA4IDguODIgMy44NEM5Ljc4IDMuMyAxMC4wMiAzIDEwLjAyIDNDMTEuNCAxLjY4IDExLjI4IDAuMDYgMTEuMjggMEMxMi40OCAyLjQgMTEuMDQgMy40OCAxMS4wNCAzLjQ4QzExLjQgMy44NCAxMS4yOCA0LjIgMTEuMjggNC4yQzkuNDIgOC4yMiA0LjY4IDkuNiA0LjY4IDkuNlpNMTcuMjIgMjIuMkMxNy4xIDIyLjI2IDE1LjYgMjIuOTggMTMuODYgMjIuOThDMTIuOSAyMi45OCAxMS44OCAyMi43NCAxMC45OCAyMi4xNEMxMC42OCAyMS45IDEwLjU2IDIxLjQ4IDEwLjc0IDIxLjE4QzEwLjggMjEuMDYgMTEuMTYgMjAuNjQgMTIgMjEuMThDMTIuMDYgMjEuMjQgMTQuMDQgMjIuNTYgMTcuMSAyMC44OEMxNy4zNCAyMC43NiAxNy42NCAyMC44MiAxNy43NiAyMS4wNkMxNy45NCAyMS4zIDE4IDIxLjc4IDE3LjIyIDIyLjJaTTEzLjAyIDE5LjY4TDEzLjA4IDE5LjYyQzEzLjE0IDE5LjU2IDE0LjE2IDE4LjI0IDE1LjY2IDE4LjQyQzE1LjkgMTguNDIgMTYuNzQgMTguNDggMTcuMjggMTkuNUMxNy4zNCAxOS42MiAxNy40NiAyMC4wNCAxNy4yMiAyMC4zNEMxNy4xIDIwLjQ2IDE2LjkyIDIwLjU4IDE2LjU2IDIwLjQ2QzE2LjMyIDIwLjQgMTYuMiAyMC4xNiAxNi4yIDIwLjA0QzE2LjE0IDE5Ljg2IDE2LjA4IDE5Ljc0IDE1LjQ4IDE5LjY4QzE1IDE5LjYyIDE0LjcgMTkuODYgMTQuMzQgMjAuMTZDMTQuMTYgMjAuMzQgMTMuOTIgMjAuNTIgMTMuNjggMjAuNThDMTMuNjIgMjAuNjQgMTMuNTYgMjAuNjQgMTMuNDQgMjAuNjRDMTMuMzIgMjAuNjQgMTMuMiAyMC41OCAxMy4wOCAyMC41MkMxMi45IDIwLjM0IDEyLjg0IDIwLjEgMTMuMDIgMTkuNjhaTTE5Ljg2IDE5LjhDMTkuODYgMTkuOCAxOS4zMiAxOS45OCAxOC43OCAxOS4zOEMxOC43OCAxOS4zOCAxNy4xNiAxNy41MiAxNi4zOCAxNy4yMkMxNi4zOCAxNy4yMiAxNS45IDE3LjA0IDE1LjMgMTcuMjhDMTUuMyAxNy4yOCAxNC44OCAxNy4zNCAxMy4yNiAxOC40MkMxMy4yNiAxOC40MiAxMC41IDIwLjE2IDkuMTIgMTkuOTJDOS4xMiAxOS45MiA2IDE5Ljk4IDYuNDIgMTYuNjhDNi40MiAxNi42OCA3LjA4IDEyLjk2IDExLjQgMTMuOEMxMS40IDEzLjggMTIuMzYgMTMuOTggMTQuMSAxNS4zNkMxNC4xIDE1LjM2IDE1LjMgMTYuMjYgMTUuOSAxNi4yNkMxNS45IDE2LjI2IDE2LjM4IDE2LjMyIDE3LjQ2IDE1LjY2QzE3LjQ2IDE1LjY2IDE5LjU2IDE0LjA0IDIwLjM0IDE0LjFDMjAuNDYgMTQuMSAyMS44NCAxNC4wNCAyMS44NCAxNi4zMkMyMS43OCAxNi4yNiAyMS44NCAxOC45IDE5Ljg2IDE5LjhaIiBmaWxsPSIjMDA4RUNFIi8+Cjwvc3ZnPgo=" +sections: + "create-project": "composer create-project platformsh/drupal8-multisite -s dev" + metrics: false + blackfire: true + postinstall: "templates/drupal8-multisite/info/post_install.md" + local: + - "common/readme/drupal/local_ddev.md" + - "common/readme/drupal/local_lando.md" + resources: + - "[Drupal](https://www.drupal.org/)" + - "[Drupal 8 on Platform.sh](https://docs.platform.sh/guides/drupal9/deploy.html)" + - "[Platform.sh PHP documentation](https://docs.platform.sh/languages/php.html)" + - "[Multi-site best practices on Platform.sh](https://docs.platform.sh/bestpractices/oneormany.html)" + migration: + mounts: + - "web/sites/default/files" + - "private" + files: + "web/sites/settings.platformsh.php": + - "**Added:**

" + - "Contains Platform.sh-specific configuration, namely setting up the database connection to the MariaDB service and caching via Redis." + "web/sites/sites.php": + - "**Added:**

" + - "Configuration file for multi-site support and directory aliasing feature." + "web/sites/default/settings.php": + - "**Added:**

" + - "The Drupal settings file has been updated to import and use `web/sites/settings.platformsh.php`." + - "You will also need an identical file for each subsite (i.e. `main`, `first`, and `second`)." + "web/sites/default/services.yml": + - "**Added:**

" + - "Default services configuration." + - "You will also need an identical file for each subsite (i.e. `main`, `first`, and `second`)." + "web/sites/default/drushrc.php": + - "**Added:**

" + - "Drush configuration file for a Platform.sh Drupal site." + - "You will also need an identical file for each subsite (i.e. `main`, `first`, and `second`)." + ".environment": + - "**Added:**

" + - file: "common/readme/file_descriptions/.environment.md" + - "Here, the Composer config and `PATH` are updated to allow executable app dependencies from Composer to be run from the path (i.e. `drush`)." + ".blackfire.yml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.blackfire.yml.md" + ".gitignore": + - "**Added:**

" + - "A `.gitignore` file is not included in the upstream, so one has been added." + ".lando.upstream.yml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.lando.upstream.yml.md" + ".platform.app.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.app.yaml.md" + - "This template uses Composer 2 to install dependencies using the default `composer` [build flavor](https://docs.platform.sh/languages/php.html#build-flavor) prior to the `build` hook." + - "Drush tasks are run during the `deploy` hook, and referenced again during the defined `cron` job." + "drush/platformsh_generate_drush_yml.php": + - "**Added:**

" + - "This file has been included to generate the drush yaml configuration on every deployment." + ".ddev/providers/platform.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.ddev.providers.platform.yaml.md" + "php.ini": + - "**Added:**

" + - file: "common/readme/drupal/php.ini.md" + ".platform/services.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.services.yaml.md" + - "In this template, MariaDB and Redis have been configured." + ".platform/routes.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.routes.yaml.md" + "psh-subsite-add.php": + - "**Added:**

" + - "A script has been added to simplify adding additional sites to your Drupal installation. See [Adding a new subsite](#troubleshooting) for more information." + troubleshoot: + - file: "common/readme/troubleshoot_ssh.md" + - file: "common/readme/drupal/troubleshoot_cache.md" + - file: "common/readme/drupal/troubleshoot_hashsalt.md" + - file: "common/readme/drupal/troubleshoot_multisite.md" + - file: "common/readme/drupal/troubleshoot_multisite_addsite.md" + - file: "common/readme/drupal/troubleshoot_multisite_drush.md" diff --git a/templates/drupal8-multisite/info/post_install.md b/templates/drupal8-multisite/info/post_install.md new file mode 100644 index 000000000..d3f6a719f --- /dev/null +++ b/templates/drupal8-multisite/info/post_install.md @@ -0,0 +1,3 @@ +### Post-install + +Each subsite installs separately. As configured, this project uses a subdomain for each subsite. For each subsite, run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. \ No newline at end of file diff --git a/templates/drupal8-opigno/files/.platform.app.yaml b/templates/drupal8-opigno/files/.platform.app.yaml index 6aa2af2bd..5a9217561 100644 --- a/templates/drupal8-opigno/files/.platform.app.yaml +++ b/templates/drupal8-opigno/files/.platform.app.yaml @@ -4,10 +4,10 @@ # See https://docs.platform.sh/configuration/app.html # The name of this app. Must be unique within a project. -name: 'app' +name: 'drupal' # The runtime the application uses. -type: 'php:8.0' +type: 'php:7.4' dependencies: php: @@ -18,6 +18,9 @@ runtime: extensions: - redis - sodium + - blackfire + - apcu + # The relationships of the application with services or other applications. # diff --git a/templates/drupal8-opigno/files/.platform/routes.yaml b/templates/drupal8-opigno/files/.platform/routes.yaml index 425c96292..69ba2fcd0 100644 --- a/templates/drupal8-opigno/files/.platform/routes.yaml +++ b/templates/drupal8-opigno/files/.platform/routes.yaml @@ -5,7 +5,7 @@ "https://{default}/": type: upstream - upstream: "app:http" + upstream: "drupal:http" cache: enabled: true diff --git a/templates/drupal8-opigno/files/README.md b/templates/drupal8-opigno/files/README.md index c225540c9..f34177f5c 100644 --- a/templates/drupal8-opigno/files/README.md +++ b/templates/drupal8-opigno/files/README.md @@ -1,48 +1,834 @@ -# Opigno Drupal Distribution for Platform.sh + +

+ + + +

- - Deploy on Platform.sh + +

+

Deploy Opigno Drupal Distribution on Platform.sh

+ +

+Contribute, request a feature, or check out our resources +
+
+Join our community       +Documentation       +Blog       +Report a bug       +Request a feature +

+

+ +

+ +Open issues +   + +Open PRs +   + +License +   +

+ +

+

+ +
+ +

+Contents +

+About       +Getting started       +Migrate       +Learn       +Contribute       +
+

+
+ +## About + This template builds the Opigno Drupal 8 distribution using the [Drupal Composer project](https://github.com/drupal-composer/drupal-project) for better flexibility. It also includes configuration to use Redis for caching, although that must be enabled post-install in `.platform.app.yaml`. Opigno is a Learning Management system built as a Drupal distribution. -## Features +### Features + +- PHP 7.4 +- MariaDB 10.4 +- Redis 6 +- Drush included +- Automatic TLS certificates +- Composer-based build + + +## Getting started + +### Deploy + +#### Quickstart + + +The quickest way to deploy this template on Platform.sh is by clicking the button below. +This will automatically create a new project and initialize the repository for you. + +

+ + Deploy on Platform.sh + +

+
+ + + +You can also quickly recreate this project locally with the following command: + +```bash +composer create-project platformsh/drupal8-opigno -s dev +``` + + +> **Note:** +> +> Platform.sh templates prioritize upstream release versions over our own. Despite this, we update template dependencies on a scheduled basis independent of those upstreams. Because of this, template repos do not contain releases. This may change in the future, but until then the `-s dev` flag is necessary to use `composer create-project`. + + + +#### Other deployment options + +For all of the other options below, clone this repository first: + +```bash +git clone https://github.com/platformsh-templates/drupal8-opigno +``` + +If you're trying to deploy from GitHub, you can generate a copy of this repository first in your own namespace by clicking the [Use this template](https://github.com/platformsh-templates/drupal8-opigno/generate) button at the top of this page. + +Then you can clone a copy of it locally with `git clone git@github.com:YOUR_NAMESPACE/drupal8-opigno.git`. + + +
+Deploy directly to Platform.sh from the command line + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
+ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
+ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows -* PHP 7.3 -* MariaDB 10.4 -* Redis 6 -* Drush and Drupal Console included -* Automatic TLS certificates -* Composer-based build + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` -## Post-install + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
+ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
+ + + +### Post-install Run through the Opigno installer as normal. You will not be asked for database credentials as those are already provided. +### Local development + +This section provides instructions for running the `drupal8-opigno` template locally, connected to a live database instance on an active Platform.sh environment. + +In all cases for developing with Platform.sh, it's important to develop on an isolated environment - do not connect to data on your production environment when developing locally. +Each of the options below assume that you have already deployed this template to Platform.sh, as well as the following starting commands: + +```bash +$ platform get PROJECT_ID +$ cd project-name +$ platform environment:branch updates +``` + +
+Drupal: using ddev
+ +ddev provides an integration with Platform.sh that makes it simple to develop Drupal locally. Check the [providers documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for the most up-to-date information. + +In general, the steps are as follows: + +1. [Install ddev](https://ddev.readthedocs.io/en/stable/#installation). +1. A configuration file has already been provided at `.ddev/providers/platform.yaml`, so you should not need to run `ddev config`. +1. [Retrieve an API token](https://docs.platform.sh/development/cli/api-tokens.html#get-a-token) for your organization via the management console. +1. Update your dedev global configuration file to use the token you've just retrieved: + ```yaml + web_environment: + - PLATFORMSH_CLI_TOKEN=abcdeyourtoken` + ``` +1. Run `ddev restart`. +1. Get your project ID with `platform project:info`. If you have not already connected your local repo with the project (as is the case with a source integration, by default), you can run `platform project:list` to locate the project ID, and `platform project:set-remote PROJECT_ID` to configure Platform.sh locally. +1. Update the `.ddev/providers/platform.yaml` file for your current setup: + ```yaml + environment_variables: + project_id: PROJECT_ID + environment: CURRENT_ENVIRONMENT + application: drupal + ``` +1. Get the current environment's data with `ddev pull platform`. +1. When you have finished with your work, run `ddev stop` and `ddev poweroff`. + +
+
+Drupal: using Lando
+ +Lando supports PHP applications [configured to run on Platform.sh](https://docs.platform.sh/development/local/lando.html), and pulls from the same container registry Platform.sh uses on your remote environments during your local builds through its own [recipe and plugin](https://docs.lando.dev/platformsh/). + +1. [Install Lando](https://docs.lando.dev/getting-started/installation.html). +1. Make sure Docker is already running - Lando will attempt to start Docker for you, but it's best to have it running in the background before beginning. +1. Start your apps and services with the command `lando start`. +1. To get up-to-date data from your Platform.sh environment ([services *and* mounts](https://docs.lando.dev/platformsh/sync.html#pulling)), run the command `lando pull`. +1. If at any time you have updated your Platform.sh configuration files, run the command `lando rebuild`. +1. When you have finished with your work, run `lando stop` and `lando poweroff`. + +
+ + + > **Note:** > -> After installation is complete, you may see the following error: `The website encountered an unexpected error. Please try again later.`. If so, SSH into the environment and run `drush -y cache-rebuild` twice to clear the cache. +> For many of the steps above, you may need to include the CLI flags `-p PROJECT_ID` and `-e ENVIRONMENT_ID` if you are not in the project directory or if the environment is associated with an existing pull request. + + +## Migrate + +The steps below outline the important steps for migrating your application to Platform.sh - adding the required configuration files and dependencies, for example. +Not every step will be applicable to each person's migration. +These steps actually assume the earliest starting point possible - that there is no code at all locally, and that this template repository will be rebuilt completely from scratch. + +- [Getting started](#getting-started-1) +- [Adding and updating files](#adding-and-updating-files) +- [Dependencies](#dependencies) +- [Deploying to Platform.sh](#deploying-to-platformsh) +- [Migrating your data](#migrating-your-data) +- [Next steps](#next-steps) + +If you already have code you'd like to migrate, feel free to focus on the steps most relevant to your application and skip the first section. + +### Getting started + +Assuming that your starting point is no local code, the steps below will setup a starting repository we can begin to make changes to to rebuild this template and migrate to Platform.sh. +If you already have a codebase you are trying to migrate, move onto the next step - [Adding and updating files](#adding-and-updating-files) - and substitute any reference to the default branch `main` with some other branch name. + + + +```bash +$ mkdir drupal8-opigno && cd drupal8-opigno +$ git init +$ git remote add upstream https://bitbucket.org/opigno/opigno-composer.git +$ git branch -m main +$ git fetch --all --depth=2 +$ git fetch --all --tags +$ git merge --allow-unrelated-histories -X theirs 2.29.0 + +``` + + + +### Adding and updating files + +A small number of files need to be added to or modified in your repository at this point. +Some of them explicitly configure how the application is built and deployed on Platform.sh, while others simply modify files you may already have locally, in which case you will need to replicate those changes. + +Open the dropdown below to view all of the **Added** and **Updated** files you'll need to reproduce in your migration. + +
+View files
+ + + +| File | Purpose | +|:-----------|:--------| +| [`config/sync/.gitkeep`](config/sync/.gitkeep) | **Added** | +| [`web/sites/default/settings.php`](web/sites/default/settings.php) | **Updated:**

The Drupal settings file has been updated to import and use `web/sites/default/settings.platformsh.php`. | +| [`web/sites/default/settings.platformsh.php`](web/sites/default/settings.platformsh.php) | **Added:**

Contains Platform.sh-specific configuration, namely setting up the database connection to the MariaDB service and caching via Redis. | +| [`.environment`](.environment) | **Added:**

The `.environment` file is a convenient place to [set environment variables](https://docs.platform.sh/development/variables/set-variables.html#set-variables-via-script) relevant to your applications that may be dependent on the current environment. It is sourced before the start command is run, as the first step in the `deploy` and `post_deploy` hooks, and at the beginning of each session when you SSH into an application container. It is written in dash, so be aware of the differences to bash.

It can be used to set any environment variable, including ones that depend on Platform.sh-provided variables like `PLATFORM_RELATIONSHIPS` and `PLATFORM_ROUTES`, or to modify `PATH`. This file should not [produce output](https://docs.platform.sh/development/variables/set-variables.html#testing-environment-scripts).

Here, the Composer config and `PATH` are updated to allow executable app dependencies from Composer to be run from the path (i.e. `drush`). | +| [`.gitignore`](.gitignore) | **Added:**

A `.gitignore` file is not included in the upstream, so one has been added. | +| [`.lando.upstream.yml`](.lando.upstream.yml) | **Added:**

This file configures [Lando](https://docs.platform.sh/development/local/lando.html) as a local development option for this template. See the [Platform.sh Lando plugin documentation](https://docs.lando.dev/platformsh/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. | +| [`.platform.app.yaml`](.platform.app.yaml) | **Added:**

This file is required to define the build and deploy process for all application containers on Platform.sh. Within this file, the runtime version, relationships to service containers, and writable mounts are configured. It's also in this file that it is defined what dependencies are installed, when they are installed, and that package manager will be used to do so.

Take a look at the [Application](https://docs.platform.sh/configuration/app.html) documentation for more details about configuration. For more information about the sequence of events that lead from a build to deployment, see the [Build and deploy timeline documentation](https://docs.platform.sh/overview/build-deploy.html).

This template uses Composer 2 to install dependencies using the default `composer` [build flavor](https://docs.platform.sh/languages/php.html#build-flavor) prior to the `build` hook. Drush tasks are run during the `deploy` hook, and referenced again during the defined `cron` job. | +| [`drush/platformsh_generate_drush_yml.php`](drush/platformsh_generate_drush_yml.php) | **Added:**

This file has been included to generate the drush yaml configuration on every deployment. | +| [`.platform/services.yaml`](.platform/services.yaml) | **Added:**

Platform.sh provides a number of on-demand managed services that can easily be added to your projects. It's within this file that each service's version, name, resources, and additional configuration are set. See the [Services documentation](https://docs.platform.sh/configuration/services.html) for more details on configuration, version and service availability.

In this template, MariaDB and Redis have been configured. | +| [`.platform/routes.yaml`](.platform/routes.yaml) | **Added:**

This file is require to deploy on Platform.sh, as it defines how requests should be handled on the platform. It's within this file that redirects and basic caching can be configured. See the [Routes documentation](https://docs.platform.sh/configuration/routes.html) for more configuration details.

| +| [`php.ini`](php.ini) | **Added:**

An initial `php.ini` file has also beed added. The settings are a result of performance testing and best practice recommendations coming from [Blackfire.io](https://blackfire.io). They will initialize Drupal with a number of good baseline performance settings for production applications, and complement many of the tests specified in [`.blackfire.yml`](.blackfire.yml). | +| [`.blackfire.yml`](.blackfire.yml) | **Added:**

This file has been added to help you get started using [Blackfire.io](https://blackfire.io) on your project. See [the Blackfire section below](#blackfireio-creating-a-continuous-observability-strategy) for more information on how to get started. | +| [`.lando.upstream.yml`](.lando.upstream.yml) | **Added:**

This file configures [Lando](https://docs.platform.sh/development/local/lando.html) as a local development option for this template. See the [Platform.sh Lando plugin documentation](https://docs.lando.dev/platformsh/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. | +| [`.ddev/providers/platform.yaml`](.ddev/providers/platform.yaml) | **Added:**

This file configures [ddev](https://ddev.readthedocs.io/en/latest/users/providers/platform/) as a local development option for this template. See the [Platform.sh ddev integration documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. Be sure to follow the instructions provided through the ddev CLI and in the comments section of that file to correctly configure ddev for your project. | + + + +
+ +### Dependencies and configuration + +Sometimes it is necessary to install additional dependencies to and modify the configuration of an upstream project to deploy on Platform.sh. +When it is, we do our best to keep these modifications to the minimum necessary. +Run the commands below to reproduce the dependencies in this template. + + + +```bash +$ composer require platformsh/config-reader drush/drush:^9.1 drupal/console drupal/redis psr/cache:^1.0 +$ composer config allow-plugins.composer/installers true --no-plugins +$ composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins +$ composer config allow-plugins.drupal/core-project-message true --no-plugins +$ composer config allow-plugins.cweagans/composer-patches true --no-plugins + +``` + + + +### Deploying to Platform.sh + +Your repository now has all of the code it needs in order to deploy to Platform.sh. + + +
+Deploy directly to Platform.sh from the command line + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI -## Customizations + #### Linux/OSX -The following changes have been made relative to Drupal 8 / Opigno as it is downloaded from Drupal.org. If using this project as a reference for your own existing project, replicate the changes below to your project. + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` -* It uses the Drupal Composer project, which allow the site to be managed entirely with Composer. That also causes the `vendor` and `config` directories to be placed outside of the web root for added security. See the [Drupal documentation](https://www.drupal.org/node/2404989) for tips on how best to leverage Composer with Drupal 8. -* The `.platform.app.yaml`, `.platform/services.yaml`, and `.platform/routes.yaml` files have been added. These provide Platform.sh-specific configuration and are present in all projects on Platform.sh. You may customize them as you see fit. -* An additional Composer library, [`platformsh/config-reader`](https://github.com/platformsh/config-reader-php), has been added. It provides convenience wrappers for accessing the Platform.sh environment variables. -* A `.environment` file has been added, which allows executable app dependencies from Composer to be run from the path. -* Drush and Drupal Console have been pre-included in `composer.json`. You are free to remove one or both if you do not wish to use them. (Note that the default cron and deploy hooks make use of Drush commands, however.) -* The Drupal Redis module comes pre-installed. The placeholder module is not pre-installed, but it is enabled via `settings.platformsh.php` out of the box. -* The `settings.platformsh.php` file contains Platform.sh-specific code to map environment variables into Drupal configuration. You can add to it as needed. See the documentation for more examples of common snippets to include here. It uses the Config Reader library. -* The `settings.php` file has been heavily customized to only define those values needed for both Platform.sh and local development. It calls out to `settings.platformsh.php` if available. You can add additional values as documented in `default.settings.php` as desired. It is also setup such that when you install Drupal on Platform.sh the installer will not ask for database credentials as they will already be defined. + #### Windows -## References + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
+ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
+ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
+ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
+ + + +### Migrating your data + + +If you are moving an existing site to Platform.sh, then in addition to code you also need to migrate your data. That means your database and your files. + +
+Importing the database
+ +First, obtain a database dump from your current site and save your dump file as `database.sql`. Then, import the database into your Platform.sh site using the CLI: + +```bash +platform sql -e main < database.sql +``` + +
+
+Importing files
+ +You first need to download your files from your current hosting environment. +The easiest way is likely with rsync, but consult your old host's documentation. + +The `platform mount:upload` command provides a straightforward way to upload an entire directory to your site at once to a `mount` defined in a `.platform.app.yaml` file. +Under the hood, it uses an SSH tunnel and rsync, so it is as efficient as possible. +(There is also a `platform mount:download` command you can use to download files later.) +Run the following from your local Git repository root (modifying the `--source` path if needed and setting `BRANCH_NAME` to the branch you are using). + +A few examples are listed below, but repeat for all directories that contain data you would like to migrate. + +```bash +$ platform mount:upload -e main --mount web/sites/default/files --source ./web/sites/default/files +$ platform mount:upload -e main --mount private --source ./private +``` + +Note that `rsync` is picky about its trailing slashes, so be sure to include those. + +
+ + + +### Next steps + +With your application now deployed on Platform.sh, things get more interesting. +Run the command `platform environment:branch new-feature` for your project, or open a trivial pull request off of your current branch. + +The resulting environment is an *exact* copy of production. +It contains identical infrastructure to what's been defined in your configuration files, and even includes data copied from your production environment in its services. +On this isolated environment, you're free to make any changes to your application you need to, and really test how they will behave on production. + +After that, here are a collection of additional resources you might find interesting as you continue with your migration to Platform.sh: + +- [Local development](#local-development) +- [Troubleshooting](#troubleshooting) +- [Adding a domain and going live](https://docs.platform.sh/domains/steps.html) +- [(CDN) Content Delivery Networks](https://docs.platform.sh/domains/cdn.html) +- [Performance and observability with Blackfire.io](https://docs.platform.sh/integrations/observability/blackfire.html) +- [Pricing](https://docs.platform.sh/overview/pricing.html) +- [Security and compliance](https://docs.platform.sh/security.html) + + +## Learn + +### Troubleshooting + + +
+Accessing logs
+ +After the environment has finished its deployment, you can investigate issues that occured on startup, `deploy` and `post_deploy` hooks, and generally at runtime using the CLI. Run the command: + +```bash +platform ssh +``` + +If you are running the command outside of a local copy of the project, you will need to include the `-p` (project) and/or `-e` (environment) flags as well. +Once you have connected to the container, [logs](https://docs.platform.sh/development/logs.html#container-logs) are available within `/var/log/` for you to investigate. + +
+ + +
+Rebuilding cache
+ +You may run into a database error after installing Drupal on your production environment initially. +To fix, SSH into the application container (`platform ssh`) and rebuild the cache using Drush: + +```bash +drush cache-rebuild +``` + +
+ + +
+Default hash_salt behavior
+ +Drupal's [default settings set](https://github.com/drupal/drupal/blob/9.3.x/core/assets/scaffold/files/default.settings.php#L252) `hash_salt` to an empty string: + +```php +$settings['hash_salt'] = ''; +``` + +In the past, Platform.sh templates have overridden this value: + +```php +$settings['hash_salt'] = $settings['hash_salt'] ?? $platformsh->projectEntropy; +``` + +This setting was insufficient to cover some user configurations - such as those cases when an application depends on a `Null` value for `hash_salt`. + +Now, the setting looks like this in `settings.platformsh.php`: + +```bash +$settings['hash_salt'] = empty($settings['hash_salt']) ? $platformsh->projectEntropy : $settings['hash_salt']; +``` + +This change sets `hash_salt` to the built-in environment variable `PLATFORM_PROJECT_ENTROPY` value if the project contains the default settings OR `Null`. +If your application code *depends* on an empty value, feel free to comment out that line, or reset again later in that file. + +Feel free to visit [`platformsh-templates/drupal9#73`](https://github.com/platformsh-templates/drupal9/pull/73) for more details on this discussion. + +
+ + + + +### Blackfire.io: creating a Continuous Observability Strategy + +This template includes a starting [`.blackfire.yml`](.blackfire.yml) file that can be used to enable [Application Performance Monitoring](https://blackfire.io/docs/monitoring-cookbooks/index), [Profiling](https://blackfire.io/docs/profiling-cookbooks/index), [Builds](https://blackfire.io/docs/builds-cookbooks/index) and [Performance Testing](https://blackfire.io/docs/testing-cookbooks/index) on your project. Platform.sh comes with Blackfire pre-installed on application containers, and [setting up requires minimal configuration](https://docs.platform.sh/integrations/observability/blackfire.html). + +* [What is Blackfire?](https://blackfire.io/docs/introduction) +* [Configuring Blackfire.io on a Platform.sh project](https://docs.platform.sh/integrations/observability/blackfire.html) +* [Blackfire.io Platform.sh documentation](https://blackfire.io/docs/integrations/paas/platformsh) +* [Profiling Cookbooks](https://blackfire.io/docs/profiling-cookbooks/index) +* [Monitoring Cookbooks](https://blackfire.io/docs/monitoring-cookbooks/index) +* [Testing Cookbooks](https://blackfire.io/docs/testing-cookbooks/index) +* [Using Builds](https://blackfire.io/docs/builds-cookbooks/index) +* [Configuring Integrations](https://blackfire.io/docs/integrations/index) + + +### Resources + + +- [Opigno](https://www.opigno.org/) +- [Drupal](https://www.drupal.org/) +- [Drupal 8 on Platform.sh](https://docs.platform.sh/guides/drupal9/deploy.html) +- [Platform.sh PHP documentation](https://docs.platform.sh/languages/php.html) + + + +### Contact + +This template is maintained by the Platform.sh Developer Relations team, and they will be notified of all issues and pull requests you open here. + +- **Community:** Share your question with the community, or see if it's already been asked on our [Community site](https://community.platform.sh). +- **Slack:** If you haven't done so already, you can join Platform.sh's [public Slack](https://chat.platform.sh/) channels and ping the `@devrel_team` with any questions. + + +### About Platform.sh + +This template has been specifically designed to deploy on Platform.sh. + +
+What is Platform.sh?
+ +Platform.sh is a unified, secure, enterprise-grade platform for building, running and scaling web applications. We’re the leader in Fleet Ops: Everything you need to manage your fleet of websites and apps is available from the start. Because infrastructure and workflows are handled from the start, apps just work, so teams can focus on what really matters: making faster changes, collaborating confidently, and scaling responsibly. Whether managing a fleet of ten or ten thousand sites and apps, Platform.sh is the Developer- preferred solution that scales right. + +Our key features include: + +* **GitOps: Git as the source of truth** + + Every branch becomes a development environment, and nothing can change without a commit. + +* **Batteries included: Managed infrastructure** + + [Simple abstraction in YAML](https://docs.platform.sh/configuration/yaml.html) for [committing and configuring infrastructure](https://docs.platform.sh/overview/structure.html), fully managed patch updates, and 24 [runtimes](https://docs.platform.sh/languages.html) & [services](https://docs.platform.sh/configuration/services.html) that can be added with a single line of code. + +* **Instant cloning: Branch, merge, repeat** + + [Reusable builds](https://docs.platform.sh/overview/build-deploy.html) and automatically inherited production data provide true staging environments - experiment in isolation, test, then destroy or merge. + +* **FleetOps: Fleet management platform** + + Leverage our public API along with custom tools like [Source Operations](https://docs.platform.sh/configuration/app/source-operations.html) and [Activity Scripts](https://docs.platform.sh/integrations/activity.html) to [manage thousands of applications](https://youtu.be/MILHG9OqhmE) - their dependency updates, fresh content, and upstream code. + + +To find out more, check out the demo below and go to our [website](https://platform.sh/product/). + +
+

+The Platform.sh demo +

+ + +
+ + + +## Contribute + +

Help us keep top-notch templates!

+ +Every one of our templates is open source, and they're important resources for users trying to deploy to Platform.sh for the first time or better understand the platform. They act as getting started guides, but also contain a number of helpful tips and best practices when working with certain languages and frameworks. + +See something that's wrong with this template that needs to be fixed? Something in the documentation unclear or missing? Let us know! + +

+How to contribute +

+Report a bug       +Submit a feature request       +Open a pull request       +
+

+
+

+Need help? +

+Ask the Platform.sh Community       +Join us on Slack       +
+

+
+

Thanks to all of our amazing contributors!

+
+

+ + + +

+ +

+Made with contrib.rocks +

-* [Drupal](https://www.drupal.org/) -* [Opigno](https://www.opigno.org) -* [Drupal on Platform.sh](https://docs.platform.sh/frameworks/drupal8.html) -* [PHP on Platform.sh](https://docs.platform.sh/languages/php.html) +
diff --git a/templates/drupal8-opigno/files/drush/platformsh_generate_drush_yml.php b/templates/drupal8-opigno/files/drush/platformsh_generate_drush_yml.php index 19f09554f..9dbb98c17 100644 --- a/templates/drupal8-opigno/files/drush/platformsh_generate_drush_yml.php +++ b/templates/drupal8-opigno/files/drush/platformsh_generate_drush_yml.php @@ -31,7 +31,7 @@ function _platformsh_drush_site_url() { return [!$a['primary'], strpos($a['url'], 'https://') !== 0, strlen($a['url'])] <=> - [!$a['primary'], strpos($a['url'], 'https://') !== 0, strlen($b['url'])]; + [!$b['primary'], strpos($b['url'], 'https://') !== 0, strlen($b['url'])]; }); // Return the url of the first one. diff --git a/templates/drupal8-opigno/files/header.svg b/templates/drupal8-opigno/files/header.svg new file mode 100644 index 000000000..957dab15c --- /dev/null +++ b/templates/drupal8-opigno/files/header.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/templates/drupal8-opigno/files/web/sites/default/settings.platformsh.php b/templates/drupal8-opigno/files/web/sites/default/settings.platformsh.php index f181d832f..62c9cbd5b 100644 --- a/templates/drupal8-opigno/files/web/sites/default/settings.platformsh.php +++ b/templates/drupal8-opigno/files/web/sites/default/settings.platformsh.php @@ -108,7 +108,7 @@ // Set the project-specific entropy value, used for generating one-time // keys and such. - $settings['hash_salt'] = $settings['hash_salt'] ?? $platformsh->projectEntropy; + $settings['hash_salt'] = empty($settings['hash_salt']) ? $platformsh->projectEntropy : $settings['hash_salt']; // Set the deployment identifier, which is used by some Drupal cache systems. $settings['deployment_identifier'] = $settings['deployment_identifier'] ?? $platformsh->treeId; diff --git a/templates/drupal8-opigno/info/info.yaml b/templates/drupal8-opigno/info/info.yaml new file mode 100644 index 000000000..e186e2f57 --- /dev/null +++ b/templates/drupal8-opigno/info/info.yaml @@ -0,0 +1,94 @@ +title: "Deploy Opigno Drupal Distribution on Platform.sh" +id: platformsh/drupal8-opigno +profile: Opigno +name: Opigno +default_branch: master +tags: + - PHP + - Drupal + - CMS + - Symfony +related_blog_tags: + - Drupal +license: + type: "MIT" + location: "LICENSE" +features: + - PHP 7.4 + - MariaDB 10.4 + - Redis 6 + - Drush included + - Automatic TLS certificates + - Composer-based build +# Use Markdown for links and formatting. They will be converted to HTML automatically when the .platform.template.yaml file is generated. +description: + - This template builds the Opigno Drupal 8 distribution using the [Drupal Composer project](https://github.com/drupal-composer/drupal-project) for better flexibility. It also includes configuration to use Redis for caching, although that must be enabled post-install in `.platform.app.yaml`. + - Opigno is a Learning Management system built as a Drupal distribution. +logo: + link: "https://www.drupal.org/" + images: + - "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='225' height='223.8'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230e1226;fill-rule:evenodd%7D%3C/style%3E%3C/defs%3E%3Cg %3E%3Cg %3E%3Cpath class='cls-1' d='M207.15 51.16a112.6 112.6 0 0 0-30.84-31.52 52.78 52.78 0 0 0 30.84 31.52M48.83 113.21a63.81 63.81 0 1 0 126.36-12.53 113.13 113.13 0 0 1-14.25-8.58 52 52 0 0 1 4.46 21.11 52.68 52.68 0 1 1-31.35-47.95 111 111 0 0 1-8.57-14.21 65.09 65.09 0 0 0-12.84-1.28 63.58 63.58 0 0 0-63.8 63.43'/%3E%3Cpath class='cls-1' d='M185.35 64c14.64 10.1 33.7 11.51 33.7 11.51l-4.4-10.85C167.15 53.74 163 11.84 163 11.84c-1.67-1.28-12-5.16-12-5.16-.07 5.41 2.53 14.34 2.53 14.34 7.74 28.77 31.84 42.87 31.84 42.87m27.42 48a98.29 98.29 0 0 1-.53 10.15v.14l-.6 4.7-2.06 9.88-.19.71-1.09 3.8-.57 1.73-.91 2.66-1 2.56-.68 1.71-1.4 3.18-.47 1-1.66 3.33-.43.84-1.85 3.31-.53.89-1.9 3.06-.69 1.06-1.88 2.72-.93 1.29-1.8 2.34-1.28 1.53-1.64 1.95-1.57 1.79-1.45 1.56-1.64 1.7-.4.41-1.14 1.12-1.58 1.49-1 .91-.81.72-1.45 1.24-2.1 1.7-1.25 1-2.18 1.67-.34.26-1 .68-2.72 1.88-.32.22-.61.38-3.13 2-.51.31-3.59 2-.84.44-3.32 1.66-1.32.61-2.89 1.28-2 .83-2.25.87-3 1.05-1.36.45-4.23 1.23-.32.09-9.95 2.1-5.18.68-3 .24-2.38.18h-1.1l-4.2.1q-5 0-10.07-.5l-5.08-.64c-3.34-.51-6.62-1.17-9.81-1.91l-1-.26-3.6-1-1.95-.64-2.46-.83-2.79-1.06-1.52-.61-3.29-1.42-.27-.13-.64-.29-4.24-2.09-3.38-1.9-.83-.48-3.21-1.93-1-.64-2.78-1.92-1.25-.88-2.4-1.79-1.52-1.19-2-1.65-1.79-1.52-1.58-1.46-1.76-1.66-.34-.32-1.16-1.16-1.54-1.6-.72-.86-.72-.82-1.29-1.47-1.32-1.54-.42-.52-1-1.26-1.67-2.16-.23-.32-.64-1-1.9-2.71-.2-.29-.47-.6-1.93-3.16-.27-.44-2.06-3.65-.39-.75-1.72-3.39-.56-1.2-1.28-3-.79-1.92-.92-2.37-1-2.85-.52-1.52-1.17-4-.14-.54a98.08 98.08 0 0 1-2.1-9.84l-.59-4.4-.1-.79-.19-2.64-.2-2.66v-.78l-.11-4.45.32-7.58.83-7.48 2-9.85.14-.52 1.16-4 .5-1.54 1-2.86.9-2.38.77-1.92 1.32-3 .56-1.28 1.57-3.17.45-.9 2.42-4.23 1.82-2.92.78-1.21L31 54.47l1-1.42 1.68-2.2 1.32-1.7 1.51-1.79 1.73-2 1.3-1.36 1.57-1.65.68-.69.92-.89 1.52-1.45 1.27-1.18.54-.49 1.4-1.2 1.9-1.62.25-.19 1.18-.92 2.53-1.94.93-.65 3.1-2.13.51-.32 3.57-2.24.16-.09 4-2.23.39-.21L69.69 22l.83-.38 3.38-1.49 1.54-.62 2.76-1.07 2.46-.85 1.94-.64 3.58-1 1-.27c3.2-.83 6.46-1.53 9.79-2.06l1.46-.19a98.5 98.5 0 0 1 14.36-1.05h1.47a97.81 97.81 0 0 1 12.57 1c3.36 27.9 16.92 44 16.92 44C164.89 88.19 195.2 97 212.07 99.51a97.12 97.12 0 0 1 .81 12.52m11.8-11.51c.19-1.86-2.08-12.83-2.08-12.83-83.34-9-83.76-84.62-83.76-84.62-1.8-.51-5.36-1.12-8.35-1.58a7.36 7.36 0 0 0-.88-.21c-1-.14-1.9-.24-2.86-.36l-.88-.13A113.5 113.5 0 0 0 90 2.24l-1.09.26-4.17 1-1.12.3-.3.08-3.79 1.02-1.25.4-3 1-.87.29-1.28.47c-.64.24-1.28.52-1.93.76l-1.57.62-.22.08-1.27.53c-.9.39-1.76.79-2.57 1.19l-2.21 1c-1.07.52-2.12 1.06-3.18 1.61-.15.09-.31.16-.45.24l-1.1.64c-1.17.64-2.32 1.3-3.47 2l-.17.1-1 .64c-1.16.71-2.3 1.44-3.43 2.18l-.23.16-.86.56q-1.63 1.11-3.24 2.28l-.42.3-.81.45c-1 .74-2 1.5-2.93 2.27l-.68.54-.68.55c-.86.71-1.71 1.43-2.54 2.18l-1 .85-.62.56-2.14 2-1.84 1.88L30.91 35l-1.51 1.6-.59.67-1.3 1.47-1.71 1.89c-.13.17-.26.34-.41.52l-1.13 1.4-1.83 2.34-.23.32-.51.64-.55.77-1.93 2.56-.21.32-.9 1.38-1.8 2.8-.34.6-.36.61a4.89 4.89 0 0 0-.34.64l-1.63 2.85-.63 1.2-.43.82-1.4 2.72c-.21.42-.39.86-.59 1.28L8.94 68c-.19.42-.36.86-.53 1.3L7 73l-.5 1.27-.65 1.92-1 3.19L4.08 82l-.69 2.54c-.3 1.15-.55 2.3-.8 3.46l-.39 1.72c-.3 1.48-.56 3-.79 4.46l-.15.82q-.42 2.7-.7 5.41c-.34 3.33-.51 6.67-.56 10v3.45a111.42 111.42 0 0 0 2.3 20.44c0 .12.07.23.09.36.34 1.63.71 3.26 1.13 4.87l.31 1.12.38 1.35.79 2.68c.13.42.26.82.41 1.23s.19.56.28.83l1 3 .47 1.26.66 1.66.55 1.34c.1.21.17.44.26.66l.53 1.34c.35.81.73 1.6 1.09 2.4l.64 1.25.65 1.18c.48 1 1 2 1.51 2.94l.17.32c.06.13.13.24.19.36l.64 1.08c.6 1.09 1.29 2.15 1.85 3.2l.26.43.64 1c.66 1.06 1.34 2.12 2 3.16l.32.47.65.86c.69 1 1.4 2 2.13 3l.46.64.64.71c.69.91 1.4 1.81 2.12 2.7l.64.89.56.68c.66.78 1.33 1.56 2 2.33l1 1.16.65.62 1.82 1.92 1.41 1.44c.19.21.4.4.61.6l1.57 1.5 1.79 1.69.55.47c.06.07.13.1.19.16l1.29 1.07 2.19 1.87.22.17 1.51 1.2c1.21.95 2.43 1.88 3.68 2.78l.43.32c1.29 1 2.72 1.91 4.11 2.82l.24.15 3 1.93c.06.05.14.08.21.13.36.22.74.42 1.1.64l.24.14 3.1 1.76.82.43 1 .49 3 1.52c.43.2.87.38 1.3.59l.9.41 2.7 1.28c.44.19.89.35 1.32.53s.82.32 1.29.48l1.44.56 1 .41 1.31.45 1.66.56 3.39 1.1c.79.23 1.57.45 2.36.66l2.79.76c1.07.27 2.15.5 3.21.74l2 .45c1.4.28 2.8.51 4.21.75l1.14.19c1.72.25 3.44.47 5.16.65h.32c1.8.19 3.62.32 5.43.41h.48c1.18.06 2.36.06 3.54.08l2 .11h1.44a112 112 0 0 0 20.67-2.22l.68-.14c1.52-.32 3-.66 4.49-1 .41-.1.81-.22 1.28-.33l3.92-1.1c.43-.12.86-.27 1.28-.43l.86-.28 2.85-1 1.4-.52 1.66-.65 1.29-.5.63-.25 1.37-.64a22.27 22.27 0 0 0 2.41-1.08l.83-.37.29-.13 1.29-.61c1-.49 2-1 3-1.51a1.91 1.91 0 0 1 .32-.16l.22-.11 1.19-.64c1.1-.6 2.19-1.23 3.21-1.92l.25-.15 1.08-.64c1.11-.67 2.19-1.37 3.21-2.07l1.28-.79c1.06-.72 2.1-1.45 3.14-2.2l1.24-.9c1-.73 1.92-1.47 2.89-2.23l.62-.5.76-.61c.86-.64 1.7-1.43 2.54-2.16l.9-.78.68-.62c.73-.65 1.45-1.27 2.16-2l1.16-1.11.65-.65 1.77-1.8 1.39-1.47.64-.64 1.38-1.55 1.58-1.82.61-.76 1.07-1.32 1.7-2.14.45-.61 1-1.28 1.72-2.4c.15-.21.28-.43.42-.64l.34-.52.52-.76 1.65-2.57c.19-.3.35-.6.53-.9l.2-.32.45-.77 1.52-2.55q.34-.63.66-1.26l.51-.94 1.29-2.51.63-1.28.59-1.28 1-2.21.64-1.37c.22-.51.42-1 .62-1.53l.52-1.28c.09-.26.2-.51.3-.76l.49-1.27.68-1.92 1-3 .76-2.61.64-2.55c.29-1.13.55-2.26.81-3.39l.41-1.79c.29-1.43.56-2.87.8-4.31l.17-1c.28-1.71.5-3.44.64-5.11a2.4 2.4 0 0 1 0-.24 111.41 111.41 0 0 0 .06-23.67m-36.74 5.67.25 5.79c0 41.37-33.73 74.9-75.34 74.9a75.22 75.22 0 0 1-75.26-75.1C37.31 70.52 71 37 112.64 37c2.34 0 4.69.12 7 .34a111.18 111.18 0 0 1-3.45-12.14c-1.19-.05-2.38-.09-3.58-.09-48.15 0-87.3 38.86-87.3 86.79s39.08 86.79 87.3 86.79 87.24-38.81 87.3-86.79c0-.73 0-1.47-.07-2.2a114.09 114.09 0 0 1-12.14-3.58'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E" +sections: + "create-project": "composer create-project platformsh/drupal8-opigno -s dev" + metrics: false + blackfire: true + postinstall: "templates/drupal8-opigno/info/post_install.md" + local: + - "common/readme/drupal/local_ddev.md" + - "common/readme/drupal/local_lando.md" + resources: + - "[Opigno](https://www.opigno.org/)" + - "[Drupal](https://www.drupal.org/)" + - "[Drupal 8 on Platform.sh](https://docs.platform.sh/guides/drupal9/deploy.html)" + - "[Platform.sh PHP documentation](https://docs.platform.sh/languages/php.html)" + migration: + mounts: + - "web/sites/default/files" + - "private" + files: + "web/sites/default/settings.platformsh.php": + - "**Added:**

" + - "Contains Platform.sh-specific configuration, namely setting up the database connection to the MariaDB service and caching via Redis." + "config/sync/.gitkeep": + - "**Added**" + "web/sites/default/settings.php": + - "**Updated:**

" + - "The Drupal settings file has been updated to import and use `web/sites/default/settings.platformsh.php`." + ".environment": + - "**Added:**

" + - file: "common/readme/file_descriptions/.environment.md" + - "Here, the Composer config and `PATH` are updated to allow executable app dependencies from Composer to be run from the path (i.e. `drush`)." + ".blackfire.yml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.blackfire.yml.md" + ".gitignore": + - "**Added:**

" + - "A `.gitignore` file is not included in the upstream, so one has been added." + ".lando.upstream.yml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.lando.upstream.yml.md" + ".platform.app.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.app.yaml.md" + - "This template uses Composer 2 to install dependencies using the default `composer` [build flavor](https://docs.platform.sh/languages/php.html#build-flavor) prior to the `build` hook." + - "Drush tasks are run during the `deploy` hook, and referenced again during the defined `cron` job." + "drush/platformsh_generate_drush_yml.php": + - "**Added:**

" + - "This file has been included to generate the drush yaml configuration on every deployment." + ".ddev/providers/platform.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.ddev.providers.platform.yaml.md" + "php.ini": + - "**Added:**

" + - file: "common/readme/drupal/php.ini.md" + ".platform/services.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.services.yaml.md" + - "In this template, MariaDB and Redis have been configured." + ".platform/routes.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.routes.yaml.md" + troubleshoot: + - file: "common/readme/troubleshoot_ssh.md" + - file: "common/readme/drupal/troubleshoot_cache.md" + - file: "common/readme/drupal/troubleshoot_hashsalt.md" diff --git a/templates/drupal8-opigno/info/post_install.md b/templates/drupal8-opigno/info/post_install.md new file mode 100644 index 000000000..2a5f3db2c --- /dev/null +++ b/templates/drupal8-opigno/info/post_install.md @@ -0,0 +1,3 @@ +### Post-install + +Run through the Opigno installer as normal. You will not be asked for database credentials as those are already provided. diff --git a/templates/drupal8/files/.platform.app.yaml b/templates/drupal8/files/.platform.app.yaml index 4fbbd068e..8d2e5c704 100644 --- a/templates/drupal8/files/.platform.app.yaml +++ b/templates/drupal8/files/.platform.app.yaml @@ -4,7 +4,7 @@ # See https://docs.platform.sh/configuration/app.html # The name of this app. Must be unique within a project. -name: 'app' +name: 'drupal' # The runtime the application uses. type: 'php:7.4' @@ -17,6 +17,9 @@ runtime: # Enable the redis extension so Drupal can communicate with the Redis cache. extensions: - redis + - blackfire + - sodium + - apcu # The relationships of the application with services or other applications. # diff --git a/templates/drupal8/files/.platform/routes.yaml b/templates/drupal8/files/.platform/routes.yaml index 425c96292..69ba2fcd0 100644 --- a/templates/drupal8/files/.platform/routes.yaml +++ b/templates/drupal8/files/.platform/routes.yaml @@ -5,7 +5,7 @@ "https://{default}/": type: upstream - upstream: "app:http" + upstream: "drupal:http" cache: enabled: true diff --git a/templates/drupal8/files/README.md b/templates/drupal8/files/README.md index 548ac719c..712c9661e 100644 --- a/templates/drupal8/files/README.md +++ b/templates/drupal8/files/README.md @@ -1,42 +1,833 @@ -# Drupal 8 for Platform.sh + +

+ + + +

- - Deploy on Platform.sh + +

-This template builds Drupal 8 using the "Drupal Recommended" Composer project. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. +

Deploy Drupal 8 on Platform.sh

+ +

+Contribute, request a feature, or check out our resources +
+
+Join our community       +Documentation       +Blog       +Report a bug       +Request a feature +

+

+ +

+ +Open issues +   + +Open PRs +   + +License +   +

+ +

+

+ +
+ +

+Contents +

+About       +Getting started       +Migrate       +Learn       +Contribute       +
+

+
+ +## About + +This template builds Drupal 8 using the "Drupal Recommended" Composer project. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. Drupal is a flexible and extensible PHP-based CMS framework. -## Features +### Features + +- PHP 8.0 +- MariaDB 10.4 +- Redis 6 +- Drush included +- Automatic TLS certificates +- Composer-based build + + +## Getting started + +### Deploy + +#### Quickstart + + +The quickest way to deploy this template on Platform.sh is by clicking the button below. +This will automatically create a new project and initialize the repository for you. + +

+ + Deploy on Platform.sh + +

+
+ + + +You can also quickly recreate this project locally with the following command: + +```bash +composer create-project platformsh/drupal8 -s dev +``` + + +> **Note:** +> +> Platform.sh templates prioritize upstream release versions over our own. Despite this, we update template dependencies on a scheduled basis independent of those upstreams. Because of this, template repos do not contain releases. This may change in the future, but until then the `-s dev` flag is necessary to use `composer create-project`. + + + +#### Other deployment options + +For all of the other options below, clone this repository first: + +```bash +git clone https://github.com/platformsh-templates/drupal8 +``` + +If you're trying to deploy from GitHub, you can generate a copy of this repository first in your own namespace by clicking the [Use this template](https://github.com/platformsh-templates/drupal8/generate) button at the top of this page. + +Then you can clone a copy of it locally with `git clone git@github.com:YOUR_NAMESPACE/drupal8.git`. + + +
+Deploy directly to Platform.sh from the command line + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
+ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
+ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
+ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
+ + + +### Post-install + +Run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. + +### Local development + +This section provides instructions for running the `drupal8` template locally, connected to a live database instance on an active Platform.sh environment. + +In all cases for developing with Platform.sh, it's important to develop on an isolated environment - do not connect to data on your production environment when developing locally. +Each of the options below assume that you have already deployed this template to Platform.sh, as well as the following starting commands: + +```bash +$ platform get PROJECT_ID +$ cd project-name +$ platform environment:branch updates +``` + +
+Drupal: using ddev
+ +ddev provides an integration with Platform.sh that makes it simple to develop Drupal locally. Check the [providers documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for the most up-to-date information. + +In general, the steps are as follows: + +1. [Install ddev](https://ddev.readthedocs.io/en/stable/#installation). +1. A configuration file has already been provided at `.ddev/providers/platform.yaml`, so you should not need to run `ddev config`. +1. [Retrieve an API token](https://docs.platform.sh/development/cli/api-tokens.html#get-a-token) for your organization via the management console. +1. Update your dedev global configuration file to use the token you've just retrieved: + ```yaml + web_environment: + - PLATFORMSH_CLI_TOKEN=abcdeyourtoken` + ``` +1. Run `ddev restart`. +1. Get your project ID with `platform project:info`. If you have not already connected your local repo with the project (as is the case with a source integration, by default), you can run `platform project:list` to locate the project ID, and `platform project:set-remote PROJECT_ID` to configure Platform.sh locally. +1. Update the `.ddev/providers/platform.yaml` file for your current setup: + ```yaml + environment_variables: + project_id: PROJECT_ID + environment: CURRENT_ENVIRONMENT + application: drupal + ``` +1. Get the current environment's data with `ddev pull platform`. +1. When you have finished with your work, run `ddev stop` and `ddev poweroff`. + +
+
+Drupal: using Lando
+ +Lando supports PHP applications [configured to run on Platform.sh](https://docs.platform.sh/development/local/lando.html), and pulls from the same container registry Platform.sh uses on your remote environments during your local builds through its own [recipe and plugin](https://docs.lando.dev/platformsh/). + +1. [Install Lando](https://docs.lando.dev/getting-started/installation.html). +1. Make sure Docker is already running - Lando will attempt to start Docker for you, but it's best to have it running in the background before beginning. +1. Start your apps and services with the command `lando start`. +1. To get up-to-date data from your Platform.sh environment ([services *and* mounts](https://docs.lando.dev/platformsh/sync.html#pulling)), run the command `lando pull`. +1. If at any time you have updated your Platform.sh configuration files, run the command `lando rebuild`. +1. When you have finished with your work, run `lando stop` and `lando poweroff`. + +
+ + + +> **Note:** +> +> For many of the steps above, you may need to include the CLI flags `-p PROJECT_ID` and `-e ENVIRONMENT_ID` if you are not in the project directory or if the environment is associated with an existing pull request. + + +## Migrate + +The steps below outline the important steps for migrating your application to Platform.sh - adding the required configuration files and dependencies, for example. +Not every step will be applicable to each person's migration. +These steps actually assume the earliest starting point possible - that there is no code at all locally, and that this template repository will be rebuilt completely from scratch. + +- [Getting started](#getting-started-1) +- [Adding and updating files](#adding-and-updating-files) +- [Dependencies](#dependencies) +- [Deploying to Platform.sh](#deploying-to-platformsh) +- [Migrating your data](#migrating-your-data) +- [Next steps](#next-steps) + +If you already have code you'd like to migrate, feel free to focus on the steps most relevant to your application and skip the first section. + +### Getting started + +Assuming that your starting point is no local code, the steps below will setup a starting repository we can begin to make changes to to rebuild this template and migrate to Platform.sh. +If you already have a codebase you are trying to migrate, move onto the next step - [Adding and updating files](#adding-and-updating-files) - and substitute any reference to the default branch `main` with some other branch name. + + + +```bash +$ mkdir drupal8 && cd drupal8 +$ git init +$ git remote add upstream https://github.com/drupal/recommended-project.git +$ git branch -m main +$ git fetch --all --depth=2 +$ git fetch --all --tags +$ git merge --allow-unrelated-histories -X theirs 8.9.20 + +``` + + + +### Adding and updating files + +A small number of files need to be added to or modified in your repository at this point. +Some of them explicitly configure how the application is built and deployed on Platform.sh, while others simply modify files you may already have locally, in which case you will need to replicate those changes. + +Open the dropdown below to view all of the **Added** and **Updated** files you'll need to reproduce in your migration. + +
+View files
+ + + +| File | Purpose | +|:-----------|:--------| +| [`config/sync/.gitkeep`](config/sync/.gitkeep) | **Added** | +| [`web/sites/default/settings.php`](web/sites/default/settings.php) | **Updated:**

The Drupal settings file has been updated to import and use `web/sites/default/settings.platformsh.php`. | +| [`web/sites/default/settings.platformsh.php`](web/sites/default/settings.platformsh.php) | **Added:**

Contains Platform.sh-specific configuration, namely setting up the database connection to the MariaDB service and caching via Redis. | +| [`.environment`](.environment) | **Added:**

The `.environment` file is a convenient place to [set environment variables](https://docs.platform.sh/development/variables/set-variables.html#set-variables-via-script) relevant to your applications that may be dependent on the current environment. It is sourced before the start command is run, as the first step in the `deploy` and `post_deploy` hooks, and at the beginning of each session when you SSH into an application container. It is written in dash, so be aware of the differences to bash.

It can be used to set any environment variable, including ones that depend on Platform.sh-provided variables like `PLATFORM_RELATIONSHIPS` and `PLATFORM_ROUTES`, or to modify `PATH`. This file should not [produce output](https://docs.platform.sh/development/variables/set-variables.html#testing-environment-scripts).

Here, the Composer config and `PATH` are updated to allow executable app dependencies from Composer to be run from the path (i.e. `drush`). | +| [`.gitignore`](.gitignore) | **Added:**

A `.gitignore` file is not included in the upstream, so one has been added. | +| [`.lando.upstream.yml`](.lando.upstream.yml) | **Added:**

This file configures [Lando](https://docs.platform.sh/development/local/lando.html) as a local development option for this template. See the [Platform.sh Lando plugin documentation](https://docs.lando.dev/platformsh/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. | +| [`.platform.app.yaml`](.platform.app.yaml) | **Added:**

This file is required to define the build and deploy process for all application containers on Platform.sh. Within this file, the runtime version, relationships to service containers, and writable mounts are configured. It's also in this file that it is defined what dependencies are installed, when they are installed, and that package manager will be used to do so.

Take a look at the [Application](https://docs.platform.sh/configuration/app.html) documentation for more details about configuration. For more information about the sequence of events that lead from a build to deployment, see the [Build and deploy timeline documentation](https://docs.platform.sh/overview/build-deploy.html).

This template uses Composer 2 to install dependencies using the default `composer` [build flavor](https://docs.platform.sh/languages/php.html#build-flavor) prior to the `build` hook. Drush tasks are run during the `deploy` hook, and referenced again during the defined `cron` job. | +| [`drush/platformsh_generate_drush_yml.php`](drush/platformsh_generate_drush_yml.php) | **Added:**

This file has been included to generate the drush yaml configuration on every deployment. | +| [`.platform/services.yaml`](.platform/services.yaml) | **Added:**

Platform.sh provides a number of on-demand managed services that can easily be added to your projects. It's within this file that each service's version, name, resources, and additional configuration are set. See the [Services documentation](https://docs.platform.sh/configuration/services.html) for more details on configuration, version and service availability.

In this template, MariaDB and Redis have been configured. | +| [`.platform/routes.yaml`](.platform/routes.yaml) | **Added:**

This file is require to deploy on Platform.sh, as it defines how requests should be handled on the platform. It's within this file that redirects and basic caching can be configured. See the [Routes documentation](https://docs.platform.sh/configuration/routes.html) for more configuration details.

| +| [`php.ini`](php.ini) | **Added:**

An initial `php.ini` file has also beed added. The settings are a result of performance testing and best practice recommendations coming from [Blackfire.io](https://blackfire.io). They will initialize Drupal with a number of good baseline performance settings for production applications, and complement many of the tests specified in [`.blackfire.yml`](.blackfire.yml). | +| [`.blackfire.yml`](.blackfire.yml) | **Added:**

This file has been added to help you get started using [Blackfire.io](https://blackfire.io) on your project. See [the Blackfire section below](#blackfireio-creating-a-continuous-observability-strategy) for more information on how to get started. | +| [`.lando.upstream.yml`](.lando.upstream.yml) | **Added:**

This file configures [Lando](https://docs.platform.sh/development/local/lando.html) as a local development option for this template. See the [Platform.sh Lando plugin documentation](https://docs.lando.dev/platformsh/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. | +| [`.ddev/providers/platform.yaml`](.ddev/providers/platform.yaml) | **Added:**

This file configures [ddev](https://ddev.readthedocs.io/en/latest/users/providers/platform/) as a local development option for this template. See the [Platform.sh ddev integration documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. Be sure to follow the instructions provided through the ddev CLI and in the comments section of that file to correctly configure ddev for your project. | + + + +
+ +### Dependencies and configuration + +Sometimes it is necessary to install additional dependencies to and modify the configuration of an upstream project to deploy on Platform.sh. +When it is, we do our best to keep these modifications to the minimum necessary. +Run the commands below to reproduce the dependencies in this template. + + + +```bash +$ composer require platformsh/config-reader drush/drush:^10.6 drupal/console drupal/redis +$ composer config allow-plugins.composer/installers true --no-plugins +$ composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins +$ composer config allow-plugins.drupal/core-project-message true --no-plugins +$ composer config allow-plugins.cweagans/composer-patches true --no-plugins + +``` + + + +### Deploying to Platform.sh + +Your repository now has all of the code it needs in order to deploy to Platform.sh. + + +
+Deploy directly to Platform.sh from the command line + -* PHP 7.4 -* MariaDB 10.4 -* Redis 6 -* Drush and Drupal Console included -* Automatic TLS certificates -* Composer-based build +1. Create a free trial: -## Post-install + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. -Run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. +1. Install the Platform.sh CLI -## Customizations + #### Linux/OSX -The following changes have been made relative to Drupal 8 "Recommended" project as it is downloaded from Drupal.org or Packagist. If using this project as a reference for your own existing project, replicate the changes below to your project. + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` -* The `.platform.app.yaml`, `.platform/services.yaml`, and `.platform/routes.yaml` files have been added. These provide Platform.sh-specific configuration and are present in all projects on Platform.sh. You may customize them as you see fit. -* An additional Composer library, [`platformsh/config-reader`](https://github.com/platformsh/config-reader-php), has been added. It provides convenience wrappers for accessing the Platform.sh environment variables. -* A `.environment` file has been added, which allows executable app dependencies from Composer to be run from the path. -* Drush and Drupal Console have been pre-included in `composer.json`. You are free to remove one or both if you do not wish to use them. (Note that the default cron and deploy hooks make use of Drush commands, however.) -* The Drupal Redis module comes pre-installed. The placeholder module is not pre-installed, but it is enabled via `settings.platformsh.php` out of the box. -* The `settings.platformsh.php` file contains Platform.sh-specific code to map environment variables into Drupal configuration. You can add to it as needed. See the documentation for more examples of common snippets to include here. It uses the Config Reader library. -* The `settings.php` file has been heavily customized to only define those values needed for both Platform.sh and local development. It calls out to `settings.platformsh.php` if available. You can add additional values as documented in `default.settings.php` as desired. It is also setup such that when you install Drupal on Platform.sh the installer will not ask for database credentials as they will already be defined. + #### Windows -## References + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
+ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
+ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
+ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
+ + + +### Migrating your data + + +If you are moving an existing site to Platform.sh, then in addition to code you also need to migrate your data. That means your database and your files. + +
+Importing the database
+ +First, obtain a database dump from your current site and save your dump file as `database.sql`. Then, import the database into your Platform.sh site using the CLI: + +```bash +platform sql -e main < database.sql +``` + +
+
+Importing files
+ +You first need to download your files from your current hosting environment. +The easiest way is likely with rsync, but consult your old host's documentation. + +The `platform mount:upload` command provides a straightforward way to upload an entire directory to your site at once to a `mount` defined in a `.platform.app.yaml` file. +Under the hood, it uses an SSH tunnel and rsync, so it is as efficient as possible. +(There is also a `platform mount:download` command you can use to download files later.) +Run the following from your local Git repository root (modifying the `--source` path if needed and setting `BRANCH_NAME` to the branch you are using). + +A few examples are listed below, but repeat for all directories that contain data you would like to migrate. + +```bash +$ platform mount:upload -e main --mount web/sites/default/files --source ./web/sites/default/files +$ platform mount:upload -e main --mount private --source ./private +``` + +Note that `rsync` is picky about its trailing slashes, so be sure to include those. + +
+ + + +### Next steps + +With your application now deployed on Platform.sh, things get more interesting. +Run the command `platform environment:branch new-feature` for your project, or open a trivial pull request off of your current branch. + +The resulting environment is an *exact* copy of production. +It contains identical infrastructure to what's been defined in your configuration files, and even includes data copied from your production environment in its services. +On this isolated environment, you're free to make any changes to your application you need to, and really test how they will behave on production. + +After that, here are a collection of additional resources you might find interesting as you continue with your migration to Platform.sh: + +- [Local development](#local-development) +- [Troubleshooting](#troubleshooting) +- [Adding a domain and going live](https://docs.platform.sh/domains/steps.html) +- [(CDN) Content Delivery Networks](https://docs.platform.sh/domains/cdn.html) +- [Performance and observability with Blackfire.io](https://docs.platform.sh/integrations/observability/blackfire.html) +- [Pricing](https://docs.platform.sh/overview/pricing.html) +- [Security and compliance](https://docs.platform.sh/security.html) + + +## Learn + +### Troubleshooting + + +
+Accessing logs
+ +After the environment has finished its deployment, you can investigate issues that occured on startup, `deploy` and `post_deploy` hooks, and generally at runtime using the CLI. Run the command: + +```bash +platform ssh +``` + +If you are running the command outside of a local copy of the project, you will need to include the `-p` (project) and/or `-e` (environment) flags as well. +Once you have connected to the container, [logs](https://docs.platform.sh/development/logs.html#container-logs) are available within `/var/log/` for you to investigate. + +
+ + +
+Rebuilding cache
+ +You may run into a database error after installing Drupal on your production environment initially. +To fix, SSH into the application container (`platform ssh`) and rebuild the cache using Drush: + +```bash +drush cache-rebuild +``` + +
+ + +
+Default hash_salt behavior
+ +Drupal's [default settings set](https://github.com/drupal/drupal/blob/9.3.x/core/assets/scaffold/files/default.settings.php#L252) `hash_salt` to an empty string: + +```php +$settings['hash_salt'] = ''; +``` + +In the past, Platform.sh templates have overridden this value: + +```php +$settings['hash_salt'] = $settings['hash_salt'] ?? $platformsh->projectEntropy; +``` + +This setting was insufficient to cover some user configurations - such as those cases when an application depends on a `Null` value for `hash_salt`. + +Now, the setting looks like this in `settings.platformsh.php`: + +```bash +$settings['hash_salt'] = empty($settings['hash_salt']) ? $platformsh->projectEntropy : $settings['hash_salt']; +``` + +This change sets `hash_salt` to the built-in environment variable `PLATFORM_PROJECT_ENTROPY` value if the project contains the default settings OR `Null`. +If your application code *depends* on an empty value, feel free to comment out that line, or reset again later in that file. + +Feel free to visit [`platformsh-templates/drupal9#73`](https://github.com/platformsh-templates/drupal9/pull/73) for more details on this discussion. + +
+ + + + +### Blackfire.io: creating a Continuous Observability Strategy + +This template includes a starting [`.blackfire.yml`](.blackfire.yml) file that can be used to enable [Application Performance Monitoring](https://blackfire.io/docs/monitoring-cookbooks/index), [Profiling](https://blackfire.io/docs/profiling-cookbooks/index), [Builds](https://blackfire.io/docs/builds-cookbooks/index) and [Performance Testing](https://blackfire.io/docs/testing-cookbooks/index) on your project. Platform.sh comes with Blackfire pre-installed on application containers, and [setting up requires minimal configuration](https://docs.platform.sh/integrations/observability/blackfire.html). + +* [What is Blackfire?](https://blackfire.io/docs/introduction) +* [Configuring Blackfire.io on a Platform.sh project](https://docs.platform.sh/integrations/observability/blackfire.html) +* [Blackfire.io Platform.sh documentation](https://blackfire.io/docs/integrations/paas/platformsh) +* [Profiling Cookbooks](https://blackfire.io/docs/profiling-cookbooks/index) +* [Monitoring Cookbooks](https://blackfire.io/docs/monitoring-cookbooks/index) +* [Testing Cookbooks](https://blackfire.io/docs/testing-cookbooks/index) +* [Using Builds](https://blackfire.io/docs/builds-cookbooks/index) +* [Configuring Integrations](https://blackfire.io/docs/integrations/index) + + +### Resources + + +- [Drupal](https://www.drupal.org/) +- [Drupal 8 on Platform.sh](https://docs.platform.sh/guides/drupal9/deploy.html) +- [Platform.sh PHP documentation](https://docs.platform.sh/languages/php.html) + + + +### Contact + +This template is maintained by the Platform.sh Developer Relations team, and they will be notified of all issues and pull requests you open here. + +- **Community:** Share your question with the community, or see if it's already been asked on our [Community site](https://community.platform.sh). +- **Slack:** If you haven't done so already, you can join Platform.sh's [public Slack](https://chat.platform.sh/) channels and ping the `@devrel_team` with any questions. + + +### About Platform.sh + +This template has been specifically designed to deploy on Platform.sh. + +
+What is Platform.sh?
+ +Platform.sh is a unified, secure, enterprise-grade platform for building, running and scaling web applications. We’re the leader in Fleet Ops: Everything you need to manage your fleet of websites and apps is available from the start. Because infrastructure and workflows are handled from the start, apps just work, so teams can focus on what really matters: making faster changes, collaborating confidently, and scaling responsibly. Whether managing a fleet of ten or ten thousand sites and apps, Platform.sh is the Developer- preferred solution that scales right. + +Our key features include: + +* **GitOps: Git as the source of truth** + + Every branch becomes a development environment, and nothing can change without a commit. + +* **Batteries included: Managed infrastructure** + + [Simple abstraction in YAML](https://docs.platform.sh/configuration/yaml.html) for [committing and configuring infrastructure](https://docs.platform.sh/overview/structure.html), fully managed patch updates, and 24 [runtimes](https://docs.platform.sh/languages.html) & [services](https://docs.platform.sh/configuration/services.html) that can be added with a single line of code. + +* **Instant cloning: Branch, merge, repeat** + + [Reusable builds](https://docs.platform.sh/overview/build-deploy.html) and automatically inherited production data provide true staging environments - experiment in isolation, test, then destroy or merge. + +* **FleetOps: Fleet management platform** + + Leverage our public API along with custom tools like [Source Operations](https://docs.platform.sh/configuration/app/source-operations.html) and [Activity Scripts](https://docs.platform.sh/integrations/activity.html) to [manage thousands of applications](https://youtu.be/MILHG9OqhmE) - their dependency updates, fresh content, and upstream code. + + +To find out more, check out the demo below and go to our [website](https://platform.sh/product/). + +
+

+The Platform.sh demo +

+ + +
+ + + +## Contribute + +

Help us keep top-notch templates!

+ +Every one of our templates is open source, and they're important resources for users trying to deploy to Platform.sh for the first time or better understand the platform. They act as getting started guides, but also contain a number of helpful tips and best practices when working with certain languages and frameworks. + +See something that's wrong with this template that needs to be fixed? Something in the documentation unclear or missing? Let us know! + +

+How to contribute +

+Report a bug       +Submit a feature request       +Open a pull request       +
+

+
+

+Need help? +

+Ask the Platform.sh Community       +Join us on Slack       +
+

+
+

Thanks to all of our amazing contributors!

+
+

+ + + +

+ +

+Made with contrib.rocks +

-* [Drupal](https://www.drupal.org/) -* [Drupal on Platform.sh](https://docs.platform.sh/frameworks/drupal8.html) -* [PHP on Platform.sh](https://docs.platform.sh/languages/php.html) +
diff --git a/templates/drupal8/files/drush/platformsh_generate_drush_yml.php b/templates/drupal8/files/drush/platformsh_generate_drush_yml.php index 19f09554f..9dbb98c17 100644 --- a/templates/drupal8/files/drush/platformsh_generate_drush_yml.php +++ b/templates/drupal8/files/drush/platformsh_generate_drush_yml.php @@ -31,7 +31,7 @@ function _platformsh_drush_site_url() { return [!$a['primary'], strpos($a['url'], 'https://') !== 0, strlen($a['url'])] <=> - [!$a['primary'], strpos($a['url'], 'https://') !== 0, strlen($b['url'])]; + [!$b['primary'], strpos($b['url'], 'https://') !== 0, strlen($b['url'])]; }); // Return the url of the first one. diff --git a/templates/drupal8/files/header.svg b/templates/drupal8/files/header.svg new file mode 100644 index 000000000..9e8219f59 --- /dev/null +++ b/templates/drupal8/files/header.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/templates/drupal8/files/web/sites/default/settings.platformsh.php b/templates/drupal8/files/web/sites/default/settings.platformsh.php index f181d832f..62c9cbd5b 100644 --- a/templates/drupal8/files/web/sites/default/settings.platformsh.php +++ b/templates/drupal8/files/web/sites/default/settings.platformsh.php @@ -108,7 +108,7 @@ // Set the project-specific entropy value, used for generating one-time // keys and such. - $settings['hash_salt'] = $settings['hash_salt'] ?? $platformsh->projectEntropy; + $settings['hash_salt'] = empty($settings['hash_salt']) ? $platformsh->projectEntropy : $settings['hash_salt']; // Set the deployment identifier, which is used by some Drupal cache systems. $settings['deployment_identifier'] = $settings['deployment_identifier'] ?? $platformsh->treeId; diff --git a/templates/drupal8/info/info.yaml b/templates/drupal8/info/info.yaml new file mode 100644 index 000000000..3404028bc --- /dev/null +++ b/templates/drupal8/info/info.yaml @@ -0,0 +1,93 @@ +title: "Deploy Drupal 8 on Platform.sh" +id: platformsh/drupal8 +profile: Drupal 8 +name: Drupal 8 +default_branch: master +tags: + - PHP + - Drupal + - CMS + - Symfony +related_blog_tags: + - Drupal +license: + type: "MIT" + location: "LICENSE" +features: + - PHP 8.0 + - MariaDB 10.4 + - Redis 6 + - Drush included + - Automatic TLS certificates + - Composer-based build +# Use Markdown for links and formatting. They will be converted to HTML automatically when the .platform.template.yaml file is generated. +description: + - This template builds Drupal 8 using the "Drupal Recommended" Composer project. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. + - Drupal is a flexible and extensible PHP-based CMS framework. +logo: + link: "https://www.drupal.org/" + images: + - "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNi4yIDMuOUMxNi4yIDMuOSAxNC44MiAzLjMgMTQuMDQgMi44MkMxNC4wNCAyLjgyIDEzLjAyIDIuMjIgMTEuMzQgMEMxMS4zNCAwIDExLjQgMi41MiA4LjcgMy44NEM0LjQ0IDUuNTIgMS44IDkuMDYgMS44IDEzLjU2QzEuOCAxOS4yNiA2LjQ4IDIzLjk0IDEyLjE4IDIzLjk0QzE3Ljk0IDIzLjk0IDIyLjU2IDE5LjI2IDIyLjU2IDEzLjU2QzIyLjYyIDYuNiAxNi4yIDMuOSAxNi4yIDMuOVpNNC42OCA5LjZDMy4wNiA5Ljk2IDMuMTggOS4xMiAzLjQ4IDguNEMzLjYgNy45OCA0LjAyIDcuNSA0LjAyIDcuNUM1LjEgNS43NiA3LjUgNC41IDcuNSA0LjVDNy44IDQuMzggOC4zNCA0LjA4IDguODIgMy44NEM5Ljc4IDMuMyAxMC4wMiAzIDEwLjAyIDNDMTEuNCAxLjY4IDExLjI4IDAuMDYgMTEuMjggMEMxMi40OCAyLjQgMTEuMDQgMy40OCAxMS4wNCAzLjQ4QzExLjQgMy44NCAxMS4yOCA0LjIgMTEuMjggNC4yQzkuNDIgOC4yMiA0LjY4IDkuNiA0LjY4IDkuNlpNMTcuMjIgMjIuMkMxNy4xIDIyLjI2IDE1LjYgMjIuOTggMTMuODYgMjIuOThDMTIuOSAyMi45OCAxMS44OCAyMi43NCAxMC45OCAyMi4xNEMxMC42OCAyMS45IDEwLjU2IDIxLjQ4IDEwLjc0IDIxLjE4QzEwLjggMjEuMDYgMTEuMTYgMjAuNjQgMTIgMjEuMThDMTIuMDYgMjEuMjQgMTQuMDQgMjIuNTYgMTcuMSAyMC44OEMxNy4zNCAyMC43NiAxNy42NCAyMC44MiAxNy43NiAyMS4wNkMxNy45NCAyMS4zIDE4IDIxLjc4IDE3LjIyIDIyLjJaTTEzLjAyIDE5LjY4TDEzLjA4IDE5LjYyQzEzLjE0IDE5LjU2IDE0LjE2IDE4LjI0IDE1LjY2IDE4LjQyQzE1LjkgMTguNDIgMTYuNzQgMTguNDggMTcuMjggMTkuNUMxNy4zNCAxOS42MiAxNy40NiAyMC4wNCAxNy4yMiAyMC4zNEMxNy4xIDIwLjQ2IDE2LjkyIDIwLjU4IDE2LjU2IDIwLjQ2QzE2LjMyIDIwLjQgMTYuMiAyMC4xNiAxNi4yIDIwLjA0QzE2LjE0IDE5Ljg2IDE2LjA4IDE5Ljc0IDE1LjQ4IDE5LjY4QzE1IDE5LjYyIDE0LjcgMTkuODYgMTQuMzQgMjAuMTZDMTQuMTYgMjAuMzQgMTMuOTIgMjAuNTIgMTMuNjggMjAuNThDMTMuNjIgMjAuNjQgMTMuNTYgMjAuNjQgMTMuNDQgMjAuNjRDMTMuMzIgMjAuNjQgMTMuMiAyMC41OCAxMy4wOCAyMC41MkMxMi45IDIwLjM0IDEyLjg0IDIwLjEgMTMuMDIgMTkuNjhaTTE5Ljg2IDE5LjhDMTkuODYgMTkuOCAxOS4zMiAxOS45OCAxOC43OCAxOS4zOEMxOC43OCAxOS4zOCAxNy4xNiAxNy41MiAxNi4zOCAxNy4yMkMxNi4zOCAxNy4yMiAxNS45IDE3LjA0IDE1LjMgMTcuMjhDMTUuMyAxNy4yOCAxNC44OCAxNy4zNCAxMy4yNiAxOC40MkMxMy4yNiAxOC40MiAxMC41IDIwLjE2IDkuMTIgMTkuOTJDOS4xMiAxOS45MiA2IDE5Ljk4IDYuNDIgMTYuNjhDNi40MiAxNi42OCA3LjA4IDEyLjk2IDExLjQgMTMuOEMxMS40IDEzLjggMTIuMzYgMTMuOTggMTQuMSAxNS4zNkMxNC4xIDE1LjM2IDE1LjMgMTYuMjYgMTUuOSAxNi4yNkMxNS45IDE2LjI2IDE2LjM4IDE2LjMyIDE3LjQ2IDE1LjY2QzE3LjQ2IDE1LjY2IDE5LjU2IDE0LjA0IDIwLjM0IDE0LjFDMjAuNDYgMTQuMSAyMS44NCAxNC4wNCAyMS44NCAxNi4zMkMyMS43OCAxNi4yNiAyMS44NCAxOC45IDE5Ljg2IDE5LjhaIiBmaWxsPSIjMDA4RUNFIi8+Cjwvc3ZnPgo=" +sections: + "create-project": "composer create-project platformsh/drupal8 -s dev" + metrics: false + blackfire: true + postinstall: "templates/drupal8/info/post_install.md" + local: + - "common/readme/drupal/local_ddev.md" + - "common/readme/drupal/local_lando.md" + resources: + - "[Drupal](https://www.drupal.org/)" + - "[Drupal 8 on Platform.sh](https://docs.platform.sh/guides/drupal9/deploy.html)" + - "[Platform.sh PHP documentation](https://docs.platform.sh/languages/php.html)" + migration: + mounts: + - "web/sites/default/files" + - "private" + files: + "web/sites/default/settings.platformsh.php": + - "**Added:**

" + - "Contains Platform.sh-specific configuration, namely setting up the database connection to the MariaDB service and caching via Redis." + "config/sync/.gitkeep": + - "**Added**" + "web/sites/default/settings.php": + - "**Updated:**

" + - "The Drupal settings file has been updated to import and use `web/sites/default/settings.platformsh.php`." + ".environment": + - "**Added:**

" + - file: "common/readme/file_descriptions/.environment.md" + - "Here, the Composer config and `PATH` are updated to allow executable app dependencies from Composer to be run from the path (i.e. `drush`)." + ".blackfire.yml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.blackfire.yml.md" + ".gitignore": + - "**Added:**

" + - "A `.gitignore` file is not included in the upstream, so one has been added." + ".lando.upstream.yml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.lando.upstream.yml.md" + ".platform.app.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.app.yaml.md" + - "This template uses Composer 2 to install dependencies using the default `composer` [build flavor](https://docs.platform.sh/languages/php.html#build-flavor) prior to the `build` hook." + - "Drush tasks are run during the `deploy` hook, and referenced again during the defined `cron` job." + "drush/platformsh_generate_drush_yml.php": + - "**Added:**

" + - "This file has been included to generate the drush yaml configuration on every deployment." + ".ddev/providers/platform.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.ddev.providers.platform.yaml.md" + "php.ini": + - "**Added:**

" + - file: "common/readme/drupal/php.ini.md" + ".platform/services.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.services.yaml.md" + - "In this template, MariaDB and Redis have been configured." + ".platform/routes.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.routes.yaml.md" + troubleshoot: + - file: "common/readme/troubleshoot_ssh.md" + - file: "common/readme/drupal/troubleshoot_cache.md" + - file: "common/readme/drupal/troubleshoot_hashsalt.md" diff --git a/templates/drupal8/info/post_install.md b/templates/drupal8/info/post_install.md new file mode 100644 index 000000000..795b018e1 --- /dev/null +++ b/templates/drupal8/info/post_install.md @@ -0,0 +1,3 @@ +### Post-install + +Run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. diff --git a/templates/drupal9-multisite/.platform.template.yaml b/templates/drupal9-multisite/.platform.template.yaml new file mode 100644 index 000000000..0557d494c --- /dev/null +++ b/templates/drupal9-multisite/.platform.template.yaml @@ -0,0 +1,32 @@ +version: 1 + +info: + id: platformsh/drupal8-multisite + name: Drupal 8 Multisite + description: | +

This template builds Drupal 8 in a multisite configuration using the "Drupal Recommended" Composer project. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided.

+

It also includes instructions and a script to help with setting up additional multisite instances, although depending on your particular needs it may require some customization.

+

Drupal is a flexible and extensible PHP-based CMS framework capable of hosting multiple sites on a single code base.

+ + tags: + - PHP + - Drupal + - CMS + - Symfony + image: data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='199.37' height='225'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%232ba9e0%7D%3C/style%3E%3C/defs%3E%3Cg %3E%3Cg %3E%3Cpath class='cls-1' d='M93.78 139.31a35.5 35.5 0 1 0 35.5 35.5 35.51 35.51 0 0 0-35.5-35.5zM138 132.51a61.17 61.17 0 0 1-9.26 92.49c29.31-9 53.56-31.06 64.4-57.73 15-36.92 1-64.67-22.43-89.87a45.68 45.68 0 0 1 1.15 10.11 46.88 46.88 0 0 1-33.86 45zM97.82 87.57A27.19 27.19 0 1 0 125 60.43a27.16 27.16 0 0 0-27.18 27.14z'/%3E%3Cpath class='cls-1' d='M47 214.22a61.17 61.17 0 0 1 39.55-100.1 46.82 46.82 0 0 1 44.75-72.89C116 28 100.72 14.62 88.66 0c6.13 64.13-58.4 40.82-82.32 100C-9.62 139.58 4.79 188.56 47 214.22z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E + notes: + - heading: "Features" + content: | + PHP 7.4
+ MariaDB 10.4
+ Redis 6
+ Drush and Drupal Console included
+ Pre-configured for multiple sites
+ Automatic TLS certificates
+ Composer-based build
+ +initialize: + repository: https://github.com/platformsh-templates/drupal8-multisite.git@master + config: null + files: [] + profile: Drupal 8 Multisite diff --git a/templates/drupal9-multisite/files/.editorconfig b/templates/drupal9-multisite/files/.editorconfig new file mode 100644 index 000000000..76b0d7c09 --- /dev/null +++ b/templates/drupal9-multisite/files/.editorconfig @@ -0,0 +1,20 @@ +# Drupal editor configuration normalization +# @see http://editorconfig.org/ + +# This is the top-most .editorconfig file; do not search in parent directories. +root = true + +# All files. +[*] +end_of_line = LF +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[composer.{json,lock}] +indent_size = 4 + +[.platform.app.yaml] +indent_size = 4 diff --git a/templates/drupal9-multisite/files/.environment b/templates/drupal9-multisite/files/.environment new file mode 100644 index 000000000..3e0014164 --- /dev/null +++ b/templates/drupal9-multisite/files/.environment @@ -0,0 +1,11 @@ +# Statements in this file will be executed (sourced) by the shell in SSH +# sessions, in deploy hooks, in cron jobs, and in the application's runtime +# environment. This file must be placed in the root of the application, not +# necessarily the git repository's root. In case of multiple applications, +# each application can have its own .environment file. + +# Allow executable app dependencies from Composer to be run from the path. +if [ -n "$PLATFORM_APP_DIR" -a -f "$PLATFORM_APP_DIR"/composer.json ] ; then + bin=$(composer config bin-dir --working-dir="$PLATFORM_APP_DIR" --no-interaction 2>/dev/null) + export PATH="${PLATFORM_APP_DIR}/${bin:-vendor/bin}:${PATH}" +fi diff --git a/templates/drupal9-multisite/files/.gitignore b/templates/drupal9-multisite/files/.gitignore new file mode 100644 index 000000000..2713229f9 --- /dev/null +++ b/templates/drupal9-multisite/files/.gitignore @@ -0,0 +1,33 @@ +# Ignore directories generated by Composer +/drush/contrib/ +/vendor/ +/web/core/ +/web/modules/contrib/ +/web/themes/contrib/ +/web/profiles/contrib/ +/web/libraries/ +console/ + +# Ignore sensitive information +/web/sites/*/settings.local.php + +# Ignore Drupal's file directory +/web/files/ + +# Ignore SimpleTest multi-site environment. +/web/sites/simpletest + +# Ignore files generated by PhpStorm +/.idea/ + +# Ignore .env files as they are personal +/.env + + +# Ignore mounts +web/files +tmp +private +.drush +drush-backups +.console diff --git a/templates/drupal9-multisite/files/.lando.upstream.yml b/templates/drupal9-multisite/files/.lando.upstream.yml new file mode 100644 index 000000000..12d39945e --- /dev/null +++ b/templates/drupal9-multisite/files/.lando.upstream.yml @@ -0,0 +1,34 @@ +# This file sets some good defaults for local development using this Platform.sh +# template with Lando. +# +# Note that you should not edit this file so it can continue to receive upstream +# updates. If you wish to change the values below then override them in your +# normal .lando.yml. + +# These both allow you to test this template without needing a site on Platform.sh +# However you will want to replace them in your .lando.yml +name: platformsh-drupal9-multisite +recipe: platformsh + +config: + + # This section overrides Platform.sh configuration with values that make more + # sense for local development. + # + # Note that "app" is the name of the application defined in your + # .platform.app.yaml or applications.yaml. + overrides: + app: + variables: + drupalconfig: + "system.file:path:temporary": "/tmp" + drupalsettings: + "skip_permissions_hardening": 1 + + +# These are tools that are commonly used during development for this template. +tooling: + drush: + service: app + drupal: + service: app diff --git a/templates/drupal9-multisite/files/.platform.app.yaml b/templates/drupal9-multisite/files/.platform.app.yaml new file mode 100644 index 000000000..a561737ce --- /dev/null +++ b/templates/drupal9-multisite/files/.platform.app.yaml @@ -0,0 +1,159 @@ +# This file describes an application. You can have multiple applications +# in the same project. +# +# See https://docs.platform.sh/configuration/app.html + +# The name of this app. Must be unique within a project. +name: 'drupal' + +# The runtime the application uses. +type: 'php:8.0' + +dependencies: + php: + composer/composer: '^2' + +runtime: + # Enable the redis extension so Drupal can communicate with the Redis cache. + extensions: + - redis + - sodium + - apcu + - blackfire + +# The relationships of the application with services or other applications. +# +# The left-hand side is the name of the relationship as it will be exposed +# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand +# side is in the form `:`. +relationships: + rediscache: 'cache:redis' + first: 'db:first' + second: 'db:second' + +# The size of the persistent disk of the application (in MB). +disk: 2048 + +# The 'mounts' describe writable, persistent filesystem mounts in the application. +mounts: + # For multisite, use a common shared files directory and subdirectories inside it + # to avoid needing a separate mount definition for each site. + '/web/files': + source: local + source_path: 'files' + # Drupal gets its own dedicated tmp directory. The settings.platformsh.php + # file will automatically configure Drupal to use this directory. + '/tmp': + source: local + source_path: 'tmp' + # Private file uploads are stored outside the web root. The settings.platformsh.php + # file will automatically configure Drupal to use this directory. + '/private': + source: local + source_path: 'private' + # Drush needs a scratch space for its own caches. + '/.drush': + source: local + source_path: 'drush' + # Drush will try to save backups to this directory, so it must be + # writeable even though you will almost never need to use it. + '/drush-backups': + source: local + source_path: 'drush-backups' + # Drupal Console will try to save backups to this directory, so it must be + # writeable even though you will almost never need to use it. + '/.console': + source: local + source_path: 'console' + +# Configuration of the build of this application. +build: + # Automatically run `composer install` on every build. + flavor: composer + +# The hooks executed at various points in the lifecycle of the application. +hooks: + # The build hook runs after Composer to finish preparing up your code. + # No services are available but the disk is writeable. + build: | + set -e + # The deploy hook runs after your application has been deployed and started. + # Code cannot be modified at this point but the database is available. + # The site is not accepting requests while this script runs so keep it + # fast. + deploy: | + set -e + php ./drush/platformsh_generate_drush_yml.php + cd web + drush -y cache-rebuild + drush -y updatedb + drush -y config-import + +# The configuration of app when it is exposed to the web. +web: + locations: + # All requests not otherwise specified follow these rules. + '/': + # The folder from which to serve static assets, for this location. + # + # This is a filesystem path, relative to the application root. + root: 'web' + + # How long to allow static assets from this location to be cached. + # + # Can be a time in seconds, or -1 for no caching. Times can be + # suffixed with "s" (seconds), "m" (minutes), "h" (hours), "d" + # (days), "w" (weeks), "M" (months, as 30 days) or "y" (years, as + # 365 days). + expires: 5m + + # Redirect any incoming request to Drupal's front controller. + passthru: '/index.php' + + # Deny access to all static files, except those specifically allowed below. + allow: false + + # Rules for specific URI patterns. + rules: + # Allow access to common static files. + '\.(jpe?g|png|gif|svgz?|css|js|map|ico|bmp|eot|woff2?|otf|ttf)$': + allow: true + '^/robots\.txt$': + allow: true + '^/sitemap\.xml$': + allow: true + + # Deny direct access to configuration files. + '^/sites/sites\.php$': + scripts: false + '^/sites/[^/]+/settings.*?\.php$': + scripts: false + + # The files directory has its own special configuration rules. + '/files': + # Allow access to all files in the public files directory. + allow: true + expires: 5m + passthru: '/index.php' + root: 'web/files' + + # Do not execute PHP scripts from the writeable mount. + scripts: false + + rules: + # Provide a longer TTL (2 weeks) for aggregated CSS and JS files. + '^/files/(css|js)': + expires: 2w + +crons: + # Run Drupal's cron tasks every 19 minutes. + drupal: + spec: '*/19 * * * *' + cmd: 'cd web ; drush core-cron' + +source: + operations: + auto-update: + command: | + curl -fsS https://raw.githubusercontent.com/platformsh/source-operations/main/setup.sh | { bash /dev/fd/3 sop-autoupdate; } 3<&0 + diff --git a/templates/drupal9-multisite/files/.platform/routes.yaml b/templates/drupal9-multisite/files/.platform/routes.yaml new file mode 100644 index 000000000..3f4b56943 --- /dev/null +++ b/templates/drupal9-multisite/files/.platform/routes.yaml @@ -0,0 +1,33 @@ +# The routes of the project. +# +# Each route describes how an incoming URL is going +# to be processed by Platform.sh. + +"https://first.{default}/": + type: upstream + upstream: "drupal:http" + cache: + enabled: true + # Base the cache on the session cookie and custom Drupal cookies. Ignore all other cookies. + cookies: ['/^SS?ESS/', '/^Drupal.visitor/'] + +"https://second.{default}/": + type: upstream + upstream: "drupal:http" + cache: + enabled: true + # Base the cache on the session cookie and custom Drupal cookies. Ignore all other cookies. + cookies: ['/^SS?ESS/', '/^Drupal.visitor/'] + +"https://main.{default}/": + type: upstream + upstream: "drupal:http" + primary: true + cache: + enabled: true + # Base the cache on the session cookie and custom Drupal cookies. Ignore all other cookies. + cookies: ['/^SS?ESS/', '/^Drupal.visitor/'] + +"https://{default}/": + type: redirect + to: "https://main.{default}/" diff --git a/templates/drupal9-multisite/files/.platform/services.yaml b/templates/drupal9-multisite/files/.platform/services.yaml new file mode 100644 index 000000000..bd199cf5c --- /dev/null +++ b/templates/drupal9-multisite/files/.platform/services.yaml @@ -0,0 +1,24 @@ +# The services of the project. +# +# Each service listed will be deployed +# to power your Platform.sh project. + +db: + type: 'mariadb:10.4' + disk: 2048 + configuration: + schemas: + - firstdb + - seconddb + endpoints: + first: + default_schema: firstdb + privileges: + firstdb: admin + second: + default_schema: seconddb + privileges: + seconddb: admin + +cache: + type: redis:6.0 diff --git a/templates/drupal9-multisite/files/README.md b/templates/drupal9-multisite/files/README.md new file mode 100644 index 000000000..cc0cb0447 --- /dev/null +++ b/templates/drupal9-multisite/files/README.md @@ -0,0 +1,887 @@ + +

+ + + +

+ +

+ + + +

+ +

Drupal 9 Multisite for Platform.sh

+ +

+Contribute, request a feature, or check out our resources +
+
+Join our community       +Documentation       +Blog       +Report a bug       +Request a feature +

+

+ +

+ +Open issues +   + +Open PRs +   + +License +   +

+ +

+

+ +
+ +

+Contents +

+About       +Getting started       +Migrate       +Learn       +Contribute       +
+

+
+ +## About + +This template builds Drupal 9 in a multisite configuration using the "Drupal Recommended" Composer project, creating three subsite installations from the same codebase. + +It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. + +It also includes instructions and a script to help with setting up additional multisite instances, although depending on your particular needs it may require some customization. + +Drupal is a flexible and extensible PHP-based CMS framework capable of hosting multiple sites on a single code base. + +### Features + +- PHP 8.0 +- MariaDB 10.4 +- Redis 6 +- Drush included +- Pre-configured for multiple sites +- Automatic TLS certificates +- Composer-based build + + +## Getting started + +### Deploy + +#### Quickstart + + +The quickest way to deploy this template on Platform.sh is by clicking the button below. +This will automatically create a new project and initialize the repository for you. + +

+ + Deploy on Platform.sh + +

+
+ + + +You can also quickly recreate this project locally with the following command: + +```bash +composer create-project platformsh/drupal9-multisite -s dev +``` + + +> **Note:** +> +> Platform.sh templates prioritize upstream release versions over our own. Despite this, we update template dependencies on a scheduled basis independent of those upstreams. Because of this, template repos do not contain releases. This may change in the future, but until then the `-s dev` flag is necessary to use `composer create-project`. + + + +#### Other deployment options + +For all of the other options below, clone this repository first: + +```bash +git clone https://github.com/platformsh-templates/drupal9-multisite +``` + +If you're trying to deploy from GitHub, you can generate a copy of this repository first in your own namespace by clicking the [Use this template](https://github.com/platformsh-templates/drupal9-multisite/generate) button at the top of this page. + +Then you can clone a copy of it locally with `git clone git@github.com:YOUR_NAMESPACE/drupal9-multisite.git`. + + +
+Deploy directly to Platform.sh from the command line + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
+ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
+ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
+ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
+ + + +### Post-install + +Each subsite installs separately. As configured, this project uses a subdomain for each subsite. For each subsite, run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. +### Local development + +This section provides instructions for running the `drupal9-multisite` template locally, connected to a live database instance on an active Platform.sh environment. + +In all cases for developing with Platform.sh, it's important to develop on an isolated environment - do not connect to data on your production environment when developing locally. +Each of the options below assume that you have already deployed this template to Platform.sh, as well as the following starting commands: + +```bash +$ platform get PROJECT_ID +$ cd project-name +$ platform environment:branch updates +``` + +
+Drupal: using ddev
+ +ddev provides an integration with Platform.sh that makes it simple to develop Drupal locally. Check the [providers documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for the most up-to-date information. + +In general, the steps are as follows: + +1. [Install ddev](https://ddev.readthedocs.io/en/stable/#installation). +1. A configuration file has already been provided at `.ddev/providers/platform.yaml`, so you should not need to run `ddev config`. +1. [Retrieve an API token](https://docs.platform.sh/development/cli/api-tokens.html#get-a-token) for your organization via the management console. +1. Update your dedev global configuration file to use the token you've just retrieved: + ```yaml + web_environment: + - PLATFORMSH_CLI_TOKEN=abcdeyourtoken` + ``` +1. Run `ddev restart`. +1. Get your project ID with `platform project:info`. If you have not already connected your local repo with the project (as is the case with a source integration, by default), you can run `platform project:list` to locate the project ID, and `platform project:set-remote PROJECT_ID` to configure Platform.sh locally. +1. Update the `.ddev/providers/platform.yaml` file for your current setup: + ```yaml + environment_variables: + project_id: PROJECT_ID + environment: CURRENT_ENVIRONMENT + application: drupal + ``` +1. Get the current environment's data with `ddev pull platform`. +1. When you have finished with your work, run `ddev stop` and `ddev poweroff`. + +
+
+Drupal: using Lando
+ +Lando supports PHP applications [configured to run on Platform.sh](https://docs.platform.sh/development/local/lando.html), and pulls from the same container registry Platform.sh uses on your remote environments during your local builds through its own [recipe and plugin](https://docs.lando.dev/platformsh/). + +1. [Install Lando](https://docs.lando.dev/getting-started/installation.html). +1. Make sure Docker is already running - Lando will attempt to start Docker for you, but it's best to have it running in the background before beginning. +1. Start your apps and services with the command `lando start`. +1. To get up-to-date data from your Platform.sh environment ([services *and* mounts](https://docs.lando.dev/platformsh/sync.html#pulling)), run the command `lando pull`. +1. If at any time you have updated your Platform.sh configuration files, run the command `lando rebuild`. +1. When you have finished with your work, run `lando stop` and `lando poweroff`. + +
+ + + +> **Note:** +> +> For many of the steps above, you may need to include the CLI flags `-p PROJECT_ID` and `-e ENVIRONMENT_ID` if you are not in the project directory or if the environment is associated with an existing pull request. + + +## Migrate + +The steps below outline the important steps for migrating your application to Platform.sh - adding the required configuration files and dependencies, for example. +Not every step will be applicable to each person's migration. +These steps actually assume the earliest starting point possible - that there is no code at all locally, and that this template repository will be rebuilt completely from scratch. + +- [Getting started](#getting-started-1) +- [Adding and updating files](#adding-and-updating-files) +- [Dependencies](#dependencies) +- [Deploying to Platform.sh](#deploying-to-platformsh) +- [Migrating your data](#migrating-your-data) +- [Next steps](#next-steps) + +If you already have code you'd like to migrate, feel free to focus on the steps most relevant to your application and skip the first section. + +### Getting started + +Assuming that your starting point is no local code, the steps below will setup a starting repository we can begin to make changes to to rebuild this template and migrate to Platform.sh. +If you already have a codebase you are trying to migrate, move onto the next step - [Adding and updating files](#adding-and-updating-files) - and substitute any reference to the default branch `main` with some other branch name. + + + +```bash +$ mkdir drupal9-multisite && cd drupal9-multisite +$ git init +$ git remote add upstream https://github.com/drupal/recommended-project.git +$ git branch -m main +$ git fetch --all --depth=2 +$ git fetch --all --tags +$ git merge --allow-unrelated-histories -X theirs 9.3.9 + +``` + + + +### Adding and updating files + +A small number of files need to be added to or modified in your repository at this point. +Some of them explicitly configure how the application is built and deployed on Platform.sh, while others simply modify files you may already have locally, in which case you will need to replicate those changes. + +Open the dropdown below to view all of the **Added** and **Updated** files you'll need to reproduce in your migration. + +
+View files
+ + + +| File | Purpose | +|:-----------|:--------| +| [`psh-subsite-add.php`](psh-subsite-add.php) | **Added:**

A script has been added to simplify adding additional sites to your Drupal installation. See [Adding a new subsite](#troubleshooting) for more information. | +| [`web/sites/sites.php`](web/sites/sites.php) | **Added:**

Configuration file for multi-site support and directory aliasing feature. | +| [`web/sites/default/settings.php`](web/sites/default/settings.php) | **Added:**

The Drupal settings file has been updated to import and use `web/sites/settings.platformsh.php`. You will also need an identical file for each subsite (i.e. `main`, `first`, and `second`). | +| [`web/sites/default/services.yml`](web/sites/default/services.yml) | **Added:**

Default services configuration. You will also need an identical file for each subsite (i.e. `main`, `first`, and `second`). | +| [`web/sites/default/drushrc.php`](web/sites/default/drushrc.php) | **Added:**

Drush configuration file for a Platform.sh Drupal site. You will also need an identical file for each subsite (i.e. `main`, `first`, and `second`). | +| [`web/sites/settings.platformsh.php`](web/sites/settings.platformsh.php) | **Added:**

Contains Platform.sh-specific configuration, namely setting up the database connection to the MariaDB service and caching via Redis. | +| [`.environment`](.environment) | **Added:**

The `.environment` file is a convenient place to [set environment variables](https://docs.platform.sh/development/variables/set-variables.html#set-variables-via-script) relevant to your applications that may be dependent on the current environment. It is sourced before the start command is run, as the first step in the `deploy` and `post_deploy` hooks, and at the beginning of each session when you SSH into an application container. It is written in dash, so be aware of the differences to bash.

It can be used to set any environment variable, including ones that depend on Platform.sh-provided variables like `PLATFORM_RELATIONSHIPS` and `PLATFORM_ROUTES`, or to modify `PATH`. This file should not [produce output](https://docs.platform.sh/development/variables/set-variables.html#testing-environment-scripts).

Here, the Composer config and `PATH` are updated to allow executable app dependencies from Composer to be run from the path (i.e. `drush`). | +| [`.gitignore`](.gitignore) | **Added:**

A `.gitignore` file is not included in the upstream, so one has been added. | +| [`.lando.upstream.yml`](.lando.upstream.yml) | **Added:**

This file configures [Lando](https://docs.platform.sh/development/local/lando.html) as a local development option for this template. See the [Platform.sh Lando plugin documentation](https://docs.lando.dev/platformsh/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. | +| [`.platform.app.yaml`](.platform.app.yaml) | **Added:**

This file is required to define the build and deploy process for all application containers on Platform.sh. Within this file, the runtime version, relationships to service containers, and writable mounts are configured. It's also in this file that it is defined what dependencies are installed, when they are installed, and that package manager will be used to do so.

Take a look at the [Application](https://docs.platform.sh/configuration/app.html) documentation for more details about configuration. For more information about the sequence of events that lead from a build to deployment, see the [Build and deploy timeline documentation](https://docs.platform.sh/overview/build-deploy.html).

This template uses Composer 2 to install dependencies using the default `composer` [build flavor](https://docs.platform.sh/languages/php.html#build-flavor) prior to the `build` hook. Drush tasks are run during the `deploy` hook, and referenced again during the defined `cron` job. | +| [`drush/platformsh_generate_drush_yml.php`](drush/platformsh_generate_drush_yml.php) | **Added:**

This file has been included to generate the drush yaml configuration on every deployment. | +| [`.platform/services.yaml`](.platform/services.yaml) | **Added:**

Platform.sh provides a number of on-demand managed services that can easily be added to your projects. It's within this file that each service's version, name, resources, and additional configuration are set. See the [Services documentation](https://docs.platform.sh/configuration/services.html) for more details on configuration, version and service availability.

In this template, MariaDB and Redis have been configured. | +| [`.platform/routes.yaml`](.platform/routes.yaml) | **Added:**

This file is require to deploy on Platform.sh, as it defines how requests should be handled on the platform. It's within this file that redirects and basic caching can be configured. See the [Routes documentation](https://docs.platform.sh/configuration/routes.html) for more configuration details.

| +| [`php.ini`](php.ini) | **Added:**

An initial `php.ini` file has also beed added. The settings are a result of performance testing and best practice recommendations coming from [Blackfire.io](https://blackfire.io). They will initialize Drupal with a number of good baseline performance settings for production applications, and complement many of the tests specified in [`.blackfire.yml`](.blackfire.yml). | +| [`.blackfire.yml`](.blackfire.yml) | **Added:**

This file has been added to help you get started using [Blackfire.io](https://blackfire.io) on your project. See [the Blackfire section below](#blackfireio-creating-a-continuous-observability-strategy) for more information on how to get started. | +| [`.lando.upstream.yml`](.lando.upstream.yml) | **Added:**

This file configures [Lando](https://docs.platform.sh/development/local/lando.html) as a local development option for this template. See the [Platform.sh Lando plugin documentation](https://docs.lando.dev/platformsh/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. | +| [`.ddev/providers/platform.yaml`](.ddev/providers/platform.yaml) | **Added:**

This file configures [ddev](https://ddev.readthedocs.io/en/latest/users/providers/platform/) as a local development option for this template. See the [Platform.sh ddev integration documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. Be sure to follow the instructions provided through the ddev CLI and in the comments section of that file to correctly configure ddev for your project. | + + + +
+ +### Dependencies and configuration + +Sometimes it is necessary to install additional dependencies to and modify the configuration of an upstream project to deploy on Platform.sh. +When it is, we do our best to keep these modifications to the minimum necessary. +Run the commands below to reproduce the dependencies in this template. + + + +```bash +$ composer require platformsh/config-reader drush/drush drupal/redis +$ composer config allow-plugins.composer/installers true --no-plugins +$ composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins +$ composer config allow-plugins.drupal/core-project-message true --no-plugins +$ composer config allow-plugins.cweagans/composer-patches true --no-plugins + +``` + + + +### Deploying to Platform.sh + +Your repository now has all of the code it needs in order to deploy to Platform.sh. + + +
+Deploy directly to Platform.sh from the command line + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
+ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
+ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
+ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
+ + + +### Migrating your data + + +If you are moving an existing site to Platform.sh, then in addition to code you also need to migrate your data. That means your database and your files. + +
+Importing the database
+ +First, obtain a database dump from your current site and save your dump file as `database.sql`. Then, import the database into your Platform.sh site using the CLI: + +```bash +platform sql -e main < database.sql +``` + +
+
+Importing files
+ +You first need to download your files from your current hosting environment. +The easiest way is likely with rsync, but consult your old host's documentation. + +The `platform mount:upload` command provides a straightforward way to upload an entire directory to your site at once to a `mount` defined in a `.platform.app.yaml` file. +Under the hood, it uses an SSH tunnel and rsync, so it is as efficient as possible. +(There is also a `platform mount:download` command you can use to download files later.) +Run the following from your local Git repository root (modifying the `--source` path if needed and setting `BRANCH_NAME` to the branch you are using). + +A few examples are listed below, but repeat for all directories that contain data you would like to migrate. + +```bash +$ platform mount:upload -e main --mount web/sites/default/files --source ./web/sites/default/files +$ platform mount:upload -e main --mount private --source ./private +``` + +Note that `rsync` is picky about its trailing slashes, so be sure to include those. + +
+ + + +### Next steps + +With your application now deployed on Platform.sh, things get more interesting. +Run the command `platform environment:branch new-feature` for your project, or open a trivial pull request off of your current branch. + +The resulting environment is an *exact* copy of production. +It contains identical infrastructure to what's been defined in your configuration files, and even includes data copied from your production environment in its services. +On this isolated environment, you're free to make any changes to your application you need to, and really test how they will behave on production. + +After that, here are a collection of additional resources you might find interesting as you continue with your migration to Platform.sh: + +- [Local development](#local-development) +- [Troubleshooting](#troubleshooting) +- [Adding a domain and going live](https://docs.platform.sh/domains/steps.html) +- [(CDN) Content Delivery Networks](https://docs.platform.sh/domains/cdn.html) +- [Performance and observability with Blackfire.io](https://docs.platform.sh/integrations/observability/blackfire.html) +- [Pricing](https://docs.platform.sh/overview/pricing.html) +- [Security and compliance](https://docs.platform.sh/security.html) + + +## Learn + +### Troubleshooting + + +
+Accessing logs
+ +After the environment has finished its deployment, you can investigate issues that occured on startup, `deploy` and `post_deploy` hooks, and generally at runtime using the CLI. Run the command: + +```bash +platform ssh +``` + +If you are running the command outside of a local copy of the project, you will need to include the `-p` (project) and/or `-e` (environment) flags as well. +Once you have connected to the container, [logs](https://docs.platform.sh/development/logs.html#container-logs) are available within `/var/log/` for you to investigate. + +
+ + +
+Rebuilding cache
+ +You may run into a database error after installing Drupal on your production environment initially. +To fix, SSH into the application container (`platform ssh`) and rebuild the cache using Drush: + +```bash +drush cache-rebuild +``` + +
+ + +
+Default hash_salt behavior
+ +Drupal's [default settings set](https://github.com/drupal/drupal/blob/9.3.x/core/assets/scaffold/files/default.settings.php#L252) `hash_salt` to an empty string: + +```php +$settings['hash_salt'] = ''; +``` + +In the past, Platform.sh templates have overridden this value: + +```php +$settings['hash_salt'] = $settings['hash_salt'] ?? $platformsh->projectEntropy; +``` + +This setting was insufficient to cover some user configurations - such as those cases when an application depends on a `Null` value for `hash_salt`. + +Now, the setting looks like this in `settings.platformsh.php`: + +```bash +$settings['hash_salt'] = empty($settings['hash_salt']) ? $platformsh->projectEntropy : $settings['hash_salt']; +``` + +This change sets `hash_salt` to the built-in environment variable `PLATFORM_PROJECT_ENTROPY` value if the project contains the default settings OR `Null`. +If your application code *depends* on an empty value, feel free to comment out that line, or reset again later in that file. + +Feel free to visit [`platformsh-templates/drupal9#73`](https://github.com/platformsh-templates/drupal9/pull/73) for more details on this discussion. + +
+ +
+How Drupal multi-site works on Platform.sh
+ +Multisite on Platform.sh can be tricky. Drupal multisite bases its logic off of the domain name of the incoming request. However, the domain name of the request is by design highly variable on Platform.sh as every environment has a unique domain. As a result, this template establishes a number of conventions and custom configuration to make multi-site work. + +* Every subsite is a subdomain off of a common domain. See `routes.yaml`. The domain prefix is the "subsite ID". +* Every subsite has its own database and endpoint on a single MariaDB service instance. The endpoint name is the same as the subsite ID. +* The `sites/sites.php` file includes code to build a `$sites` lookup list to map any incoming request, regardless of branch, to a settings directory named for the subsite ID. It iterates over all routes that point to the Drupal application and parses those routes into a domain name -> directory list, where the directory is the site ID. If you are not using a subdomain based multi-site you will likely need to modify the body of the `foreach()` loop. +* The `.platform.app.yaml` file is essentially the same as for a single-site Drupal installation, but its relationships include every defined MariaDB endpoint. The relationship is also named for the subsite ID. +* Every subsite ID's `settings.php` file is identical, and largely similar to the standard Platform.sh `settings.php` file. You may customize it if needed. In particular, the `$platformsh_enable_redis` variable should be toggled to `true` for each site only after the install process is completed for that site, as Drupal cannot install with the redis module active. +* The `settings.php` files also include a shared `sites/settings.platformsh.php` file. It is largely the same as in a single-site configuration but has been modified to leverage the subsite ID for: + * Selecting which database relationship to use + * Including a cache prefix in Redis so that each site has its own effective cache pool. + * Setting the files and private files directories, which are subsite ID prefixes of top-level `files` and `private` directories rather than under each site directory. + +
+ +
+Adding a new subsite
+ +Adding a new subsite requires the following steps. For these steps, assume we're adding a subdomain named `stuff`. + +1. Add a new route to `routes.yaml` with a new `stuff` domain prefix. Copying and pasting an existing route is fine. +2. Copy the `sites/default` directory to `sites/stuff`. +3. Edit `services.yaml` and add a new database and endpoint. Copying and pasting an existing entry is fine. The new relationship must be named `stuff`. +4. Edit `.platform.app.yaml` and add a new relationship: `stuff: db:stuff`. (Where `db` is the name of the database service from `services.yaml`.) +5. Commit the above changes and push. +6. In your browser, go to the `stuff.example.com` domain (or equivalent on a dev environment) and run through the Drupal installer as usual. Alternatively, you can use Drush as described bellow. +7. Edit the `sites/stuff/settings.php` file again and enable Redis by setting `$platformsh_enable_redis` to true. +8. Commit and push that change. + +Alternatively, a PHP shell script is provided that automates steps 1-4. See [`psh-subsite-add.php`](psh-subsite-add.php). + +
+ +
+Using Drush in multi-site
+ +In a Drupal multi-site setup, sites ID are defined in [web/sites/sites.php](https://github.com/platformsh-templates/drupal8-multisite/blob/master/web/sites/sites.php). By default in this multi-site template, 2 subsites are defined in [routes.yaml](https://github.com/platformsh-templates/drupal8-multisite/blob/master/.platform/routes.yaml): `first` and `second` + +Any Drush command can therefore be used on a specific subsite by using `--uri=`. For example: +* `drush status --uri=first` +* `drush status --uri=second` + +
+ + + + +### Blackfire.io: creating a Continuous Observability Strategy + +This template includes a starting [`.blackfire.yml`](.blackfire.yml) file that can be used to enable [Application Performance Monitoring](https://blackfire.io/docs/monitoring-cookbooks/index), [Profiling](https://blackfire.io/docs/profiling-cookbooks/index), [Builds](https://blackfire.io/docs/builds-cookbooks/index) and [Performance Testing](https://blackfire.io/docs/testing-cookbooks/index) on your project. Platform.sh comes with Blackfire pre-installed on application containers, and [setting up requires minimal configuration](https://docs.platform.sh/integrations/observability/blackfire.html). + +* [What is Blackfire?](https://blackfire.io/docs/introduction) +* [Configuring Blackfire.io on a Platform.sh project](https://docs.platform.sh/integrations/observability/blackfire.html) +* [Blackfire.io Platform.sh documentation](https://blackfire.io/docs/integrations/paas/platformsh) +* [Profiling Cookbooks](https://blackfire.io/docs/profiling-cookbooks/index) +* [Monitoring Cookbooks](https://blackfire.io/docs/monitoring-cookbooks/index) +* [Testing Cookbooks](https://blackfire.io/docs/testing-cookbooks/index) +* [Using Builds](https://blackfire.io/docs/builds-cookbooks/index) +* [Configuring Integrations](https://blackfire.io/docs/integrations/index) + + +### Resources + + +- [Drupal](https://www.drupal.org/) +- [Drupal 9 on Platform.sh](https://docs.platform.sh/guides/drupal9/deploy.html) +- [Platform.sh PHP documentation](https://docs.platform.sh/languages/php.html) +- [Multi-site best practices on Platform.sh](https://docs.platform.sh/bestpractices/oneormany.html) + + + +### Contact + +This template is maintained by the Platform.sh Developer Relations team, and they will be notified of all issues and pull requests you open here. + +- **Community:** Share your question with the community, or see if it's already been asked on our [Community site](https://community.platform.sh). +- **Slack:** If you haven't done so already, you can join Platform.sh's [public Slack](https://chat.platform.sh/) channels and ping the `@devrel_team` with any questions. + + +### About Platform.sh + +This template has been specifically designed to deploy on Platform.sh. + +
+What is Platform.sh?
+ +Platform.sh is a unified, secure, enterprise-grade platform for building, running and scaling web applications. We’re the leader in Fleet Ops: Everything you need to manage your fleet of websites and apps is available from the start. Because infrastructure and workflows are handled from the start, apps just work, so teams can focus on what really matters: making faster changes, collaborating confidently, and scaling responsibly. Whether managing a fleet of ten or ten thousand sites and apps, Platform.sh is the Developer- preferred solution that scales right. + +Our key features include: + +* **GitOps: Git as the source of truth** + + Every branch becomes a development environment, and nothing can change without a commit. + +* **Batteries included: Managed infrastructure** + + [Simple abstraction in YAML](https://docs.platform.sh/configuration/yaml.html) for [committing and configuring infrastructure](https://docs.platform.sh/overview/structure.html), fully managed patch updates, and 24 [runtimes](https://docs.platform.sh/languages.html) & [services](https://docs.platform.sh/configuration/services.html) that can be added with a single line of code. + +* **Instant cloning: Branch, merge, repeat** + + [Reusable builds](https://docs.platform.sh/overview/build-deploy.html) and automatically inherited production data provide true staging environments - experiment in isolation, test, then destroy or merge. + +* **FleetOps: Fleet management platform** + + Leverage our public API along with custom tools like [Source Operations](https://docs.platform.sh/configuration/app/source-operations.html) and [Activity Scripts](https://docs.platform.sh/integrations/activity.html) to [manage thousands of applications](https://youtu.be/MILHG9OqhmE) - their dependency updates, fresh content, and upstream code. + + +To find out more, check out the demo below and go to our [website](https://platform.sh/product/). + +
+

+The Platform.sh demo +

+ + +
+ + + +## Contributing + +

Help us keep top-notch templates!

+ +Every one of our templates is open source, and they're important resources for users trying to deploy to Platform.sh for the first time or better understand the platform. They act as getting started guides, but also contain a number of helpful tips and best practices when working with certain languages and frameworks. + +See something that's wrong with this template that needs to be fixed? Something in the documentation unclear or missing? Let us know! + +

+How to contribute +

+Report a bug       +Submit a feature request       +Open a pull request       +
+

+
+

+Need help? +

+Ask the Platform.sh Community       +Join us on Slack       +
+

+
+

Thanks to all of our amazing contributors!

+
+

+ + + +

+ +

+Made with contrib.rocks +

+ +
diff --git a/templates/drupal9-multisite/files/config/sync/first/.gitkeep b/templates/drupal9-multisite/files/config/sync/first/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/templates/drupal9-multisite/files/config/sync/main/.gitkeep b/templates/drupal9-multisite/files/config/sync/main/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/templates/drupal9-multisite/files/config/sync/second/.gitkeep b/templates/drupal9-multisite/files/config/sync/second/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/templates/drupal9-multisite/files/drush/platformsh_generate_drush_yml.php b/templates/drupal9-multisite/files/drush/platformsh_generate_drush_yml.php new file mode 100644 index 000000000..9dbb98c17 --- /dev/null +++ b/templates/drupal9-multisite/files/drush/platformsh_generate_drush_yml.php @@ -0,0 +1,80 @@ +inRuntime()) { + return; + } + + $routes = $platformsh->getUpstreamRoutes($platformsh->applicationName); + + // Sort URLs, with the primary route first, then by HTTPS before HTTP, then by length. + usort($routes, function (array $a, array $b) { + // false sorts before true, normally, so negate the comparison. + return + [!$a['primary'], strpos($a['url'], 'https://') !== 0, strlen($a['url'])] + <=> + [!$b['primary'], strpos($b['url'], 'https://') !== 0, strlen($b['url'])]; + }); + + // Return the url of the first one. + return reset($routes)['url'] ?: NULL; +} + +$appRoot = dirname(__DIR__); +$filename = $appRoot . '/.drush/drush.yml'; + +$siteUrl = _platformsh_drush_site_url(); + +if (empty($siteUrl)) { + echo "Failed to find a site URL\n"; + + if (file_exists($filename)) { + echo "The file exists but may be invalid: $filename\n"; + } + + exit(1); +} + +$siteUrlYamlEscaped = json_encode($siteUrl, JSON_UNESCAPED_SLASHES); +$scriptPath = __FILE__; + +$success = file_put_contents($filename, << + + + diff --git a/templates/drupal9-multisite/files/psh-subsite-add.php b/templates/drupal9-multisite/files/psh-subsite-add.php new file mode 100644 index 000000000..6e67f2c40 --- /dev/null +++ b/templates/drupal9-multisite/files/psh-subsite-add.php @@ -0,0 +1,115 @@ + $subsiteName, + 'privileges' => [$subsiteName => 'admin'] + ]; + + file_put_contents(SERVICES_FILE, Yaml::dump($yaml, 10, 4, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK)); +} + +function addRelationship(string $subsiteName) { + + $yaml = Yaml::parseFile(APP_FILE); + + $yaml['relationships'][$subsiteName] = "db:{$subsiteName}"; + + file_put_contents(APP_FILE, Yaml::dump($yaml, 10, 4, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK)); +} + + +main($argv); diff --git a/templates/drupal9-multisite/files/web/sites/default.services.yml b/templates/drupal9-multisite/files/web/sites/default.services.yml new file mode 100644 index 000000000..e1bbbc7e2 --- /dev/null +++ b/templates/drupal9-multisite/files/web/sites/default.services.yml @@ -0,0 +1,174 @@ +parameters: + session.storage.options: + # Default ini options for sessions. + # + # Some distributions of Linux (most notably Debian) ship their PHP + # installations with garbage collection (gc) disabled. Since Drupal depends + # on PHP's garbage collection for clearing sessions, ensure that garbage + # collection occurs by using the most common settings. + # @default 1 + gc_probability: 1 + # @default 100 + gc_divisor: 100 + # + # Set session lifetime (in seconds), i.e. the time from the user's last + # visit to the active session may be deleted by the session garbage + # collector. When a session is deleted, authenticated users are logged out, + # and the contents of the user's $_SESSION variable is discarded. + # @default 200000 + gc_maxlifetime: 200000 + # + # Set session cookie lifetime (in seconds), i.e. the time from the session + # is created to the cookie expires, i.e. when the browser is expected to + # discard the cookie. The value 0 means "until the browser is closed". + # @default 2000000 + cookie_lifetime: 2000000 + # + # Drupal automatically generates a unique session cookie name based on the + # full domain name used to access the site. This mechanism is sufficient + # for most use-cases, including multi-site deployments. However, if it is + # desired that a session can be reused across different subdomains, the + # cookie domain needs to be set to the shared base domain. Doing so assures + # that users remain logged in as they cross between various subdomains. + # To maximize compatibility and normalize the behavior across user agents, + # the cookie domain should start with a dot. + # + # @default none + # cookie_domain: '.example.com' + # + twig.config: + # Twig debugging: + # + # When debugging is enabled: + # - The markup of each Twig template is surrounded by HTML comments that + # contain theming information, such as template file name suggestions. + # - Note that this debugging markup will cause automated tests that directly + # check rendered HTML to fail. When running automated tests, 'debug' + # should be set to FALSE. + # - The dump() function can be used in Twig templates to output information + # about template variables. + # - Twig templates are automatically recompiled whenever the source code + # changes (see auto_reload below). + # + # For more information about debugging Twig templates, see + # https://www.drupal.org/node/1906392. + # + # Not recommended in production environments + # @default false + debug: false + # Twig auto-reload: + # + # Automatically recompile Twig templates whenever the source code changes. + # If you don't provide a value for auto_reload, it will be determined + # based on the value of debug. + # + # Not recommended in production environments + # @default null + auto_reload: null + # Twig cache: + # + # By default, Twig templates will be compiled and stored in the filesystem + # to increase performance. Disabling the Twig cache will recompile the + # templates from source each time they are used. In most cases the + # auto_reload setting above should be enabled rather than disabling the + # Twig cache. + # + # Not recommended in production environments + # @default true + cache: true + renderer.config: + # Renderer required cache contexts: + # + # The Renderer will automatically associate these cache contexts with every + # render array, hence varying every render array by these cache contexts. + # + # @default ['languages:language_interface', 'theme', 'user.permissions'] + required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions'] + # Renderer automatic placeholdering conditions: + # + # Drupal allows portions of the page to be automatically deferred when + # rendering to improve cache performance. That is especially helpful for + # cache contexts that vary widely, such as the active user. On some sites + # those may be different, however, such as sites with only a handful of + # users. If you know what the high-cardinality cache contexts are for your + # site, specify those here. If you're not sure, the defaults are fairly safe + # in general. + # + # For more information about rendering optimizations see + # https://www.drupal.org/developing/api/8/render/arrays/cacheability#optimizing + auto_placeholder_conditions: + # Max-age at or below which caching is not considered worthwhile. + # + # Disable by setting to -1. + # + # @default 0 + max-age: 0 + # Cache contexts with a high cardinality. + # + # Disable by setting to []. + # + # @default ['session', 'user'] + contexts: ['session', 'user'] + # Tags with a high invalidation frequency. + # + # Disable by setting to []. + # + # @default [] + tags: [] + # Cacheability debugging: + # + # Responses with cacheability metadata (CacheableResponseInterface instances) + # get X-Drupal-Cache-Tags and X-Drupal-Cache-Contexts headers. + # + # For more information about debugging cacheable responses, see + # https://www.drupal.org/developing/api/8/response/cacheable-response-interface + # + # Not recommended in production environments + # @default false + http.response.debug_cacheability_headers: false + factory.keyvalue: + {} + # Default key/value storage service to use. + # @default keyvalue.database + # default: keyvalue.database + # Collection-specific overrides. + # state: keyvalue.database + factory.keyvalue.expirable: + {} + # Default key/value expirable storage service to use. + # @default keyvalue.database.expirable + # default: keyvalue.database.expirable + # Allowed protocols for URL generation. + filter_protocols: + - http + - https + - ftp + - news + - nntp + - tel + - telnet + - mailto + - irc + - ssh + - sftp + - webcal + - rtsp + + # Configure Cross-Site HTTP requests (CORS). + # Read https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS + # for more information about the topic in general. + # Note: By default the configuration is disabled. + cors.config: + enabled: false + # Specify allowed headers, like 'x-allowed-header'. + allowedHeaders: [] + # Specify allowed request methods, specify ['*'] to allow all possible ones. + allowedMethods: [] + # Configure requests allowed from specific origins. + allowedOrigins: ['*'] + # Sets the Access-Control-Expose-Headers header. + exposedHeaders: false + # Sets the Access-Control-Max-Age header. + maxAge: false + # Sets the Access-Control-Allow-Credentials header. + supportsCredentials: false diff --git a/templates/drupal9-multisite/files/web/sites/default.settings.php b/templates/drupal9-multisite/files/web/sites/default.settings.php new file mode 100644 index 000000000..25d498e6f --- /dev/null +++ b/templates/drupal9-multisite/files/web/sites/default.settings.php @@ -0,0 +1,765 @@ + 'databasename', + * 'username' => 'sqlusername', + * 'password' => 'sqlpassword', + * 'host' => 'localhost', + * 'port' => '3306', + * 'driver' => 'mysql', + * 'prefix' => '', + * 'collation' => 'utf8mb4_general_ci', + * ); + * @endcode + */ + $databases = array(); + +/** + * Customizing database settings. + * + * Many of the values of the $databases array can be customized for your + * particular database system. Refer to the sample in the section above as a + * starting point. + * + * The "driver" property indicates what Drupal database driver the + * connection should use. This is usually the same as the name of the + * database type, such as mysql or sqlite, but not always. The other + * properties will vary depending on the driver. For SQLite, you must + * specify a database file name in a directory that is writable by the + * webserver. For most other drivers, you must specify a + * username, password, host, and database name. + * + * Transaction support is enabled by default for all drivers that support it, + * including MySQL. To explicitly disable it, set the 'transactions' key to + * FALSE. + * Note that some configurations of MySQL, such as the MyISAM engine, don't + * support it and will proceed silently even if enabled. If you experience + * transaction related crashes with such configuration, set the 'transactions' + * key to FALSE. + * + * For each database, you may optionally specify multiple "target" databases. + * A target database allows Drupal to try to send certain queries to a + * different database if it can but fall back to the default connection if not. + * That is useful for primary/replica replication, as Drupal may try to connect + * to a replica server when appropriate and if one is not available will simply + * fall back to the single primary server (The terms primary/replica are + * traditionally referred to as master/slave in database server documentation). + * + * The general format for the $databases array is as follows: + * @code + * $databases['default']['default'] = $info_array; + * $databases['default']['replica'][] = $info_array; + * $databases['default']['replica'][] = $info_array; + * $databases['extra']['default'] = $info_array; + * @endcode + * + * In the above example, $info_array is an array of settings described above. + * The first line sets a "default" database that has one primary database + * (the second level default). The second and third lines create an array + * of potential replica databases. Drupal will select one at random for a given + * request as needed. The fourth line creates a new database with a name of + * "extra". + * + * You can optionally set prefixes for some or all database table names + * by using the 'prefix' setting. If a prefix is specified, the table + * name will be prepended with its value. Be sure to use valid database + * characters only, usually alphanumeric and underscore. If no prefixes + * are desired, leave it as an empty string ''. + * + * To have all database names prefixed, set 'prefix' as a string: + * @code + * 'prefix' => 'main_', + * @endcode + * + * Per-table prefixes are deprecated as of Drupal 8.2, and will be removed in + * Drupal 9.0. After that, only a single prefix for all tables will be + * supported. + * + * To provide prefixes for specific tables, set 'prefix' as an array. + * The array's keys are the table names and the values are the prefixes. + * The 'default' element is mandatory and holds the prefix for any tables + * not specified elsewhere in the array. Example: + * @code + * 'prefix' => array( + * 'default' => 'main_', + * 'users' => 'shared_', + * 'sessions' => 'shared_', + * 'role' => 'shared_', + * 'authmap' => 'shared_', + * ), + * @endcode + * You can also use a reference to a schema/database as a prefix. This may be + * useful if your Drupal installation exists in a schema that is not the default + * or you want to access several databases from the same code base at the same + * time. + * Example: + * @code + * 'prefix' => array( + * 'default' => 'main.', + * 'users' => 'shared.', + * 'sessions' => 'shared.', + * 'role' => 'shared.', + * 'authmap' => 'shared.', + * ); + * @endcode + * NOTE: MySQL and SQLite's definition of a schema is a database. + * + * Advanced users can add or override initial commands to execute when + * connecting to the database server, as well as PDO connection settings. For + * example, to enable MySQL SELECT queries to exceed the max_join_size system + * variable, and to reduce the database connection timeout to 5 seconds: + * @code + * $databases['default']['default'] = array( + * 'init_commands' => array( + * 'big_selects' => 'SET SQL_BIG_SELECTS=1', + * ), + * 'pdo' => array( + * PDO::ATTR_TIMEOUT => 5, + * ), + * ); + * @endcode + * + * WARNING: The above defaults are designed for database portability. Changing + * them may cause unexpected behavior, including potential data loss. See + * https://www.drupal.org/developing/api/database/configuration for more + * information on these defaults and the potential issues. + * + * More details can be found in the constructor methods for each driver: + * - \Drupal\Core\Database\Driver\mysql\Connection::__construct() + * - \Drupal\Core\Database\Driver\pgsql\Connection::__construct() + * - \Drupal\Core\Database\Driver\sqlite\Connection::__construct() + * + * Sample Database configuration format for PostgreSQL (pgsql): + * @code + * $databases['default']['default'] = array( + * 'driver' => 'pgsql', + * 'database' => 'databasename', + * 'username' => 'sqlusername', + * 'password' => 'sqlpassword', + * 'host' => 'localhost', + * 'prefix' => '', + * ); + * @endcode + * + * Sample Database configuration format for SQLite (sqlite): + * @code + * $databases['default']['default'] = array( + * 'driver' => 'sqlite', + * 'database' => '/path/to/databasefilename', + * ); + * @endcode + */ + +/** + * Location of the site configuration files. + * + * The $config_directories array specifies the location of file system + * directories used for configuration data. On install, the "sync" directory is + * created. This is used for configuration imports. The "active" directory is + * not created by default since the default storage for active configuration is + * the database rather than the file system. (This can be changed. See "Active + * configuration settings" below). + * + * The default location for the "sync" directory is inside a randomly-named + * directory in the public files path. The setting below allows you to override + * the "sync" location. + * + * If you use files for the "active" configuration, you can tell the + * Configuration system where this directory is located by adding an entry with + * array key CONFIG_ACTIVE_DIRECTORY. + * + * Example: + * @code + * $config_directories = array( + * CONFIG_SYNC_DIRECTORY => '/directory/outside/webroot', + * ); + * @endcode + */ +$config_directories = array(); + +/** + * Settings: + * + * $settings contains environment-specific configuration, such as the files + * directory and reverse proxy address, and temporary configuration, such as + * security overrides. + * + * @see \Drupal\Core\Site\Settings::get() + */ + +/** + * The active installation profile. + * + * Changing this after installation is not recommended as it changes which + * directories are scanned during extension discovery. If this is set prior to + * installation this value will be rewritten according to the profile selected + * by the user. + * + * @see install_select_profile() + * + * @deprecated in Drupal 8.3.0 and will be removed before Drupal 9.0.0. The + * install profile is written to the core.extension configuration. If a + * service requires the install profile use the 'install_profile' container + * parameter. Functional code can use \Drupal::installProfile(). + */ +# $settings['install_profile'] = ''; + +/** + * Salt for one-time login links, cancel links, form tokens, etc. + * + * This variable will be set to a random value by the installer. All one-time + * login links will be invalidated if the value is changed. Note that if your + * site is deployed on a cluster of web servers, you must ensure that this + * variable has the same value on each server. + * + * For enhanced security, you may set this variable to the contents of a file + * outside your document root; you should also ensure that this file is not + * stored with backups of your database. + * + * Example: + * @code + * $settings['hash_salt'] = file_get_contents('/home/example/salt.txt'); + * @endcode + */ +$settings['hash_salt'] = ''; + +/** + * Deployment identifier. + * + * Drupal's dependency injection container will be automatically invalidated and + * rebuilt when the Drupal core version changes. When updating contributed or + * custom code that changes the container, changing this identifier will also + * allow the container to be invalidated as soon as code is deployed. + */ +# $settings['deployment_identifier'] = \Drupal::VERSION; + +/** + * Access control for update.php script. + * + * If you are updating your Drupal installation using the update.php script but + * are not logged in using either an account with the "Administer software + * updates" permission or the site maintenance account (the account that was + * created during installation), you will need to modify the access check + * statement below. Change the FALSE to a TRUE to disable the access check. + * After finishing the upgrade, be sure to open this file again and change the + * TRUE back to a FALSE! + */ +$settings['update_free_access'] = FALSE; + +/** + * External access proxy settings: + * + * If your site must access the Internet via a web proxy then you can enter the + * proxy settings here. Set the full URL of the proxy, including the port, in + * variables: + * - $settings['http_client_config']['proxy']['http']: The proxy URL for HTTP + * requests. + * - $settings['http_client_config']['proxy']['https']: The proxy URL for HTTPS + * requests. + * You can pass in the user name and password for basic authentication in the + * URLs in these settings. + * + * You can also define an array of host names that can be accessed directly, + * bypassing the proxy, in $settings['http_client_config']['proxy']['no']. + */ +# $settings['http_client_config']['proxy']['http'] = 'http://proxy_user:proxy_pass@example.com:8080'; +# $settings['http_client_config']['proxy']['https'] = 'http://proxy_user:proxy_pass@example.com:8080'; +# $settings['http_client_config']['proxy']['no'] = ['127.0.0.1', 'localhost']; + +/** + * Reverse Proxy Configuration: + * + * Reverse proxy servers are often used to enhance the performance + * of heavily visited sites and may also provide other site caching, + * security, or encryption benefits. In an environment where Drupal + * is behind a reverse proxy, the real IP address of the client should + * be determined such that the correct client IP address is available + * to Drupal's logging, statistics, and access management systems. In + * the most simple scenario, the proxy server will add an + * X-Forwarded-For header to the request that contains the client IP + * address. However, HTTP headers are vulnerable to spoofing, where a + * malicious client could bypass restrictions by setting the + * X-Forwarded-For header directly. Therefore, Drupal's proxy + * configuration requires the IP addresses of all remote proxies to be + * specified in $settings['reverse_proxy_addresses'] to work correctly. + * + * Enable this setting to get Drupal to determine the client IP from + * the X-Forwarded-For header (or $settings['reverse_proxy_header'] if set). + * If you are unsure about this setting, do not have a reverse proxy, + * or Drupal operates in a shared hosting environment, this setting + * should remain commented out. + * + * In order for this setting to be used you must specify every possible + * reverse proxy IP address in $settings['reverse_proxy_addresses']. + * If a complete list of reverse proxies is not available in your + * environment (for example, if you use a CDN) you may set the + * $_SERVER['REMOTE_ADDR'] variable directly in settings.php. + * Be aware, however, that it is likely that this would allow IP + * address spoofing unless more advanced precautions are taken. + */ +# $settings['reverse_proxy'] = TRUE; + +/** + * Specify every reverse proxy IP address in your environment. + * This setting is required if $settings['reverse_proxy'] is TRUE. + */ +# $settings['reverse_proxy_addresses'] = array('a.b.c.d', ...); + +/** + * Set this value if your proxy server sends the client IP in a header + * other than X-Forwarded-For. + */ +# $settings['reverse_proxy_header'] = 'X_CLUSTER_CLIENT_IP'; + +/** + * Set this value if your proxy server sends the client protocol in a header + * other than X-Forwarded-Proto. + */ +# $settings['reverse_proxy_proto_header'] = 'X_FORWARDED_PROTO'; + +/** + * Set this value if your proxy server sends the client protocol in a header + * other than X-Forwarded-Host. + */ +# $settings['reverse_proxy_host_header'] = 'X_FORWARDED_HOST'; + +/** + * Set this value if your proxy server sends the client protocol in a header + * other than X-Forwarded-Port. + */ +# $settings['reverse_proxy_port_header'] = 'X_FORWARDED_PORT'; + +/** + * Set this value if your proxy server sends the client protocol in a header + * other than Forwarded. + */ +# $settings['reverse_proxy_forwarded_header'] = 'FORWARDED'; + +/** + * Page caching: + * + * By default, Drupal sends a "Vary: Cookie" HTTP header for anonymous page + * views. This tells a HTTP proxy that it may return a page from its local + * cache without contacting the web server, if the user sends the same Cookie + * header as the user who originally requested the cached page. Without "Vary: + * Cookie", authenticated users would also be served the anonymous page from + * the cache. If the site has mostly anonymous users except a few known + * editors/administrators, the Vary header can be omitted. This allows for + * better caching in HTTP proxies (including reverse proxies), i.e. even if + * clients send different cookies, they still get content served from the cache. + * However, authenticated users should access the site directly (i.e. not use an + * HTTP proxy, and bypass the reverse proxy if one is used) in order to avoid + * getting cached pages from the proxy. + */ +# $settings['omit_vary_cookie'] = TRUE; + + +/** + * Cache TTL for client error (4xx) responses. + * + * Items cached per-URL tend to result in a large number of cache items, and + * this can be problematic on 404 pages which by their nature are unbounded. A + * fixed TTL can be set for these items, defaulting to one hour, so that cache + * backends which do not support LRU can purge older entries. To disable caching + * of client error responses set the value to 0. Currently applies only to + * page_cache module. + */ +# $settings['cache_ttl_4xx'] = 3600; + + +/** + * Class Loader. + * + * If the APC extension is detected, the Symfony APC class loader is used for + * performance reasons. Detection can be prevented by setting + * class_loader_auto_detect to false, as in the example below. + */ +# $settings['class_loader_auto_detect'] = FALSE; + +/* + * If the APC extension is not detected, either because APC is missing or + * because auto-detection has been disabled, auto-loading falls back to + * Composer's ClassLoader, which is good for development as it does not break + * when code is moved in the file system. You can also decorate the base class + * loader with another cached solution than the Symfony APC class loader, as + * all production sites should have a cached class loader of some sort enabled. + * + * To do so, you may decorate and replace the local $class_loader variable. For + * example, to use Symfony's APC class loader without automatic detection, + * uncomment the code below. + */ +/* +if ($settings['hash_salt']) { + $prefix = 'drupal.' . hash('sha256', 'drupal.' . $settings['hash_salt']); + $apc_loader = new \Symfony\Component\ClassLoader\ApcClassLoader($prefix, $class_loader); + unset($prefix); + $class_loader->unregister(); + $apc_loader->register(); + $class_loader = $apc_loader; +} +*/ + +/** + * Authorized file system operations: + * + * The Update Manager module included with Drupal provides a mechanism for + * site administrators to securely install missing updates for the site + * directly through the web user interface. On securely-configured servers, + * the Update manager will require the administrator to provide SSH or FTP + * credentials before allowing the installation to proceed; this allows the + * site to update the new files as the user who owns all the Drupal files, + * instead of as the user the webserver is running as. On servers where the + * webserver user is itself the owner of the Drupal files, the administrator + * will not be prompted for SSH or FTP credentials (note that these server + * setups are common on shared hosting, but are inherently insecure). + * + * Some sites might wish to disable the above functionality, and only update + * the code directly via SSH or FTP themselves. This setting completely + * disables all functionality related to these authorized file operations. + * + * @see https://www.drupal.org/node/244924 + * + * Remove the leading hash signs to disable. + */ +# $settings['allow_authorize_operations'] = FALSE; + +/** + * Default mode for directories and files written by Drupal. + * + * Value should be in PHP Octal Notation, with leading zero. + */ +# $settings['file_chmod_directory'] = 0775; +# $settings['file_chmod_file'] = 0664; + +/** + * Public file base URL: + * + * An alternative base URL to be used for serving public files. This must + * include any leading directory path. + * + * A different value from the domain used by Drupal to be used for accessing + * public files. This can be used for a simple CDN integration, or to improve + * security by serving user-uploaded files from a different domain or subdomain + * pointing to the same server. Do not include a trailing slash. + */ +# $settings['file_public_base_url'] = 'http://downloads.example.com/files'; + +/** + * Public file path: + * + * A local file system path where public files will be stored. This directory + * must exist and be writable by Drupal. This directory must be relative to + * the Drupal installation directory and be accessible over the web. + */ +# $settings['file_public_path'] = 'sites/default/files'; + +/** + * Private file path: + * + * A local file system path where private files will be stored. This directory + * must be absolute, outside of the Drupal installation directory and not + * accessible over the web. + * + * Note: Caches need to be cleared when this value is changed to make the + * private:// stream wrapper available to the system. + * + * See https://www.drupal.org/documentation/modules/file for more information + * about securing private files. + */ +# $settings['file_private_path'] = ''; + +/** + * Session write interval: + * + * Set the minimum interval between each session write to database. + * For performance reasons it defaults to 180. + */ +# $settings['session_write_interval'] = 180; + +/** + * String overrides: + * + * To override specific strings on your site with or without enabling the Locale + * module, add an entry to this list. This functionality allows you to change + * a small number of your site's default English language interface strings. + * + * Remove the leading hash signs to enable. + * + * The "en" part of the variable name, is dynamic and can be any langcode of + * any added language. (eg locale_custom_strings_de for german). + */ +# $settings['locale_custom_strings_en'][''] = array( +# 'forum' => 'Discussion board', +# '@count min' => '@count minutes', +# ); + +/** + * A custom theme for the offline page: + * + * This applies when the site is explicitly set to maintenance mode through the + * administration page or when the database is inactive due to an error. + * The template file should also be copied into the theme. It is located inside + * 'core/modules/system/templates/maintenance-page.html.twig'. + * + * Note: This setting does not apply to installation and update pages. + */ +# $settings['maintenance_theme'] = 'bartik'; + +/** + * PHP settings: + * + * To see what PHP settings are possible, including whether they can be set at + * runtime (by using ini_set()), read the PHP documentation: + * http://php.net/manual/ini.list.php + * See \Drupal\Core\DrupalKernel::bootEnvironment() for required runtime + * settings and the .htaccess file for non-runtime settings. + * Settings defined there should not be duplicated here so as to avoid conflict + * issues. + */ + +/** + * If you encounter a situation where users post a large amount of text, and + * the result is stripped out upon viewing but can still be edited, Drupal's + * output filter may not have sufficient memory to process it. If you + * experience this issue, you may wish to uncomment the following two lines + * and increase the limits of these variables. For more information, see + * http://php.net/manual/pcre.configuration.php. + */ +# ini_set('pcre.backtrack_limit', 200000); +# ini_set('pcre.recursion_limit', 200000); + +/** + * Active configuration settings. + * + * By default, the active configuration is stored in the database in the + * {config} table. To use a different storage mechanism for the active + * configuration, do the following prior to installing: + * - Create an "active" directory and declare its path in $config_directories + * as explained under the 'Location of the site configuration files' section + * above in this file. To enhance security, you can declare a path that is + * outside your document root. + * - Override the 'bootstrap_config_storage' setting here. It must be set to a + * callable that returns an object that implements + * \Drupal\Core\Config\StorageInterface. + * - Override the service definition 'config.storage.active'. Put this + * override in a services.yml file in the same directory as settings.php + * (definitions in this file will override service definition defaults). + */ +# $settings['bootstrap_config_storage'] = array('Drupal\Core\Config\BootstrapConfigStorageFactory', 'getFileStorage'); + +/** + * Configuration overrides. + * + * To globally override specific configuration values for this site, + * set them here. You usually don't need to use this feature. This is + * useful in a configuration file for a vhost or directory, rather than + * the default settings.php. + * + * Note that any values you provide in these variable overrides will not be + * viewable from the Drupal administration interface. The administration + * interface displays the values stored in configuration so that you can stage + * changes to other environments that don't have the overrides. + * + * There are particular configuration values that are risky to override. For + * example, overriding the list of installed modules in 'core.extension' is not + * supported as module install or uninstall has not occurred. Other examples + * include field storage configuration, because it has effects on database + * structure, and 'core.menu.static_menu_link_overrides' since this is cached in + * a way that is not config override aware. Also, note that changing + * configuration values in settings.php will not fire any of the configuration + * change events. + */ +# $config['system.site']['name'] = 'My Drupal site'; +# $config['system.theme']['default'] = 'stark'; +# $config['user.settings']['anonymous'] = 'Visitor'; + +/** + * Fast 404 pages: + * + * Drupal can generate fully themed 404 pages. However, some of these responses + * are for images or other resource files that are not displayed to the user. + * This can waste bandwidth, and also generate server load. + * + * The options below return a simple, fast 404 page for URLs matching a + * specific pattern: + * - $config['system.performance']['fast_404']['exclude_paths']: A regular + * expression to match paths to exclude, such as images generated by image + * styles, or dynamically-resized images. The default pattern provided below + * also excludes the private file system. If you need to add more paths, you + * can add '|path' to the expression. + * - $config['system.performance']['fast_404']['paths']: A regular expression to + * match paths that should return a simple 404 page, rather than the fully + * themed 404 page. If you don't have any aliases ending in htm or html you + * can add '|s?html?' to the expression. + * - $config['system.performance']['fast_404']['html']: The html to return for + * simple 404 pages. + * + * Remove the leading hash signs if you would like to alter this functionality. + */ +# $config['system.performance']['fast_404']['exclude_paths'] = '/\/(?:styles)|(?:system\/files)\//'; +# $config['system.performance']['fast_404']['paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +# $config['system.performance']['fast_404']['html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + +/** + * Load services definition file. + */ +$settings['container_yamls'][] = $app_root . '/' . $site_path . '/services.yml'; + +/** + * Override the default service container class. + * + * This is useful for example to trace the service container for performance + * tracking purposes, for testing a service container with an error condition or + * to test a service container that throws an exception. + */ +# $settings['container_base_class'] = '\Drupal\Core\DependencyInjection\Container'; + +/** + * Override the default yaml parser class. + * + * Provide a fully qualified class name here if you would like to provide an + * alternate implementation YAML parser. The class must implement the + * \Drupal\Component\Serialization\SerializationInterface interface. + */ +# $settings['yaml_parser_class'] = NULL; + +/** + * Trusted host configuration. + * + * Drupal core can use the Symfony trusted host mechanism to prevent HTTP Host + * header spoofing. + * + * To enable the trusted host mechanism, you enable your allowable hosts + * in $settings['trusted_host_patterns']. This should be an array of regular + * expression patterns, without delimiters, representing the hosts you would + * like to allow. + * + * For example: + * @code + * $settings['trusted_host_patterns'] = array( + * '^www\.example\.com$', + * ); + * @endcode + * will allow the site to only run from www.example.com. + * + * If you are running multisite, or if you are running your site from + * different domain names (eg, you don't redirect http://www.example.com to + * http://example.com), you should specify all of the host patterns that are + * allowed by your site. + * + * For example: + * @code + * $settings['trusted_host_patterns'] = array( + * '^example\.com$', + * '^.+\.example\.com$', + * '^example\.org$', + * '^.+\.example\.org$', + * ); + * @endcode + * will allow the site to run off of all variants of example.com and + * example.org, with all subdomains included. + */ + +/** + * The default list of directories that will be ignored by Drupal's file API. + * + * By default ignore node_modules and bower_components folders to avoid issues + * with common frontend tools and recursive scanning of directories looking for + * extensions. + * + * @see file_scan_directory() + * @see \Drupal\Core\Extension\ExtensionDiscovery::scanDirectory() + */ +$settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', +]; + +/** + * Load local development override configuration, if available. + * + * Use settings.local.php to override variables on secondary (staging, + * development, etc) installations of this site. Typically used to disable + * caching, JavaScript/CSS compression, re-routing of outgoing emails, and + * other things that should not happen on development and testing sites. + * + * Keep this code block at the end of this file to take full effect. + */ +# +# if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) { +# include $app_root . '/' . $site_path . '/settings.local.php'; +# } diff --git a/templates/drupal9-multisite/files/web/sites/default/drushrc.php b/templates/drupal9-multisite/files/web/sites/default/drushrc.php new file mode 100644 index 000000000..873128564 --- /dev/null +++ b/templates/drupal9-multisite/files/web/sites/default/drushrc.php @@ -0,0 +1,22 @@ + $route) { + if ($route['type'] === 'upstream' + && $route['upstream'] === $_ENV['PLATFORM_APPLICATION_NAME'] + && in_array($route['original_url'], $expected_route_urls)) { + $options['uri'] = $url; + break; + } + } +} diff --git a/templates/drupal9-multisite/files/web/sites/default/services.yml b/templates/drupal9-multisite/files/web/sites/default/services.yml new file mode 100644 index 000000000..23f6483cc --- /dev/null +++ b/templates/drupal9-multisite/files/web/sites/default/services.yml @@ -0,0 +1,155 @@ +parameters: + session.storage.options: + # Default ini options for sessions. + # + # Some distributions of Linux (most notably Debian) ship their PHP + # installations with garbage collection (gc) disabled. Since Drupal depends + # on PHP's garbage collection for clearing sessions, ensure that garbage + # collection occurs by using the most common settings. + # @default 1 + gc_probability: 1 + # @default 100 + gc_divisor: 100 + # + # Set session lifetime (in seconds), i.e. the time from the user's last + # visit to the active session may be deleted by the session garbage + # collector. When a session is deleted, authenticated users are logged out, + # and the contents of the user's $_SESSION variable is discarded. + # @default 200000 + gc_maxlifetime: 200000 + # + # Set session cookie lifetime (in seconds), i.e. the time from the session + # is created to the cookie expires, i.e. when the browser is expected to + # discard the cookie. The value 0 means "until the browser is closed". + # @default 2000000 + cookie_lifetime: 2000000 + # + # Drupal automatically generates a unique session cookie name based on the + # full domain name used to access the site. This mechanism is sufficient + # for most use-cases, including multi-site deployments. However, if it is + # desired that a session can be reused across different subdomains, the + # cookie domain needs to be set to the shared base domain. Doing so assures + # that users remain logged in as they cross between various subdomains. + # To maximize compatibility and normalize the behavior across user agents, + # the cookie domain should start with a dot. + # + # @default none + # cookie_domain: '.example.com' + # + twig.config: + # Twig debugging: + # + # When debugging is enabled: + # - The markup of each Twig template is surrounded by HTML comments that + # contain theming information, such as template file name suggestions. + # - Note that this debugging markup will cause automated tests that directly + # check rendered HTML to fail. When running automated tests, 'debug' + # should be set to FALSE. + # - The dump() function can be used in Twig templates to output information + # about template variables. + # - Twig templates are automatically recompiled whenever the source code + # changes (see auto_reload below). + # + # For more information about debugging Twig templates, see + # https://www.drupal.org/node/1906392. + # + # Not recommended in production environments + # @default false + debug: false + # Twig auto-reload: + # + # Automatically recompile Twig templates whenever the source code changes. + # If you don't provide a value for auto_reload, it will be determined + # based on the value of debug. + # + # Not recommended in production environments + # @default null + auto_reload: null + # Twig cache: + # + # By default, Twig templates will be compiled and stored in the filesystem + # to increase performance. Disabling the Twig cache will recompile the + # templates from source each time they are used. In most cases the + # auto_reload setting above should be enabled rather than disabling the + # Twig cache. + # + # Not recommended in production environments + # @default true + cache: true + renderer.config: + # Renderer required cache contexts: + # + # The Renderer will automatically associate these cache contexts with every + # render array, hence varying every render array by these cache contexts. + # + # @default ['languages:language_interface', 'theme', 'user.permissions'] + required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions'] + # Renderer automatic placeholdering conditions: + # + # Drupal allows portions of the page to be automatically deferred when + # rendering to improve cache performance. That is especially helpful for + # cache contexts that vary widely, such as the active user. On some sites + # those may be different, however, such as sites with only a handful of + # users. If you know what the high-cardinality cache contexts are for your + # site, specify those here. If you're not sure, the defaults are fairly safe + # in general. + # + # For more information about rendering optimizations see + # https://www.drupal.org/developing/api/8/render/arrays/cacheability#optimizing + auto_placeholder_conditions: + # Max-age at or below which caching is not considered worthwhile. + # + # Disable by setting to -1. + # + # @default 0 + max-age: 0 + # Cache contexts with a high cardinality. + # + # Disable by setting to []. + # + # @default ['session', 'user'] + contexts: ['session', 'user'] + # Tags with a high invalidation frequency. + # + # Disable by setting to []. + # + # @default [] + tags: [] + # Cacheability debugging: + # + # Responses with cacheability metadata (CacheableResponseInterface instances) + # get X-Drupal-Cache-Tags and X-Drupal-Cache-Contexts headers. + # + # For more information about debugging cacheable responses, see + # https://www.drupal.org/developing/api/8/response/cacheable-response-interface + # + # Not recommended in production environments + # @default false + http.response.debug_cacheability_headers: false + factory.keyvalue: + {} + # Default key/value storage service to use. + # @default keyvalue.database + # default: keyvalue.database + # Collection-specific overrides. + # state: keyvalue.database + factory.keyvalue.expirable: + {} + # Default key/value expirable storage service to use. + # @default keyvalue.database.expirable + # default: keyvalue.database.expirable + # Allowed protocols for URL generation. + filter_protocols: + - http + - https + - ftp + - news + - nntp + - tel + - telnet + - mailto + - irc + - ssh + - sftp + - webcal + - rtsp diff --git a/templates/drupal9-multisite/files/web/sites/default/settings.php b/templates/drupal9-multisite/files/web/sites/default/settings.php new file mode 100644 index 000000000..c81c78583 --- /dev/null +++ b/templates/drupal9-multisite/files/web/sites/default/settings.php @@ -0,0 +1,44 @@ + $route) { + if ($route['type'] === 'upstream' + && $route['upstream'] === $_ENV['PLATFORM_APPLICATION_NAME'] + && in_array($route['original_url'], $expected_route_urls)) { + $options['uri'] = $url; + break; + } + } +} diff --git a/templates/drupal9-multisite/files/web/sites/first/services.yml b/templates/drupal9-multisite/files/web/sites/first/services.yml new file mode 100644 index 000000000..23f6483cc --- /dev/null +++ b/templates/drupal9-multisite/files/web/sites/first/services.yml @@ -0,0 +1,155 @@ +parameters: + session.storage.options: + # Default ini options for sessions. + # + # Some distributions of Linux (most notably Debian) ship their PHP + # installations with garbage collection (gc) disabled. Since Drupal depends + # on PHP's garbage collection for clearing sessions, ensure that garbage + # collection occurs by using the most common settings. + # @default 1 + gc_probability: 1 + # @default 100 + gc_divisor: 100 + # + # Set session lifetime (in seconds), i.e. the time from the user's last + # visit to the active session may be deleted by the session garbage + # collector. When a session is deleted, authenticated users are logged out, + # and the contents of the user's $_SESSION variable is discarded. + # @default 200000 + gc_maxlifetime: 200000 + # + # Set session cookie lifetime (in seconds), i.e. the time from the session + # is created to the cookie expires, i.e. when the browser is expected to + # discard the cookie. The value 0 means "until the browser is closed". + # @default 2000000 + cookie_lifetime: 2000000 + # + # Drupal automatically generates a unique session cookie name based on the + # full domain name used to access the site. This mechanism is sufficient + # for most use-cases, including multi-site deployments. However, if it is + # desired that a session can be reused across different subdomains, the + # cookie domain needs to be set to the shared base domain. Doing so assures + # that users remain logged in as they cross between various subdomains. + # To maximize compatibility and normalize the behavior across user agents, + # the cookie domain should start with a dot. + # + # @default none + # cookie_domain: '.example.com' + # + twig.config: + # Twig debugging: + # + # When debugging is enabled: + # - The markup of each Twig template is surrounded by HTML comments that + # contain theming information, such as template file name suggestions. + # - Note that this debugging markup will cause automated tests that directly + # check rendered HTML to fail. When running automated tests, 'debug' + # should be set to FALSE. + # - The dump() function can be used in Twig templates to output information + # about template variables. + # - Twig templates are automatically recompiled whenever the source code + # changes (see auto_reload below). + # + # For more information about debugging Twig templates, see + # https://www.drupal.org/node/1906392. + # + # Not recommended in production environments + # @default false + debug: false + # Twig auto-reload: + # + # Automatically recompile Twig templates whenever the source code changes. + # If you don't provide a value for auto_reload, it will be determined + # based on the value of debug. + # + # Not recommended in production environments + # @default null + auto_reload: null + # Twig cache: + # + # By default, Twig templates will be compiled and stored in the filesystem + # to increase performance. Disabling the Twig cache will recompile the + # templates from source each time they are used. In most cases the + # auto_reload setting above should be enabled rather than disabling the + # Twig cache. + # + # Not recommended in production environments + # @default true + cache: true + renderer.config: + # Renderer required cache contexts: + # + # The Renderer will automatically associate these cache contexts with every + # render array, hence varying every render array by these cache contexts. + # + # @default ['languages:language_interface', 'theme', 'user.permissions'] + required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions'] + # Renderer automatic placeholdering conditions: + # + # Drupal allows portions of the page to be automatically deferred when + # rendering to improve cache performance. That is especially helpful for + # cache contexts that vary widely, such as the active user. On some sites + # those may be different, however, such as sites with only a handful of + # users. If you know what the high-cardinality cache contexts are for your + # site, specify those here. If you're not sure, the defaults are fairly safe + # in general. + # + # For more information about rendering optimizations see + # https://www.drupal.org/developing/api/8/render/arrays/cacheability#optimizing + auto_placeholder_conditions: + # Max-age at or below which caching is not considered worthwhile. + # + # Disable by setting to -1. + # + # @default 0 + max-age: 0 + # Cache contexts with a high cardinality. + # + # Disable by setting to []. + # + # @default ['session', 'user'] + contexts: ['session', 'user'] + # Tags with a high invalidation frequency. + # + # Disable by setting to []. + # + # @default [] + tags: [] + # Cacheability debugging: + # + # Responses with cacheability metadata (CacheableResponseInterface instances) + # get X-Drupal-Cache-Tags and X-Drupal-Cache-Contexts headers. + # + # For more information about debugging cacheable responses, see + # https://www.drupal.org/developing/api/8/response/cacheable-response-interface + # + # Not recommended in production environments + # @default false + http.response.debug_cacheability_headers: false + factory.keyvalue: + {} + # Default key/value storage service to use. + # @default keyvalue.database + # default: keyvalue.database + # Collection-specific overrides. + # state: keyvalue.database + factory.keyvalue.expirable: + {} + # Default key/value expirable storage service to use. + # @default keyvalue.database.expirable + # default: keyvalue.database.expirable + # Allowed protocols for URL generation. + filter_protocols: + - http + - https + - ftp + - news + - nntp + - tel + - telnet + - mailto + - irc + - ssh + - sftp + - webcal + - rtsp diff --git a/templates/drupal9-multisite/files/web/sites/first/settings.php b/templates/drupal9-multisite/files/web/sites/first/settings.php new file mode 100644 index 000000000..c81c78583 --- /dev/null +++ b/templates/drupal9-multisite/files/web/sites/first/settings.php @@ -0,0 +1,44 @@ + $route) { + if ($route['type'] === 'upstream' + && $route['upstream'] === $_ENV['PLATFORM_APPLICATION_NAME'] + && in_array($route['original_url'], $expected_route_urls)) { + $options['uri'] = $url; + break; + } + } +} diff --git a/templates/drupal9-multisite/files/web/sites/main/services.yml b/templates/drupal9-multisite/files/web/sites/main/services.yml new file mode 100644 index 000000000..23f6483cc --- /dev/null +++ b/templates/drupal9-multisite/files/web/sites/main/services.yml @@ -0,0 +1,155 @@ +parameters: + session.storage.options: + # Default ini options for sessions. + # + # Some distributions of Linux (most notably Debian) ship their PHP + # installations with garbage collection (gc) disabled. Since Drupal depends + # on PHP's garbage collection for clearing sessions, ensure that garbage + # collection occurs by using the most common settings. + # @default 1 + gc_probability: 1 + # @default 100 + gc_divisor: 100 + # + # Set session lifetime (in seconds), i.e. the time from the user's last + # visit to the active session may be deleted by the session garbage + # collector. When a session is deleted, authenticated users are logged out, + # and the contents of the user's $_SESSION variable is discarded. + # @default 200000 + gc_maxlifetime: 200000 + # + # Set session cookie lifetime (in seconds), i.e. the time from the session + # is created to the cookie expires, i.e. when the browser is expected to + # discard the cookie. The value 0 means "until the browser is closed". + # @default 2000000 + cookie_lifetime: 2000000 + # + # Drupal automatically generates a unique session cookie name based on the + # full domain name used to access the site. This mechanism is sufficient + # for most use-cases, including multi-site deployments. However, if it is + # desired that a session can be reused across different subdomains, the + # cookie domain needs to be set to the shared base domain. Doing so assures + # that users remain logged in as they cross between various subdomains. + # To maximize compatibility and normalize the behavior across user agents, + # the cookie domain should start with a dot. + # + # @default none + # cookie_domain: '.example.com' + # + twig.config: + # Twig debugging: + # + # When debugging is enabled: + # - The markup of each Twig template is surrounded by HTML comments that + # contain theming information, such as template file name suggestions. + # - Note that this debugging markup will cause automated tests that directly + # check rendered HTML to fail. When running automated tests, 'debug' + # should be set to FALSE. + # - The dump() function can be used in Twig templates to output information + # about template variables. + # - Twig templates are automatically recompiled whenever the source code + # changes (see auto_reload below). + # + # For more information about debugging Twig templates, see + # https://www.drupal.org/node/1906392. + # + # Not recommended in production environments + # @default false + debug: false + # Twig auto-reload: + # + # Automatically recompile Twig templates whenever the source code changes. + # If you don't provide a value for auto_reload, it will be determined + # based on the value of debug. + # + # Not recommended in production environments + # @default null + auto_reload: null + # Twig cache: + # + # By default, Twig templates will be compiled and stored in the filesystem + # to increase performance. Disabling the Twig cache will recompile the + # templates from source each time they are used. In most cases the + # auto_reload setting above should be enabled rather than disabling the + # Twig cache. + # + # Not recommended in production environments + # @default true + cache: true + renderer.config: + # Renderer required cache contexts: + # + # The Renderer will automatically associate these cache contexts with every + # render array, hence varying every render array by these cache contexts. + # + # @default ['languages:language_interface', 'theme', 'user.permissions'] + required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions'] + # Renderer automatic placeholdering conditions: + # + # Drupal allows portions of the page to be automatically deferred when + # rendering to improve cache performance. That is especially helpful for + # cache contexts that vary widely, such as the active user. On some sites + # those may be different, however, such as sites with only a handful of + # users. If you know what the high-cardinality cache contexts are for your + # site, specify those here. If you're not sure, the defaults are fairly safe + # in general. + # + # For more information about rendering optimizations see + # https://www.drupal.org/developing/api/8/render/arrays/cacheability#optimizing + auto_placeholder_conditions: + # Max-age at or below which caching is not considered worthwhile. + # + # Disable by setting to -1. + # + # @default 0 + max-age: 0 + # Cache contexts with a high cardinality. + # + # Disable by setting to []. + # + # @default ['session', 'user'] + contexts: ['session', 'user'] + # Tags with a high invalidation frequency. + # + # Disable by setting to []. + # + # @default [] + tags: [] + # Cacheability debugging: + # + # Responses with cacheability metadata (CacheableResponseInterface instances) + # get X-Drupal-Cache-Tags and X-Drupal-Cache-Contexts headers. + # + # For more information about debugging cacheable responses, see + # https://www.drupal.org/developing/api/8/response/cacheable-response-interface + # + # Not recommended in production environments + # @default false + http.response.debug_cacheability_headers: false + factory.keyvalue: + {} + # Default key/value storage service to use. + # @default keyvalue.database + # default: keyvalue.database + # Collection-specific overrides. + # state: keyvalue.database + factory.keyvalue.expirable: + {} + # Default key/value expirable storage service to use. + # @default keyvalue.database.expirable + # default: keyvalue.database.expirable + # Allowed protocols for URL generation. + filter_protocols: + - http + - https + - ftp + - news + - nntp + - tel + - telnet + - mailto + - irc + - ssh + - sftp + - webcal + - rtsp diff --git a/templates/drupal9-multisite/files/web/sites/main/settings.php b/templates/drupal9-multisite/files/web/sites/main/settings.php new file mode 100644 index 000000000..c81c78583 --- /dev/null +++ b/templates/drupal9-multisite/files/web/sites/main/settings.php @@ -0,0 +1,44 @@ + $route) { + if ($route['type'] === 'upstream' + && $route['upstream'] === $_ENV['PLATFORM_APPLICATION_NAME'] + && in_array($route['original_url'], $expected_route_urls)) { + $options['uri'] = $url; + break; + } + } +} diff --git a/templates/drupal9-multisite/files/web/sites/second/services.yml b/templates/drupal9-multisite/files/web/sites/second/services.yml new file mode 100644 index 000000000..23f6483cc --- /dev/null +++ b/templates/drupal9-multisite/files/web/sites/second/services.yml @@ -0,0 +1,155 @@ +parameters: + session.storage.options: + # Default ini options for sessions. + # + # Some distributions of Linux (most notably Debian) ship their PHP + # installations with garbage collection (gc) disabled. Since Drupal depends + # on PHP's garbage collection for clearing sessions, ensure that garbage + # collection occurs by using the most common settings. + # @default 1 + gc_probability: 1 + # @default 100 + gc_divisor: 100 + # + # Set session lifetime (in seconds), i.e. the time from the user's last + # visit to the active session may be deleted by the session garbage + # collector. When a session is deleted, authenticated users are logged out, + # and the contents of the user's $_SESSION variable is discarded. + # @default 200000 + gc_maxlifetime: 200000 + # + # Set session cookie lifetime (in seconds), i.e. the time from the session + # is created to the cookie expires, i.e. when the browser is expected to + # discard the cookie. The value 0 means "until the browser is closed". + # @default 2000000 + cookie_lifetime: 2000000 + # + # Drupal automatically generates a unique session cookie name based on the + # full domain name used to access the site. This mechanism is sufficient + # for most use-cases, including multi-site deployments. However, if it is + # desired that a session can be reused across different subdomains, the + # cookie domain needs to be set to the shared base domain. Doing so assures + # that users remain logged in as they cross between various subdomains. + # To maximize compatibility and normalize the behavior across user agents, + # the cookie domain should start with a dot. + # + # @default none + # cookie_domain: '.example.com' + # + twig.config: + # Twig debugging: + # + # When debugging is enabled: + # - The markup of each Twig template is surrounded by HTML comments that + # contain theming information, such as template file name suggestions. + # - Note that this debugging markup will cause automated tests that directly + # check rendered HTML to fail. When running automated tests, 'debug' + # should be set to FALSE. + # - The dump() function can be used in Twig templates to output information + # about template variables. + # - Twig templates are automatically recompiled whenever the source code + # changes (see auto_reload below). + # + # For more information about debugging Twig templates, see + # https://www.drupal.org/node/1906392. + # + # Not recommended in production environments + # @default false + debug: false + # Twig auto-reload: + # + # Automatically recompile Twig templates whenever the source code changes. + # If you don't provide a value for auto_reload, it will be determined + # based on the value of debug. + # + # Not recommended in production environments + # @default null + auto_reload: null + # Twig cache: + # + # By default, Twig templates will be compiled and stored in the filesystem + # to increase performance. Disabling the Twig cache will recompile the + # templates from source each time they are used. In most cases the + # auto_reload setting above should be enabled rather than disabling the + # Twig cache. + # + # Not recommended in production environments + # @default true + cache: true + renderer.config: + # Renderer required cache contexts: + # + # The Renderer will automatically associate these cache contexts with every + # render array, hence varying every render array by these cache contexts. + # + # @default ['languages:language_interface', 'theme', 'user.permissions'] + required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions'] + # Renderer automatic placeholdering conditions: + # + # Drupal allows portions of the page to be automatically deferred when + # rendering to improve cache performance. That is especially helpful for + # cache contexts that vary widely, such as the active user. On some sites + # those may be different, however, such as sites with only a handful of + # users. If you know what the high-cardinality cache contexts are for your + # site, specify those here. If you're not sure, the defaults are fairly safe + # in general. + # + # For more information about rendering optimizations see + # https://www.drupal.org/developing/api/8/render/arrays/cacheability#optimizing + auto_placeholder_conditions: + # Max-age at or below which caching is not considered worthwhile. + # + # Disable by setting to -1. + # + # @default 0 + max-age: 0 + # Cache contexts with a high cardinality. + # + # Disable by setting to []. + # + # @default ['session', 'user'] + contexts: ['session', 'user'] + # Tags with a high invalidation frequency. + # + # Disable by setting to []. + # + # @default [] + tags: [] + # Cacheability debugging: + # + # Responses with cacheability metadata (CacheableResponseInterface instances) + # get X-Drupal-Cache-Tags and X-Drupal-Cache-Contexts headers. + # + # For more information about debugging cacheable responses, see + # https://www.drupal.org/developing/api/8/response/cacheable-response-interface + # + # Not recommended in production environments + # @default false + http.response.debug_cacheability_headers: false + factory.keyvalue: + {} + # Default key/value storage service to use. + # @default keyvalue.database + # default: keyvalue.database + # Collection-specific overrides. + # state: keyvalue.database + factory.keyvalue.expirable: + {} + # Default key/value expirable storage service to use. + # @default keyvalue.database.expirable + # default: keyvalue.database.expirable + # Allowed protocols for URL generation. + filter_protocols: + - http + - https + - ftp + - news + - nntp + - tel + - telnet + - mailto + - irc + - ssh + - sftp + - webcal + - rtsp diff --git a/templates/drupal9-multisite/files/web/sites/second/settings.php b/templates/drupal9-multisite/files/web/sites/second/settings.php new file mode 100644 index 000000000..c81c78583 --- /dev/null +++ b/templates/drupal9-multisite/files/web/sites/second/settings.php @@ -0,0 +1,44 @@ +hasRelationship($platformsh_subsite_id)) { + $creds = $platformsh->credentials($platformsh_subsite_id); + if ($creds) { + $databases['default']['default'] = [ + 'driver' => $creds['scheme'], + 'database' => $creds['path'], + 'username' => $creds['username'], + 'password' => $creds['password'], + 'host' => $creds['host'], + 'port' => $creds['port'], + 'pdo' => [PDO::MYSQL_ATTR_COMPRESS => !empty($creds['query']['compression'])] + ]; + } +} + +// Enable verbose error messages on development branches, but not on the production branch. +// You may add more debug-centric settings here if desired to have them automatically enable +// on development but not production. +if (isset($platformsh->branch)) { + // Production type environment. + if ($platformsh->branch == 'master' || $platformsh->onDedicated()) { + $config['system.logging']['error_level'] = 'hide'; + } // Development type environment. + else { + $config['system.logging']['error_level'] = 'verbose'; + } +} + +// Enable Redis caching. +if ($platformsh->hasRelationship('rediscache') && !InstallerKernel::installationAttempted() && extension_loaded('redis') && class_exists('Drupal\redis\ClientFactory')) { + $redis = $platformsh->credentials('rediscache'); + + // Set a cache prefix so not all sites go into the same cache pool. + $settings['cache_prefix'] = $platformsh_subsite_id . '_'; + + // Set Redis as the default backend for any cache bin not otherwise specified. + $settings['cache']['default'] = 'cache.backend.redis'; + $settings['redis.connection']['host'] = $redis['host']; + $settings['redis.connection']['port'] = $redis['port']; + + // Apply changes to the container configuration to better leverage Redis. + // This includes using Redis for the lock and flood control systems, as well + // as the cache tag checksum. Alternatively, copy the contents of that file + // to your project-specific services.yml file, modify as appropriate, and + // remove this line. + $settings['container_yamls'][] = 'modules/contrib/redis/example.services.yml'; + + // Allow the services to work before the Redis module itself is enabled. + $settings['container_yamls'][] = 'modules/contrib/redis/redis.services.yml'; + + // Manually add the classloader path, this is required for the container cache bin definition below + // and allows to use it without the redis module being enabled. + $class_loader->addPsr4('Drupal\\redis\\', 'modules/contrib/redis/src'); + + // Use redis for container cache. + // The container cache is used to load the container definition itself, and + // thus any configuration stored in the container itself is not available + // yet. These lines force the container cache to use Redis rather than the + // default SQL cache. + $settings['bootstrap_container_definition'] = [ + 'parameters' => [], + 'services' => [ + 'redis.factory' => [ + 'class' => 'Drupal\redis\ClientFactory', + ], + 'cache.backend.redis' => [ + 'class' => 'Drupal\redis\Cache\CacheBackendFactory', + 'arguments' => ['@redis.factory', '@cache_tags_provider.container', '@serialization.phpserialize'], + ], + 'cache.container' => [ + 'class' => '\Drupal\redis\Cache\PhpRedis', + 'factory' => ['@cache.backend.redis', 'get'], + 'arguments' => ['container'], + ], + 'cache_tags_provider.container' => [ + 'class' => 'Drupal\redis\Cache\RedisCacheTagsChecksum', + 'arguments' => ['@redis.factory'], + ], + 'serialization.phpserialize' => [ + 'class' => 'Drupal\Component\Serialization\PhpSerialize', + ], + ], + ]; +} + +// Configure asset access/management for multi-site. +$config['system.performance']['css.preprocess'] = 0; +$config['system.performance']['js.preprocess'] = 0; + +// Configure file paths. +if ($platformsh->inRuntime()) { + if (!isset($settings['file_public_path'])) { + $settings['file_public_path'] = 'files/' . $platformsh_subsite_id; + } + if (!isset($settings['file_private_path'])) { + $settings['file_private_path'] = $platformsh->appDir . '/private/' . $platformsh_subsite_id; + } + if (!isset($settings['file_temp_path'])) { + $settings['file_temp_path'] = $platformsh->appDir . '/tmp/' . $platformsh_subsite_id; + } + + // Configure the default PhpStorage and Twig template cache directories. + if (!isset($settings['php_storage']['default'])) { + $settings['php_storage']['default']['directory'] = $settings['file_private_path']; + } + if (!isset($settings['php_storage']['twig'])) { + $settings['php_storage']['twig']['directory'] = $settings['file_private_path']; + } + + // Set the project-specific entropy value, used for generating one-time + // keys and such. + $settings['hash_salt'] = empty($settings['hash_salt']) ? $platformsh->projectEntropy : $settings['hash_salt'] . $platformsh_subsite_id; + + // Set the deployment identifier, which is used by some Drupal cache systems. + $settings['deployment_identifier'] = $settings['deployment_identifier'] ?? $platformsh->treeId; +} + +// The 'trusted_hosts_pattern' setting allows an admin to restrict the Host header values +// that are considered trusted. If an attacker sends a request with a custom-crafted Host +// header then it can be an injection vector, depending on how the Host header is used. +// However, Platform.sh already replaces the Host header with the route that was used to reach +// Platform.sh, so it is guaranteed to be safe. The following line explicitly allows all +// Host headers, as the only possible Host header is already guaranteed safe. +$settings['trusted_host_patterns'] = ['.*']; + +// Import variables prefixed with 'drupalsettings:' into $settings +// and 'drupalconfig:' into $config. +foreach ($platformsh->variables() as $name => $value) { + $parts = explode(':', $name); + list($prefix, $key) = array_pad($parts, 3, null); + switch ($prefix) { + // Variables that begin with `drupalsettings` or `drupal` get mapped + // to the $settings array verbatim, even if the value is an array. + // For example, a variable named drupalsettings:example-setting' with + // value 'foo' becomes $settings['example-setting'] = 'foo'; + case 'drupalsettings': + case 'drupal': + $settings[$key] = $value; + break; + // Variables that begin with `drupalconfig` get mapped to the $config + // array. Deeply nested variable names, with colon delimiters, + // get mapped to deeply nested array elements. Array values + // get added to the end just like a scalar. Variables without + // both a config object name and property are skipped. + // Example: Variable `drupalconfig:conf_file:prop` with value `foo` becomes + // $config['conf_file']['prop'] = 'foo'; + // Example: Variable `drupalconfig:conf_file:prop:subprop` with value `foo` becomes + // $config['conf_file']['prop']['subprop'] = 'foo'; + // Example: Variable `drupalconfig:conf_file:prop:subprop` with value ['foo' => 'bar'] becomes + // $config['conf_file']['prop']['subprop']['foo'] = 'bar'; + // Example: Variable `drupalconfig:prop` is ignored. + case 'drupalconfig': + if (count($parts) > 2) { + $temp = &$config[$key]; + foreach (array_slice($parts, 2) as $n) { + $prev = &$temp; + $temp = &$temp[$n]; + } + $prev[$n] = $value; + } + break; + } +} diff --git a/templates/drupal9-multisite/files/web/sites/sites.php b/templates/drupal9-multisite/files/web/sites/sites.php new file mode 100644 index 000000000..438451e5c --- /dev/null +++ b/templates/drupal9-multisite/files/web/sites/sites.php @@ -0,0 +1,75 @@ +..' => 'directory'. As an + * example, to map https://www.drupal.org:8080/mysite/test to the configuration + * directory sites/example.com, the array should be defined as: + * @code + * $sites = array( + * '8080.www.drupal.org.mysite.test' => 'example.com', + * ); + * @endcode + * The URL, https://www.drupal.org:8080/mysite/test/, could be a symbolic link + * or an Apache Alias directive that points to the Drupal root containing + * index.php. An alias could also be created for a subdomain. See the + * @link https://www.drupal.org/documentation/install online Drupal installation guide @endlink + * for more information on setting up domains, subdomains, and subdirectories. + * + * The following examples look for a site configuration in sites/example.com: + * @code + * URL: http://dev.drupal.org + * $sites['dev.drupal.org'] = 'example.com'; + * + * URL: http://localhost/example + * $sites['localhost.example'] = 'example.com'; + * + * URL: http://localhost:8080/example + * $sites['8080.localhost.example'] = 'example.com'; + * + * URL: https://www.drupal.org:8080/mysite/test/ + * $sites['8080.www.drupal.org.mysite.test'] = 'example.com'; + * @endcode + * + * @see default.settings.php + * @see \Drupal\Core\DrupalKernel::getSitePath() + * @see https://www.drupal.org/documentation/install/multi-site + */ + +$platformsh = new \Platformsh\ConfigReader\Config(); + +if (!$platformsh->inRuntime()) { + return; +} + +// The following block adds a $sites[] entry for each subdomain that is defined +// in routes.yaml. +// If you are not using subdomain-based multisite routes then you will need to +// adapt the code below accordingly. +foreach ($platformsh->getUpstreamRoutes($platformsh->applicationName) as $route) { + $host = parse_url($route['url'], PHP_URL_HOST); + if ($host !== FALSE) { + $subdomain = substr($host, 0, strpos($host,'.')); + $sites[$host] = $subdomain; + } +} + +// Add additional domain mappings here. diff --git a/templates/drupal9-multisite/info/info.yaml b/templates/drupal9-multisite/info/info.yaml new file mode 100644 index 000000000..1fc4c58ea --- /dev/null +++ b/templates/drupal9-multisite/info/info.yaml @@ -0,0 +1,113 @@ +title: "Drupal 9 Multisite for Platform.sh" +id: platformsh/drupal9-multisite +profile: Drupal 9 Multisite +name: Drupal 9 Multisite +default_branch: master +tags: + - PHP + - Drupal + - CMS + - Symfony +related_blog_tags: + - Drupal +license: + type: "MIT" + location: "LICENSE" +features: + - PHP 8.0 + - MariaDB 10.4 + - Redis 6 + - Drush included + - Pre-configured for multiple sites + - Automatic TLS certificates + - Composer-based build +# Use Markdown for links and formatting. They will be converted to HTML automatically when the .platform.template.yaml file is generated. +description: + - This template builds Drupal 9 in a multisite configuration using the "Drupal Recommended" Composer project, creating three subsite installations from the same codebase. + - It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. + - It also includes instructions and a script to help with setting up additional multisite instances, although depending on your particular needs it may require some customization. + - Drupal is a flexible and extensible PHP-based CMS framework capable of hosting multiple sites on a single code base. +logo: + link: "https://www.drupal.org/" + images: + - "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNi4yIDMuOUMxNi4yIDMuOSAxNC44MiAzLjMgMTQuMDQgMi44MkMxNC4wNCAyLjgyIDEzLjAyIDIuMjIgMTEuMzQgMEMxMS4zNCAwIDExLjQgMi41MiA4LjcgMy44NEM0LjQ0IDUuNTIgMS44IDkuMDYgMS44IDEzLjU2QzEuOCAxOS4yNiA2LjQ4IDIzLjk0IDEyLjE4IDIzLjk0QzE3Ljk0IDIzLjk0IDIyLjU2IDE5LjI2IDIyLjU2IDEzLjU2QzIyLjYyIDYuNiAxNi4yIDMuOSAxNi4yIDMuOVpNNC42OCA5LjZDMy4wNiA5Ljk2IDMuMTggOS4xMiAzLjQ4IDguNEMzLjYgNy45OCA0LjAyIDcuNSA0LjAyIDcuNUM1LjEgNS43NiA3LjUgNC41IDcuNSA0LjVDNy44IDQuMzggOC4zNCA0LjA4IDguODIgMy44NEM5Ljc4IDMuMyAxMC4wMiAzIDEwLjAyIDNDMTEuNCAxLjY4IDExLjI4IDAuMDYgMTEuMjggMEMxMi40OCAyLjQgMTEuMDQgMy40OCAxMS4wNCAzLjQ4QzExLjQgMy44NCAxMS4yOCA0LjIgMTEuMjggNC4yQzkuNDIgOC4yMiA0LjY4IDkuNiA0LjY4IDkuNlpNMTcuMjIgMjIuMkMxNy4xIDIyLjI2IDE1LjYgMjIuOTggMTMuODYgMjIuOThDMTIuOSAyMi45OCAxMS44OCAyMi43NCAxMC45OCAyMi4xNEMxMC42OCAyMS45IDEwLjU2IDIxLjQ4IDEwLjc0IDIxLjE4QzEwLjggMjEuMDYgMTEuMTYgMjAuNjQgMTIgMjEuMThDMTIuMDYgMjEuMjQgMTQuMDQgMjIuNTYgMTcuMSAyMC44OEMxNy4zNCAyMC43NiAxNy42NCAyMC44MiAxNy43NiAyMS4wNkMxNy45NCAyMS4zIDE4IDIxLjc4IDE3LjIyIDIyLjJaTTEzLjAyIDE5LjY4TDEzLjA4IDE5LjYyQzEzLjE0IDE5LjU2IDE0LjE2IDE4LjI0IDE1LjY2IDE4LjQyQzE1LjkgMTguNDIgMTYuNzQgMTguNDggMTcuMjggMTkuNUMxNy4zNCAxOS42MiAxNy40NiAyMC4wNCAxNy4yMiAyMC4zNEMxNy4xIDIwLjQ2IDE2LjkyIDIwLjU4IDE2LjU2IDIwLjQ2QzE2LjMyIDIwLjQgMTYuMiAyMC4xNiAxNi4yIDIwLjA0QzE2LjE0IDE5Ljg2IDE2LjA4IDE5Ljc0IDE1LjQ4IDE5LjY4QzE1IDE5LjYyIDE0LjcgMTkuODYgMTQuMzQgMjAuMTZDMTQuMTYgMjAuMzQgMTMuOTIgMjAuNTIgMTMuNjggMjAuNThDMTMuNjIgMjAuNjQgMTMuNTYgMjAuNjQgMTMuNDQgMjAuNjRDMTMuMzIgMjAuNjQgMTMuMiAyMC41OCAxMy4wOCAyMC41MkMxMi45IDIwLjM0IDEyLjg0IDIwLjEgMTMuMDIgMTkuNjhaTTE5Ljg2IDE5LjhDMTkuODYgMTkuOCAxOS4zMiAxOS45OCAxOC43OCAxOS4zOEMxOC43OCAxOS4zOCAxNy4xNiAxNy41MiAxNi4zOCAxNy4yMkMxNi4zOCAxNy4yMiAxNS45IDE3LjA0IDE1LjMgMTcuMjhDMTUuMyAxNy4yOCAxNC44OCAxNy4zNCAxMy4yNiAxOC40MkMxMy4yNiAxOC40MiAxMC41IDIwLjE2IDkuMTIgMTkuOTJDOS4xMiAxOS45MiA2IDE5Ljk4IDYuNDIgMTYuNjhDNi40MiAxNi42OCA3LjA4IDEyLjk2IDExLjQgMTMuOEMxMS40IDEzLjggMTIuMzYgMTMuOTggMTQuMSAxNS4zNkMxNC4xIDE1LjM2IDE1LjMgMTYuMjYgMTUuOSAxNi4yNkMxNS45IDE2LjI2IDE2LjM4IDE2LjMyIDE3LjQ2IDE1LjY2QzE3LjQ2IDE1LjY2IDE5LjU2IDE0LjA0IDIwLjM0IDE0LjFDMjAuNDYgMTQuMSAyMS44NCAxNC4wNCAyMS44NCAxNi4zMkMyMS43OCAxNi4yNiAyMS44NCAxOC45IDE5Ljg2IDE5LjhaIiBmaWxsPSIjMDA4RUNFIi8+Cjwvc3ZnPgo=" +sections: + "create-project": "composer create-project platformsh/drupal9-multisite -s dev" + metrics: false + blackfire: true + postinstall: "templates/drupal9-multisite/info/post_install.md" + local: + - "common/readme/drupal/local_ddev.md" + - "common/readme/drupal/local_lando.md" + resources: + - "[Drupal](https://www.drupal.org/)" + - "[Drupal 9 on Platform.sh](https://docs.platform.sh/guides/drupal9/deploy.html)" + - "[Platform.sh PHP documentation](https://docs.platform.sh/languages/php.html)" + - "[Multi-site best practices on Platform.sh](https://docs.platform.sh/bestpractices/oneormany.html)" + migration: + mounts: + - "web/sites/default/files" + - "private" + files: + "web/sites/settings.platformsh.php": + - "**Added:**

" + - "Contains Platform.sh-specific configuration, namely setting up the database connection to the MariaDB service and caching via Redis." + "web/sites/sites.php": + - "**Added:**

" + - "Configuration file for multi-site support and directory aliasing feature." + "web/sites/default/settings.php": + - "**Added:**

" + - "The Drupal settings file has been updated to import and use `web/sites/settings.platformsh.php`." + - "You will also need an identical file for each subsite (i.e. `main`, `first`, and `second`)." + "web/sites/default/services.yml": + - "**Added:**

" + - "Default services configuration." + - "You will also need an identical file for each subsite (i.e. `main`, `first`, and `second`)." + "web/sites/default/drushrc.php": + - "**Added:**

" + - "Drush configuration file for a Platform.sh Drupal site." + - "You will also need an identical file for each subsite (i.e. `main`, `first`, and `second`)." + ".environment": + - "**Added:**

" + - file: "common/readme/file_descriptions/.environment.md" + - "Here, the Composer config and `PATH` are updated to allow executable app dependencies from Composer to be run from the path (i.e. `drush`)." + ".blackfire.yml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.blackfire.yml.md" + ".gitignore": + - "**Added:**

" + - "A `.gitignore` file is not included in the upstream, so one has been added." + ".lando.upstream.yml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.lando.upstream.yml.md" + ".platform.app.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.app.yaml.md" + - "This template uses Composer 2 to install dependencies using the default `composer` [build flavor](https://docs.platform.sh/languages/php.html#build-flavor) prior to the `build` hook." + - "Drush tasks are run during the `deploy` hook, and referenced again during the defined `cron` job." + "drush/platformsh_generate_drush_yml.php": + - "**Added:**

" + - "This file has been included to generate the drush yaml configuration on every deployment." + ".ddev/providers/platform.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.ddev.providers.platform.yaml.md" + "php.ini": + - "**Added:**

" + - file: "common/readme/drupal/php.ini.md" + ".platform/services.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.services.yaml.md" + - "In this template, MariaDB and Redis have been configured." + ".platform/routes.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.routes.yaml.md" + "psh-subsite-add.php": + - "**Added:**

" + - "A script has been added to simplify adding additional sites to your Drupal installation. See [Adding a new subsite](#troubleshooting) for more information." + troubleshoot: + - file: "common/readme/troubleshoot_ssh.md" + - file: "common/readme/drupal/troubleshoot_cache.md" + - file: "common/readme/drupal/troubleshoot_hashsalt.md" + - file: "common/readme/drupal/troubleshoot_multisite.md" + - file: "common/readme/drupal/troubleshoot_multisite_addsite.md" + - file: "common/readme/drupal/troubleshoot_multisite_drush.md" diff --git a/templates/drupal9-multisite/info/post_install.md b/templates/drupal9-multisite/info/post_install.md new file mode 100644 index 000000000..d3f6a719f --- /dev/null +++ b/templates/drupal9-multisite/info/post_install.md @@ -0,0 +1,3 @@ +### Post-install + +Each subsite installs separately. As configured, this project uses a subdomain for each subsite. For each subsite, run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. \ No newline at end of file diff --git a/templates/drupal9-multisite/platformsh.wizard.yaml b/templates/drupal9-multisite/platformsh.wizard.yaml new file mode 100644 index 000000000..54fed3ec4 --- /dev/null +++ b/templates/drupal9-multisite/platformsh.wizard.yaml @@ -0,0 +1,89 @@ +steps: + - id: "understanding_platformsh" + label: "Preparing for development" + title: "Preparing for development on Platform.sh" + required: true + bodyText: "

Congrats! We’ve started the first deployment to production for you.

\n

Once complete, select your default environment to see your production URL. Feel free to visit your website to complete the Drupal 8 multisite installation steps for each site (at the first and second subdomains).

\n

Git-driven development

\n

Platform.sh supports Git-driven development by design. Changes happen right in your code.  When SSH’ing into your website, all files are read-only by default.

\n

Mark the directories that you want to edit as write access. (See mounts documentation).

" + copyCode: [] + - id: "download_cli" + label: "Download the CLI" + title: "Download the Platform.sh CLI" + required: false + bodyText: "

To install the CLI, use the command for either macOS or Windows as shown.

\n

For more info about our CLI check out our documentation or take a look at our CLI source code.

" + copyCode: + - label: "macOS and Linux Installer" + code: + - "curl -sS https://platform.sh/cli/installer | php" + - label: "Windows Installer" + code: + - "curl https://platform.sh/cli/installer -o cli-installer.php" + - "php cli-installer.php" + - id: "download_project" + label: "Download your project" + title: "Download your project to start using it" + required: true + bodyText: "

The easiest way to download your project and prepare your SSH authentication is to use the Platform CLI.

\n

The platform get command will not only download your project but will also take care of your SSH authentication.

\n

Manually authenticate by adding your SSH key to your account.

" + copyCode: + - label: "Download your project" + code: + - "platform get" + - "" + - "# Using Git? Add your SSH Key and git clone " + - id: "prepare_staging" + label: "Creating dev branches" + title: "Clone production to your first development environment!" + required: true + bodyText: "

You'll now create a perfect live replica of production on Platform.sh and switch to that branch locally. Cool, huh!

\n

You can now modify your code and test your changes locally before pushing them to your live site on Platform.sh.

" + copyCode: + - label: 'Clone production environment to "develop" on Platform.sh and check it out locally.' + code: + - "platform environment:branch develop" + - label: "Using Git?" + code: + - "git checkout -b develop" + - "git push platform develop" + - "" + - "# Head to console.platform.sh to see live URL for your develop branch" + - id: "development" + label: "The first development change!" + title: "Making your first change in development" + required: false + bodyText: "

Let's try modifying your code and reviewing it locally. We’ll install the Pathauto extension.

" + copyCode: + - label: "Install the Pathauto extension to see it listed within the Drupal “Extend” page." + code: + - "composer require drupal/pathauto" + - "" + - '# Confirm it’s installed. "- Installing drupal/pathauto…"' + - id: "deploy" + label: "Deploy your changes" + title: "You're ready to deploy some code!" + required: false + bodyText: "

Congrats. You’ve installed drupal/pathauto.

\n

Let's publish those changes to Platform.sh and review them before merging them into production!

" + copyCode: + - label: "Save your changes and review your live develop website." + code: + - 'git add composer.json composer.lock && git commit -m "My first Platform.sh update";' + - "" + - "platform push" + - label: "Happy? Merge into production!" + code: + - "platform merge" + - "" + - "#Using git?" + - "git checkout main" + - "git merge develop" + - "git push platform main" + - id: "understanding_infrastructure" + label: "Know your infrastructure" + title: "Customize your infrastructure on Platform.sh" + required: false + bodyText: "

Finally, your project is a typical Drupal 8 multisite installation, with 3 new files to help you deploy on Platform.sh.

\n

.platform.app.yaml Build steps, jobs, storage mounts, and more

\n

.platform/services.yaml Add services, e.g., databases, Redis

\n

.platform/routes.yaml Add domains, subdomains, and redirects

\n

< Default Strapi Code >

\n

See the readme.md in your project files for more info

\n

Explore these files to create additional apps, services, and routes for your project.

" + copyCode: + - label: "Application code structure" + code: + - "├── .platform" + - "│ ├── routes.yaml" + - "│ └── services.yaml" + - "├── .platform.app.yaml" + - "└── < application code >" diff --git a/templates/drupal9/.platform.template.yaml b/templates/drupal9/.platform.template.yaml index 494d00671..875c420ab 100644 --- a/templates/drupal9/.platform.template.yaml +++ b/templates/drupal9/.platform.template.yaml @@ -18,7 +18,7 @@ info: notes: - heading: "Features" content: | - PHP 8.1
+ PHP 8.0
MariaDB 10.4
Redis 6
Drush included
diff --git a/templates/drupal9/files/.platform.app.yaml b/templates/drupal9/files/.platform.app.yaml index b65f0b760..f9f48cc65 100644 --- a/templates/drupal9/files/.platform.app.yaml +++ b/templates/drupal9/files/.platform.app.yaml @@ -4,10 +4,10 @@ # See https://docs.platform.sh/configuration/app.html # The name of this app. Must be unique within a project. -name: 'app' +name: 'drupal' # The runtime the application uses. -type: 'php:8.1' +type: 'php:8.0' dependencies: php: @@ -18,6 +18,8 @@ runtime: extensions: - redis - sodium + - apcu + - blackfire # The relationships of the application with services or other applications. # @@ -64,7 +66,6 @@ mounts: # Configuration of the build of this application. build: - # Automatically run `composer install` on every build. flavor: composer # The hooks executed at various points in the lifecycle of the application. diff --git a/templates/drupal9/files/.platform/routes.yaml b/templates/drupal9/files/.platform/routes.yaml index 425c96292..69ba2fcd0 100644 --- a/templates/drupal9/files/.platform/routes.yaml +++ b/templates/drupal9/files/.platform/routes.yaml @@ -5,7 +5,7 @@ "https://{default}/": type: upstream - upstream: "app:http" + upstream: "drupal:http" cache: enabled: true diff --git a/templates/drupal9/files/README.md b/templates/drupal9/files/README.md index 9debdb57c..9ab2df6ee 100644 --- a/templates/drupal9/files/README.md +++ b/templates/drupal9/files/README.md @@ -1,46 +1,832 @@ -# Drupal 9 for Platform.sh + +

+ + + +

- - Deploy on Platform.sh + +

-This template builds Drupal 9 using the "Drupal Recommended" Composer project. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. +

Deploy Drupal 9 on Platform.sh

+ +

+Contribute, request a feature, or check out our resources +
+
+Join our community       +Documentation       +Blog       +Report a bug       +Request a feature +

+

+ +

+ +Open issues +   + +Open PRs +   + +License +   +

+ +

+

+ +
+ +

+Contents +

+About       +Getting started       +Migrate       +Learn       +Contribute       +
+

+
+ +## About + +This template builds Drupal 9 using the "Drupal Recommended" Composer project. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. Drupal is a flexible and extensible PHP-based CMS framework. -## Features +### Features + +- PHP 8.0 +- MariaDB 10.4 +- Redis 6 +- Drush included +- Automatic TLS certificates +- Composer-based build + + +## Getting started + +### Deploy + +#### Quickstart + + +The quickest way to deploy this template on Platform.sh is by clicking the button below. +This will automatically create a new project and initialize the repository for you. + +

+ + Deploy on Platform.sh + +

+
+ + + +You can also quickly recreate this project locally with the following command: + +```bash +composer create-project platformsh/drupal9 -s dev +``` + + +> **Note:** +> +> Platform.sh templates prioritize upstream release versions over our own. Despite this, we update template dependencies on a scheduled basis independent of those upstreams. Because of this, template repos do not contain releases. This may change in the future, but until then the `-s dev` flag is necessary to use `composer create-project`. + + + +#### Other deployment options + +For all of the other options below, clone this repository first: + +```bash +git clone https://github.com/platformsh-templates/drupal9 +``` + +If you're trying to deploy from GitHub, you can generate a copy of this repository first in your own namespace by clicking the [Use this template](https://github.com/platformsh-templates/drupal9/generate) button at the top of this page. + +Then you can clone a copy of it locally with `git clone git@github.com:YOUR_NAMESPACE/drupal9.git`. + + +
+Deploy directly to Platform.sh from the command line + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
+ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
+ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows -* PHP 8.1 -* MariaDB 10.4 -* Redis 5 -* Drush included -* Automatic TLS certificates -* Composer-based build + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` -## Post-install + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
+ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
+ + + +### Post-install Run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. -## Customizations +### Local development + +This section provides instructions for running the `drupal9` template locally, connected to a live database instance on an active Platform.sh environment. + +In all cases for developing with Platform.sh, it's important to develop on an isolated environment - do not connect to data on your production environment when developing locally. +Each of the options below assume that you have already deployed this template to Platform.sh, as well as the following starting commands: + +```bash +$ platform get PROJECT_ID +$ cd project-name +$ platform environment:branch updates +``` + +
+Drupal: using ddev
+ +ddev provides an integration with Platform.sh that makes it simple to develop Drupal locally. Check the [providers documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for the most up-to-date information. + +In general, the steps are as follows: + +1. [Install ddev](https://ddev.readthedocs.io/en/stable/#installation). +1. A configuration file has already been provided at `.ddev/providers/platform.yaml`, so you should not need to run `ddev config`. +1. [Retrieve an API token](https://docs.platform.sh/development/cli/api-tokens.html#get-a-token) for your organization via the management console. +1. Update your dedev global configuration file to use the token you've just retrieved: + ```yaml + web_environment: + - PLATFORMSH_CLI_TOKEN=abcdeyourtoken` + ``` +1. Run `ddev restart`. +1. Get your project ID with `platform project:info`. If you have not already connected your local repo with the project (as is the case with a source integration, by default), you can run `platform project:list` to locate the project ID, and `platform project:set-remote PROJECT_ID` to configure Platform.sh locally. +1. Update the `.ddev/providers/platform.yaml` file for your current setup: + ```yaml + environment_variables: + project_id: PROJECT_ID + environment: CURRENT_ENVIRONMENT + application: drupal + ``` +1. Get the current environment's data with `ddev pull platform`. +1. When you have finished with your work, run `ddev stop` and `ddev poweroff`. + +
+
+Drupal: using Lando
+ +Lando supports PHP applications [configured to run on Platform.sh](https://docs.platform.sh/development/local/lando.html), and pulls from the same container registry Platform.sh uses on your remote environments during your local builds through its own [recipe and plugin](https://docs.lando.dev/platformsh/). + +1. [Install Lando](https://docs.lando.dev/getting-started/installation.html). +1. Make sure Docker is already running - Lando will attempt to start Docker for you, but it's best to have it running in the background before beginning. +1. Start your apps and services with the command `lando start`. +1. To get up-to-date data from your Platform.sh environment ([services *and* mounts](https://docs.lando.dev/platformsh/sync.html#pulling)), run the command `lando pull`. +1. If at any time you have updated your Platform.sh configuration files, run the command `lando rebuild`. +1. When you have finished with your work, run `lando stop` and `lando poweroff`. + +
+ + + +> **Note:** +> +> For many of the steps above, you may need to include the CLI flags `-p PROJECT_ID` and `-e ENVIRONMENT_ID` if you are not in the project directory or if the environment is associated with an existing pull request. + + +## Migrate + +The steps below outline the important steps for migrating your application to Platform.sh - adding the required configuration files and dependencies, for example. +Not every step will be applicable to each person's migration. +These steps actually assume the earliest starting point possible - that there is no code at all locally, and that this template repository will be rebuilt completely from scratch. + +- [Getting started](#getting-started-1) +- [Adding and updating files](#adding-and-updating-files) +- [Dependencies](#dependencies) +- [Deploying to Platform.sh](#deploying-to-platformsh) +- [Migrating your data](#migrating-your-data) +- [Next steps](#next-steps) + +If you already have code you'd like to migrate, feel free to focus on the steps most relevant to your application and skip the first section. + +### Getting started + +Assuming that your starting point is no local code, the steps below will setup a starting repository we can begin to make changes to to rebuild this template and migrate to Platform.sh. +If you already have a codebase you are trying to migrate, move onto the next step - [Adding and updating files](#adding-and-updating-files) - and substitute any reference to the default branch `main` with some other branch name. + + + +```bash +$ mkdir drupal9 && cd drupal9 +$ git init +$ git remote add upstream https://github.com/drupal/recommended-project.git +$ git branch -m main +$ git fetch --all --depth=2 +$ git fetch --all --tags +$ git merge --allow-unrelated-histories -X theirs 9.3.9 + +``` + + + +### Adding and updating files + +A small number of files need to be added to or modified in your repository at this point. +Some of them explicitly configure how the application is built and deployed on Platform.sh, while others simply modify files you may already have locally, in which case you will need to replicate those changes. + +Open the dropdown below to view all of the **Added** and **Updated** files you'll need to reproduce in your migration. + +
+View files
+ + + +| File | Purpose | +|:-----------|:--------| +| [`config/sync/.gitkeep`](config/sync/.gitkeep) | **Added** | +| [`web/sites/default/settings.php`](web/sites/default/settings.php) | **Updated:**

The Drupal settings file has been updated to import and use `web/sites/default/settings.platformsh.php`. | +| [`web/sites/default/settings.platformsh.php`](web/sites/default/settings.platformsh.php) | **Added:**

Contains Platform.sh-specific configuration, namely setting up the database connection to the MariaDB service and caching via Redis. | +| [`.environment`](.environment) | **Added:**

The `.environment` file is a convenient place to [set environment variables](https://docs.platform.sh/development/variables/set-variables.html#set-variables-via-script) relevant to your applications that may be dependent on the current environment. It is sourced before the start command is run, as the first step in the `deploy` and `post_deploy` hooks, and at the beginning of each session when you SSH into an application container. It is written in dash, so be aware of the differences to bash.

It can be used to set any environment variable, including ones that depend on Platform.sh-provided variables like `PLATFORM_RELATIONSHIPS` and `PLATFORM_ROUTES`, or to modify `PATH`. This file should not [produce output](https://docs.platform.sh/development/variables/set-variables.html#testing-environment-scripts).

Here, the Composer config and `PATH` are updated to allow executable app dependencies from Composer to be run from the path (i.e. `drush`). | +| [`.gitignore`](.gitignore) | **Added:**

A `.gitignore` file is not included in the upstream, so one has been added. | +| [`.platform.app.yaml`](.platform.app.yaml) | **Added:**

This file is required to define the build and deploy process for all application containers on Platform.sh. Within this file, the runtime version, relationships to service containers, and writable mounts are configured. It's also in this file that it is defined what dependencies are installed, when they are installed, and that package manager will be used to do so.

Take a look at the [Application](https://docs.platform.sh/configuration/app.html) documentation for more details about configuration. For more information about the sequence of events that lead from a build to deployment, see the [Build and deploy timeline documentation](https://docs.platform.sh/overview/build-deploy.html).

This template uses Composer 2 to install dependencies using the default `composer` [build flavor](https://docs.platform.sh/languages/php.html#build-flavor) prior to the `build` hook. Drush tasks are run during the `deploy` hook, and referenced again during the defined `cron` job. | +| [`drush/platformsh_generate_drush_yml.php`](drush/platformsh_generate_drush_yml.php) | **Added:**

This file has been included to generate the drush yaml configuration on every deployment. | +| [`.platform/services.yaml`](.platform/services.yaml) | **Added:**

Platform.sh provides a number of on-demand managed services that can easily be added to your projects. It's within this file that each service's version, name, resources, and additional configuration are set. See the [Services documentation](https://docs.platform.sh/configuration/services.html) for more details on configuration, version and service availability.

In this template, MariaDB and Redis have been configured. | +| [`.platform/routes.yaml`](.platform/routes.yaml) | **Added:**

This file is require to deploy on Platform.sh, as it defines how requests should be handled on the platform. It's within this file that redirects and basic caching can be configured. See the [Routes documentation](https://docs.platform.sh/configuration/routes.html) for more configuration details.

| +| [`php.ini`](php.ini) | **Added:**

An initial `php.ini` file has also beed added. The settings are a result of performance testing and best practice recommendations coming from [Blackfire.io](https://blackfire.io). They will initialize Drupal with a number of good baseline performance settings for production applications, and complement many of the tests specified in [`.blackfire.yml`](.blackfire.yml). | +| [`.blackfire.yml`](.blackfire.yml) | **Added:**

This file has been added to help you get started using [Blackfire.io](https://blackfire.io) on your project. See [the Blackfire section below](#blackfireio-creating-a-continuous-observability-strategy) for more information on how to get started. | +| [`.lando.upstream.yml`](.lando.upstream.yml) | **Added:**

This file configures [Lando](https://docs.platform.sh/development/local/lando.html) as a local development option for this template. See the [Platform.sh Lando plugin documentation](https://docs.lando.dev/platformsh/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. | +| [`.ddev/providers/platform.yaml`](.ddev/providers/platform.yaml) | **Added:**

This file configures [ddev](https://ddev.readthedocs.io/en/latest/users/providers/platform/) as a local development option for this template. See the [Platform.sh ddev integration documentation](https://ddev.readthedocs.io/en/latest/users/providers/platform/) for more information about configuration and the [Local development](#local-development) section of this README for how to get started. Be sure to follow the instructions provided through the ddev CLI and in the comments section of that file to correctly configure ddev for your project. | + + + +
+ +### Dependencies and configuration + +Sometimes it is necessary to install additional dependencies to and modify the configuration of an upstream project to deploy on Platform.sh. +When it is, we do our best to keep these modifications to the minimum necessary. +Run the commands below to reproduce the dependencies in this template. + + + +```bash +$ composer require platformsh/config-reader drush/drush drupal/redis +$ composer config allow-plugins.composer/installers true --no-plugins +$ composer config allow-plugins.drupal/core-composer-scaffold true --no-plugins +$ composer config allow-plugins.drupal/core-project-message true --no-plugins +$ composer config allow-plugins.cweagans/composer-patches true --no-plugins + +``` + + + +### Deploying to Platform.sh + +Your repository now has all of the code it needs in order to deploy to Platform.sh. + + +
+Deploy directly to Platform.sh from the command line + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI -The following changes have been made relative to Drupal 9 "Recommended" project as it is downloaded from Drupal.org or Packagist. If using this project as a reference for your own existing project, replicate the changes below to your project. + #### Linux/OSX -* The `.platform.app.yaml`, `.platform/services.yaml`, and `.platform/routes.yaml` files have been added. These provide Platform.sh-specific configuration and are present in all projects on Platform.sh. You may customize them as you see fit. -* An additional Composer library, [`platformsh/config-reader`](https://github.com/platformsh/config-reader-php), has been added. It provides convenience wrappers for accessing the Platform.sh environment variables. -* Drush and Drupal Console have been pre-included in `composer.json`. You are free to remove one or both if you do not wish to use them. (Note that the default cron and deploy hooks make use of Drush commands, however.) -* A `.environment` file has been added, which allows executable app dependencies from Composer to be run from the path. -* The Drupal Redis module comes pre-installed. The placeholder module is not pre-installed, but it is enabled via `settings.platformsh.php` out of the box. -* The `settings.platformsh.php` file contains Platform.sh-specific code to map environment variables into Drupal configuration. You can add to it as needed. See the documentation for more examples of common snippets to include here. It uses the Config Reader library. -* The `settings.php` file has been heavily customized to only define those values needed for both Platform.sh and local development. It calls out to `settings.platformsh.php` if available. You can add additional values as documented in `default.settings.php` as desired. It is also setup such that when you install Drupal on Platform.sh the installer will not ask for database credentials as they will already be defined. + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` -## Migration + #### Windows -If you are looking to replicate the changes in this template to migrate your own Drupal 9 project, be sure to checkout the [Deploying Drupal 9 guide](https://docs.platform.sh/guides/drupal9/deploy.html) in the documentation as a reference. + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` -## References + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Set the project remote + + Find your `PROJECT_ID` by running the command `platform project:list` + + ```bash + +---------------+------------------------------------+------------------+---------------------------------+ + | ID | Title | Region | Organization | + +---------------+------------------------------------+------------------+---------------------------------+ + | PROJECT_ID | Your Project Name | xx-5.platform.sh | your-username | + +---------------+------------------------------------+------------------+---------------------------------+ + ``` + + Then from within your local copy, run the command `platform project:set-remote PROJECT_ID`. + +1. Push + + ```bash + git push platform DEFAULT_BRANCH + ``` + + +
+ +
+Integrate with a GitHub repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to whatever you have set at `https://YOUR_NAMESPACE/nextjs-drupal`. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Setup the integration: + + Consult the [GitHub integration documentation](https://docs.platform.sh/integrations/source/github.html#setup) to finish connecting your repository to a project on Platform.sh. You will need to create an Access token on GitHub to do so. + + +
+ +
+Integrate with a GitLab repo and deploy merge requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on GitLab, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [GitLab integration documentation](https://docs.platform.sh/integrations/source/gitlab.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on GitLab to do so. + + +
+ +
+Integrate with a Bitbucket repo and deploy pull requests + + +1. Create a free trial: + + [Register for a 30 day free trial with Platform.sh](https://auth.api.platform.sh/register). When you have completed signup, select the **Create from scratch** project option. Give you project a name, and select a region where you would like it to be deployed. As for the *Production environment* option, make sure to match it to this repository's settings, or to what you have updated the default branch to locally. + +1. Install the Platform.sh CLI + + #### Linux/OSX + + ```bash + curl -sS https://platform.sh/cli/installer | php + ``` + + #### Windows + + ```bash + curl -f https://platform.sh/cli/installer -o cli-installer.php + php cli-installer.php + ``` + + You can verify the installation by logging in (`platformsh login`) and listing your projects (`platform project:list`). + +1. Create the repository + + Create a new repository on Bitbucket, set it as a new remote for your local copy, and push to the default branch. + +1. Setup the integration: + + Consult the [Bitbucket integration documentation](https://docs.platform.sh/integrations/source/bitbucket.html#setup) to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so. + + +
+ + + +### Migrating your data + + +If you are moving an existing site to Platform.sh, then in addition to code you also need to migrate your data. That means your database and your files. + +
+Importing the database
+ +First, obtain a database dump from your current site and save your dump file as `database.sql`. Then, import the database into your Platform.sh site using the CLI: + +```bash +platform sql -e main < database.sql +``` + +
+
+Importing files
+ +You first need to download your files from your current hosting environment. +The easiest way is likely with rsync, but consult your old host's documentation. + +The `platform mount:upload` command provides a straightforward way to upload an entire directory to your site at once to a `mount` defined in a `.platform.app.yaml` file. +Under the hood, it uses an SSH tunnel and rsync, so it is as efficient as possible. +(There is also a `platform mount:download` command you can use to download files later.) +Run the following from your local Git repository root (modifying the `--source` path if needed and setting `BRANCH_NAME` to the branch you are using). + +A few examples are listed below, but repeat for all directories that contain data you would like to migrate. + +```bash +$ platform mount:upload -e main --mount web/sites/default/files --source ./web/sites/default/files +$ platform mount:upload -e main --mount private --source ./private +``` + +Note that `rsync` is picky about its trailing slashes, so be sure to include those. + +
+ + + +### Next steps + +With your application now deployed on Platform.sh, things get more interesting. +Run the command `platform environment:branch new-feature` for your project, or open a trivial pull request off of your current branch. + +The resulting environment is an *exact* copy of production. +It contains identical infrastructure to what's been defined in your configuration files, and even includes data copied from your production environment in its services. +On this isolated environment, you're free to make any changes to your application you need to, and really test how they will behave on production. + +After that, here are a collection of additional resources you might find interesting as you continue with your migration to Platform.sh: + +- [Local development](#local-development) +- [Troubleshooting](#troubleshooting) +- [Adding a domain and going live](https://docs.platform.sh/domains/steps.html) +- [(CDN) Content Delivery Networks](https://docs.platform.sh/domains/cdn.html) +- [Performance and observability with Blackfire.io](https://docs.platform.sh/integrations/observability/blackfire.html) +- [Pricing](https://docs.platform.sh/overview/pricing.html) +- [Security and compliance](https://docs.platform.sh/security.html) + + +## Learn + +### Troubleshooting + + +
+Accessing logs
+ +After the environment has finished its deployment, you can investigate issues that occured on startup, `deploy` and `post_deploy` hooks, and generally at runtime using the CLI. Run the command: + +```bash +platform ssh +``` + +If you are running the command outside of a local copy of the project, you will need to include the `-p` (project) and/or `-e` (environment) flags as well. +Once you have connected to the container, [logs](https://docs.platform.sh/development/logs.html#container-logs) are available within `/var/log/` for you to investigate. + +
+ + +
+Rebuilding cache
+ +You may run into a database error after installing Drupal on your production environment initially. +To fix, SSH into the application container (`platform ssh`) and rebuild the cache using Drush: + +```bash +drush cache-rebuild +``` + +
+ + +
+Default hash_salt behavior
+ +Drupal's [default settings set](https://github.com/drupal/drupal/blob/9.3.x/core/assets/scaffold/files/default.settings.php#L252) `hash_salt` to an empty string: + +```php +$settings['hash_salt'] = ''; +``` + +In the past, Platform.sh templates have overridden this value: + +```php +$settings['hash_salt'] = $settings['hash_salt'] ?? $platformsh->projectEntropy; +``` + +This setting was insufficient to cover some user configurations - such as those cases when an application depends on a `Null` value for `hash_salt`. + +Now, the setting looks like this in `settings.platformsh.php`: + +```bash +$settings['hash_salt'] = empty($settings['hash_salt']) ? $platformsh->projectEntropy : $settings['hash_salt']; +``` + +This change sets `hash_salt` to the built-in environment variable `PLATFORM_PROJECT_ENTROPY` value if the project contains the default settings OR `Null`. +If your application code *depends* on an empty value, feel free to comment out that line, or reset again later in that file. + +Feel free to visit [`platformsh-templates/drupal9#73`](https://github.com/platformsh-templates/drupal9/pull/73) for more details on this discussion. + +
+ + + + +### Blackfire.io: creating a Continuous Observability Strategy + +This template includes a starting [`.blackfire.yml`](.blackfire.yml) file that can be used to enable [Application Performance Monitoring](https://blackfire.io/docs/monitoring-cookbooks/index), [Profiling](https://blackfire.io/docs/profiling-cookbooks/index), [Builds](https://blackfire.io/docs/builds-cookbooks/index) and [Performance Testing](https://blackfire.io/docs/testing-cookbooks/index) on your project. Platform.sh comes with Blackfire pre-installed on application containers, and [setting up requires minimal configuration](https://docs.platform.sh/integrations/observability/blackfire.html). + +* [What is Blackfire?](https://blackfire.io/docs/introduction) +* [Configuring Blackfire.io on a Platform.sh project](https://docs.platform.sh/integrations/observability/blackfire.html) +* [Blackfire.io Platform.sh documentation](https://blackfire.io/docs/integrations/paas/platformsh) +* [Profiling Cookbooks](https://blackfire.io/docs/profiling-cookbooks/index) +* [Monitoring Cookbooks](https://blackfire.io/docs/monitoring-cookbooks/index) +* [Testing Cookbooks](https://blackfire.io/docs/testing-cookbooks/index) +* [Using Builds](https://blackfire.io/docs/builds-cookbooks/index) +* [Configuring Integrations](https://blackfire.io/docs/integrations/index) + + +### Resources + + +- [Drupal](https://www.drupal.org/) +- [Drupal 9 on Platform.sh](https://docs.platform.sh/guides/drupal9/deploy.html) +- [Platform.sh PHP documentation](https://docs.platform.sh/languages/php.html) + + + +### Contact + +This template is maintained by the Platform.sh Developer Relations team, and they will be notified of all issues and pull requests you open here. + +- **Community:** Share your question with the community, or see if it's already been asked on our [Community site](https://community.platform.sh). +- **Slack:** If you haven't done so already, you can join Platform.sh's [public Slack](https://chat.platform.sh/) channels and ping the `@devrel_team` with any questions. + + +### About Platform.sh + +This template has been specifically designed to deploy on Platform.sh. + +
+What is Platform.sh?
+ +Platform.sh is a unified, secure, enterprise-grade platform for building, running and scaling web applications. We’re the leader in Fleet Ops: Everything you need to manage your fleet of websites and apps is available from the start. Because infrastructure and workflows are handled from the start, apps just work, so teams can focus on what really matters: making faster changes, collaborating confidently, and scaling responsibly. Whether managing a fleet of ten or ten thousand sites and apps, Platform.sh is the Developer- preferred solution that scales right. + +Our key features include: + +* **GitOps: Git as the source of truth** + + Every branch becomes a development environment, and nothing can change without a commit. + +* **Batteries included: Managed infrastructure** + + [Simple abstraction in YAML](https://docs.platform.sh/configuration/yaml.html) for [committing and configuring infrastructure](https://docs.platform.sh/overview/structure.html), fully managed patch updates, and 24 [runtimes](https://docs.platform.sh/languages.html) & [services](https://docs.platform.sh/configuration/services.html) that can be added with a single line of code. + +* **Instant cloning: Branch, merge, repeat** + + [Reusable builds](https://docs.platform.sh/overview/build-deploy.html) and automatically inherited production data provide true staging environments - experiment in isolation, test, then destroy or merge. + +* **FleetOps: Fleet management platform** + + Leverage our public API along with custom tools like [Source Operations](https://docs.platform.sh/configuration/app/source-operations.html) and [Activity Scripts](https://docs.platform.sh/integrations/activity.html) to [manage thousands of applications](https://youtu.be/MILHG9OqhmE) - their dependency updates, fresh content, and upstream code. + + +To find out more, check out the demo below and go to our [website](https://platform.sh/product/). + +
+

+The Platform.sh demo +

+ + +
+ + + +## Contribute + +

Help us keep top-notch templates!

+ +Every one of our templates is open source, and they're important resources for users trying to deploy to Platform.sh for the first time or better understand the platform. They act as getting started guides, but also contain a number of helpful tips and best practices when working with certain languages and frameworks. + +See something that's wrong with this template that needs to be fixed? Something in the documentation unclear or missing? Let us know! + +

+How to contribute +

+Report a bug       +Submit a feature request       +Open a pull request       +
+

+
+

+Need help? +

+Ask the Platform.sh Community       +Join us on Slack       +
+

+
+

Thanks to all of our amazing contributors!

+
+

+ + + +

+ +

+Made with contrib.rocks +

-* [Drupal](https://www.drupal.org/) -* [Drupal on Platform.sh](https://docs.platform.sh/frameworks/drupal8.html) -* [PHP on Platform.sh](https://docs.platform.sh/languages/php.html) +
diff --git a/templates/drupal9/files/drush/platformsh_generate_drush_yml.php b/templates/drupal9/files/drush/platformsh_generate_drush_yml.php index 19f09554f..9dbb98c17 100644 --- a/templates/drupal9/files/drush/platformsh_generate_drush_yml.php +++ b/templates/drupal9/files/drush/platformsh_generate_drush_yml.php @@ -31,7 +31,7 @@ function _platformsh_drush_site_url() { return [!$a['primary'], strpos($a['url'], 'https://') !== 0, strlen($a['url'])] <=> - [!$a['primary'], strpos($a['url'], 'https://') !== 0, strlen($b['url'])]; + [!$b['primary'], strpos($b['url'], 'https://') !== 0, strlen($b['url'])]; }); // Return the url of the first one. diff --git a/templates/drupal9/files/header.svg b/templates/drupal9/files/header.svg new file mode 100644 index 000000000..9e8219f59 --- /dev/null +++ b/templates/drupal9/files/header.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/templates/drupal9/files/web/sites/default/settings.platformsh.php b/templates/drupal9/files/web/sites/default/settings.platformsh.php index 4f1abe58c..6cd54fb17 100644 --- a/templates/drupal9/files/web/sites/default/settings.platformsh.php +++ b/templates/drupal9/files/web/sites/default/settings.platformsh.php @@ -108,7 +108,7 @@ // Set the project-specific entropy value, used for generating one-time // keys and such. - $settings['hash_salt'] = $settings['hash_salt'] ?? $platformsh->projectEntropy; + $settings['hash_salt'] = empty($settings['hash_salt']) ? $platformsh->projectEntropy : $settings['hash_salt']; // Set the deployment identifier, which is used by some Drupal cache systems. $settings['deployment_identifier'] = $settings['deployment_identifier'] ?? $platformsh->treeId; @@ -128,26 +128,26 @@ $parts = explode(':', $name); list($prefix, $key) = array_pad($parts, 3, null); switch ($prefix) { - // Variables that begin with `d8settings` or `drupal` get mapped + // Variables that begin with `drupalsettings` or `drupal` get mapped // to the $settings array verbatim, even if the value is an array. - // For example, a variable named d8settings:example-setting' with + // For example, a variable named drupalsettings:example-setting' with // value 'foo' becomes $settings['example-setting'] = 'foo'; case 'drupalsettings': case 'drupal': $settings[$key] = $value; break; - // Variables that begin with `d8config` get mapped to the $config + // Variables that begin with `drupalconfig` get mapped to the $config // array. Deeply nested variable names, with colon delimiters, // get mapped to deeply nested array elements. Array values // get added to the end just like a scalar. Variables without // both a config object name and property are skipped. - // Example: Variable `d8config:conf_file:prop` with value `foo` becomes + // Example: Variable `drupalconfig:conf_file:prop` with value `foo` becomes // $config['conf_file']['prop'] = 'foo'; - // Example: Variable `d8config:conf_file:prop:subprop` with value `foo` becomes + // Example: Variable `drupalconfig:conf_file:prop:subprop` with value `foo` becomes // $config['conf_file']['prop']['subprop'] = 'foo'; - // Example: Variable `d8config:conf_file:prop:subprop` with value ['foo' => 'bar'] becomes + // Example: Variable `drupalconfig:conf_file:prop:subprop` with value ['foo' => 'bar'] becomes // $config['conf_file']['prop']['subprop']['foo'] = 'bar'; - // Example: Variable `d8config:prop` is ignored. + // Example: Variable `drupalconfig:prop` is ignored. case 'drupalconfig': if (count($parts) > 2) { $temp = &$config[$key]; diff --git a/templates/drupal9/info/info.yaml b/templates/drupal9/info/info.yaml new file mode 100644 index 000000000..f70b4a796 --- /dev/null +++ b/templates/drupal9/info/info.yaml @@ -0,0 +1,93 @@ +title: "Deploy Drupal 9 on Platform.sh" +id: platformsh/drupal9 +profile: Drupal 9 +name: Drupal 9 +default_branch: master +tags: + - PHP + - Drupal + - CMS + - Symfony +related_blog_tags: + - Drupal +license: + type: "MIT" + location: "LICENSE" +features: + - PHP 8.0 + - MariaDB 10.4 + - Redis 6 + - Drush included + - Automatic TLS certificates + - Composer-based build +# Use Markdown for links and formatting. They will be converted to HTML automatically when the .platform.template.yaml file is generated. +description: + - This template builds Drupal 9 using the "Drupal Recommended" Composer project. It is pre-configured to use MariaDB and Redis for caching. The Drupal installer will skip asking for database credentials as they are already provided. + - Drupal is a flexible and extensible PHP-based CMS framework. +logo: + link: "https://www.drupal.org/" + images: + - "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNi4yIDMuOUMxNi4yIDMuOSAxNC44MiAzLjMgMTQuMDQgMi44MkMxNC4wNCAyLjgyIDEzLjAyIDIuMjIgMTEuMzQgMEMxMS4zNCAwIDExLjQgMi41MiA4LjcgMy44NEM0LjQ0IDUuNTIgMS44IDkuMDYgMS44IDEzLjU2QzEuOCAxOS4yNiA2LjQ4IDIzLjk0IDEyLjE4IDIzLjk0QzE3Ljk0IDIzLjk0IDIyLjU2IDE5LjI2IDIyLjU2IDEzLjU2QzIyLjYyIDYuNiAxNi4yIDMuOSAxNi4yIDMuOVpNNC42OCA5LjZDMy4wNiA5Ljk2IDMuMTggOS4xMiAzLjQ4IDguNEMzLjYgNy45OCA0LjAyIDcuNSA0LjAyIDcuNUM1LjEgNS43NiA3LjUgNC41IDcuNSA0LjVDNy44IDQuMzggOC4zNCA0LjA4IDguODIgMy44NEM5Ljc4IDMuMyAxMC4wMiAzIDEwLjAyIDNDMTEuNCAxLjY4IDExLjI4IDAuMDYgMTEuMjggMEMxMi40OCAyLjQgMTEuMDQgMy40OCAxMS4wNCAzLjQ4QzExLjQgMy44NCAxMS4yOCA0LjIgMTEuMjggNC4yQzkuNDIgOC4yMiA0LjY4IDkuNiA0LjY4IDkuNlpNMTcuMjIgMjIuMkMxNy4xIDIyLjI2IDE1LjYgMjIuOTggMTMuODYgMjIuOThDMTIuOSAyMi45OCAxMS44OCAyMi43NCAxMC45OCAyMi4xNEMxMC42OCAyMS45IDEwLjU2IDIxLjQ4IDEwLjc0IDIxLjE4QzEwLjggMjEuMDYgMTEuMTYgMjAuNjQgMTIgMjEuMThDMTIuMDYgMjEuMjQgMTQuMDQgMjIuNTYgMTcuMSAyMC44OEMxNy4zNCAyMC43NiAxNy42NCAyMC44MiAxNy43NiAyMS4wNkMxNy45NCAyMS4zIDE4IDIxLjc4IDE3LjIyIDIyLjJaTTEzLjAyIDE5LjY4TDEzLjA4IDE5LjYyQzEzLjE0IDE5LjU2IDE0LjE2IDE4LjI0IDE1LjY2IDE4LjQyQzE1LjkgMTguNDIgMTYuNzQgMTguNDggMTcuMjggMTkuNUMxNy4zNCAxOS42MiAxNy40NiAyMC4wNCAxNy4yMiAyMC4zNEMxNy4xIDIwLjQ2IDE2LjkyIDIwLjU4IDE2LjU2IDIwLjQ2QzE2LjMyIDIwLjQgMTYuMiAyMC4xNiAxNi4yIDIwLjA0QzE2LjE0IDE5Ljg2IDE2LjA4IDE5Ljc0IDE1LjQ4IDE5LjY4QzE1IDE5LjYyIDE0LjcgMTkuODYgMTQuMzQgMjAuMTZDMTQuMTYgMjAuMzQgMTMuOTIgMjAuNTIgMTMuNjggMjAuNThDMTMuNjIgMjAuNjQgMTMuNTYgMjAuNjQgMTMuNDQgMjAuNjRDMTMuMzIgMjAuNjQgMTMuMiAyMC41OCAxMy4wOCAyMC41MkMxMi45IDIwLjM0IDEyLjg0IDIwLjEgMTMuMDIgMTkuNjhaTTE5Ljg2IDE5LjhDMTkuODYgMTkuOCAxOS4zMiAxOS45OCAxOC43OCAxOS4zOEMxOC43OCAxOS4zOCAxNy4xNiAxNy41MiAxNi4zOCAxNy4yMkMxNi4zOCAxNy4yMiAxNS45IDE3LjA0IDE1LjMgMTcuMjhDMTUuMyAxNy4yOCAxNC44OCAxNy4zNCAxMy4yNiAxOC40MkMxMy4yNiAxOC40MiAxMC41IDIwLjE2IDkuMTIgMTkuOTJDOS4xMiAxOS45MiA2IDE5Ljk4IDYuNDIgMTYuNjhDNi40MiAxNi42OCA3LjA4IDEyLjk2IDExLjQgMTMuOEMxMS40IDEzLjggMTIuMzYgMTMuOTggMTQuMSAxNS4zNkMxNC4xIDE1LjM2IDE1LjMgMTYuMjYgMTUuOSAxNi4yNkMxNS45IDE2LjI2IDE2LjM4IDE2LjMyIDE3LjQ2IDE1LjY2QzE3LjQ2IDE1LjY2IDE5LjU2IDE0LjA0IDIwLjM0IDE0LjFDMjAuNDYgMTQuMSAyMS44NCAxNC4wNCAyMS44NCAxNi4zMkMyMS43OCAxNi4yNiAyMS44NCAxOC45IDE5Ljg2IDE5LjhaIiBmaWxsPSIjMDA4RUNFIi8+Cjwvc3ZnPgo=" +sections: + "create-project": "composer create-project platformsh/drupal9 -s dev" + metrics: false + blackfire: true + postinstall: "templates/drupal9/info/post_install.md" + local: + - "common/readme/drupal/local_ddev.md" + - "common/readme/drupal/local_lando.md" + resources: + - "[Drupal](https://www.drupal.org/)" + - "[Drupal 9 on Platform.sh](https://docs.platform.sh/guides/drupal9/deploy.html)" + - "[Platform.sh PHP documentation](https://docs.platform.sh/languages/php.html)" + migration: + mounts: + - "web/sites/default/files" + - "private" + files: + "web/sites/default/settings.platformsh.php": + - "**Added:**

" + - "Contains Platform.sh-specific configuration, namely setting up the database connection to the MariaDB service and caching via Redis." + "config/sync/.gitkeep": + - "**Added**" + "web/sites/default/settings.php": + - "**Updated:**

" + - "The Drupal settings file has been updated to import and use `web/sites/default/settings.platformsh.php`." + ".environment": + - "**Added:**

" + - file: "common/readme/file_descriptions/.environment.md" + - "Here, the Composer config and `PATH` are updated to allow executable app dependencies from Composer to be run from the path (i.e. `drush`)." + ".blackfire.yml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.blackfire.yml.md" + ".gitignore": + - "**Added:**

" + - "A `.gitignore` file is not included in the upstream, so one has been added." + ".lando.upstream.yml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.lando.upstream.yml.md" + ".platform.app.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.app.yaml.md" + - "This template uses Composer 2 to install dependencies using the default `composer` [build flavor](https://docs.platform.sh/languages/php.html#build-flavor) prior to the `build` hook." + - "Drush tasks are run during the `deploy` hook, and referenced again during the defined `cron` job." + "drush/platformsh_generate_drush_yml.php": + - "**Added:**

" + - "This file has been included to generate the drush yaml configuration on every deployment." + ".ddev/providers/platform.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.ddev.providers.platform.yaml.md" + "php.ini": + - "**Added:**

" + - file: "common/readme/drupal/php.ini.md" + ".platform/services.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.services.yaml.md" + - "In this template, MariaDB and Redis have been configured." + ".platform/routes.yaml": + - "**Added:**

" + - file: "common/readme/file_descriptions/.platform.routes.yaml.md" + troubleshoot: + - file: "common/readme/troubleshoot_ssh.md" + - file: "common/readme/drupal/troubleshoot_cache.md" + - file: "common/readme/drupal/troubleshoot_hashsalt.md" diff --git a/templates/drupal9/info/local_nextjs.md b/templates/drupal9/info/local_nextjs.md new file mode 100644 index 000000000..5a5ec58d4 --- /dev/null +++ b/templates/drupal9/info/local_nextjs.md @@ -0,0 +1,24 @@ +
+Next.js: building the frontend locally
+ +After you have created a new environment, you can connect to a backend Drupal instance and develop the frontend locally with the following steps. + +1. `cd client` +1. Update the environment variables for the current environment by running `./get_local_config.sh`. This will pull the generated `.env.local` file for the current environment. + + ```bash + # This .env file is generated programmatically within the backend Drupal app for each Platform.sh environment + # and stored within an network storage mount so it can be used locally. + + NEXT_PUBLIC_DRUPAL_BASE_URL=https://api.ENVIRONMENT-HASH-PROJECTID.REGION.platformsh.site + NEXT_IMAGE_DOMAIN=api.ENVIRONMENT-HASH-PROJECTID.REGION.platformsh.site + DRUPAL_SITE_ID=nextjs_site + DRUPAL_FRONT_PAGE=/node + DRUPAL_CLIENT_ID=CONSUMER_CLIENT_ID + DRUPAL_CLIENT_SECRET=GENERATED_SECRET + ``` + +1. Install dependencies: `yarn --frozen-lockfile`. +1. Run the development server: `yarn dev`. Next.js will then run on http://localhost:3000. + +
diff --git a/templates/drupal9/info/post_install.md b/templates/drupal9/info/post_install.md new file mode 100644 index 000000000..795b018e1 --- /dev/null +++ b/templates/drupal9/info/post_install.md @@ -0,0 +1,3 @@ +### Post-install + +Run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided. diff --git a/update_template.sh b/update_template.sh new file mode 100755 index 000000000..e88862ba9 --- /dev/null +++ b/update_template.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +TEMPLATE=$1 +echo $TEMPLATE + +# Create a build dir. +poetry run doit cleanup:$TEMPLATE +poetry run doit init:$TEMPLATE +poetry run doit update:$TEMPLATE +poetry run doit platformify:$TEMPLATE + +# Update migrations. +poetry run python migrate.py $TEMPLATE + +# Update the README and header image. +poetry run python readme-builder.py $TEMPLATE + +# Update the template and push it. +poetry run doit full:$TEMPLATE \ No newline at end of file