Skip to content

Latest commit

 

History

History
244 lines (153 loc) · 11 KB

README.md

File metadata and controls

244 lines (153 loc) · 11 KB

farmos-platform-template

About

This template can be used to install farmOS on Platform.sh.

Out of the box this template builds a base farmOS instance. It is pre-configured to use PostgreSQL, php-geos and Drupal best practices using a composer workflow.

Much of this template and README is derived from the official Drupal 9 template provided by Platform.sh!

Getting started

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.

Other deployment options

For all of the other options below, clone this repository first:

git clone https://github.com/paul121/farm_contrib_template.git

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 button at the top of this page. Then you can clone a copy of your own repository locally.

Deploy directly to Platform.sh from the command line
  1. Create a free trial:

    Register for a 30 day free trial with Platform.sh. 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.

  2. Install the Platform.sh CLI

    Linux/OSX

    curl -sS https://platform.sh/cli/installer | php

    Windows

    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).

  3. Set the project remote

    Find your PROJECT_ID by running the command platform project:list

    +---------------+------------------------------------+------------------+---------------------------------+
    | 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.

  4. Push

    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. 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.

  2. Install the Platform.sh CLI

    Linux/OSX

    curl -sS https://platform.sh/cli/installer | php

    Windows

    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).

  3. Setup the integration:

    Consult the GitHub integration documentation 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. 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.

  2. Install the Platform.sh CLI

    Linux/OSX

    curl -sS https://platform.sh/cli/installer | php

    Windows

    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).

  3. 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.

  4. Setup the integration:

    Consult the GitLab integration documentation 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. 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.

  2. Install the Platform.sh CLI

    Linux/OSX

    curl -sS https://platform.sh/cli/installer | php

    Windows

    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).

  3. 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.

  4. Setup the integration:

    Consult the Bitbucket integration documentation to finish connecting a repository to a project on Platform.sh. You will need to create an Access token on Bitbucket to do so.

Installing farmOS

Once your code is deployed farmOS can be installed via the UI or CLI.

To install via the UI use the Drupal installer. Simply visit your project URL after the deploy is complete and it should redirect you to /install.php. You will not be asked for database credentials as those are already provided.

To install via the CLI Use the Drush site-install command after logging in to your production environment. Again, you will not be asked for database credentials as those are already provided.

```sh
platform ssh drush -- site:install --yes --site-name="$SITE_NAME" --site-mail="$SITE_MAIL" --account-mail="$ACCOUNT_MAIL" farm farm.modules="$MODULES"
```

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:

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: