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!
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.
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
-
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.
-
Install the Platform.sh CLI
curl -sS https://platform.sh/cli/installer | php
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
). -
Set the project remote
Find your
PROJECT_ID
by running the commandplatform 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
. -
Push
git push platform DEFAULT_BRANCH
Integrate with a GitHub repo and deploy pull requests
-
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
. -
Install the Platform.sh CLI
curl -sS https://platform.sh/cli/installer | php
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
). -
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
-
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.
-
Install the Platform.sh CLI
curl -sS https://platform.sh/cli/installer | php
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
). -
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.
-
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
-
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.
-
Install the Platform.sh CLI
curl -sS https://platform.sh/cli/installer | php
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
). -
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.
-
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.
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"
```
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:
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 for committing and configuring infrastructure, fully managed patch updates, and 24 runtimes & services that can be added with a single line of code.
-
Instant cloning: Branch, merge, repeat
Reusable builds 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 and Activity Scripts to manage thousands of applications - their dependency updates, fresh content, and upstream code.