Change all references of 2.x to 3.x in code, docs, and workflows.
This commit is contained in:
parent
ac64b7ce27
commit
e417ee9ad6
|
@ -4,13 +4,13 @@ on:
|
|||
- cron: '0 8 * * *' # Run at 8AM UTC.
|
||||
push:
|
||||
branches:
|
||||
- '2.x'
|
||||
- '2.x-**'
|
||||
- '3.x'
|
||||
- '3.x-**'
|
||||
tags:
|
||||
- '2.*'
|
||||
- '3.*'
|
||||
pull_request:
|
||||
branches:
|
||||
- '2.x'
|
||||
- '3.x'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -22,7 +22,7 @@ jobs:
|
|||
- name: Set default FARMOS_REPO and FARMOS_VERSION.
|
||||
run: |
|
||||
echo "FARMOS_REPO=${GITHUB_REPOSITORY}" >> $GITHUB_ENV
|
||||
echo "FARMOS_VERSION=2.x" >> $GITHUB_ENV
|
||||
echo "FARMOS_VERSION=3.x" >> $GITHUB_ENV
|
||||
- name: Set FARMOS_VERSION for branch push event.
|
||||
if: github.event_name == 'push' && github.ref_type == 'branch'
|
||||
run: echo "FARMOS_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
|
||||
|
@ -34,27 +34,27 @@ jobs:
|
|||
run: |
|
||||
echo "FARMOS_VERSION=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
|
||||
echo "FARMOS_REPO=${{ github.event.pull_request.head.repo.full_name }}" >> $GITHUB_ENV
|
||||
- name: Build and save farmOS 2.x Docker image
|
||||
- name: Build and save farmOS Docker image
|
||||
run: |
|
||||
docker build --build-arg FARMOS_REPO=https://github.com/${FARMOS_REPO} --build-arg FARMOS_VERSION=${FARMOS_VERSION} -t farmos/farmos:2.x docker
|
||||
docker save farmos/farmos:2.x > /tmp/farmos-2x.tar
|
||||
- name: Cache farmOS 2.x Docker image
|
||||
docker build --build-arg FARMOS_REPO=https://github.com/${FARMOS_REPO} --build-arg FARMOS_VERSION=${FARMOS_VERSION} -t farmos/farmos:3.x docker
|
||||
docker save farmos/farmos:3.x > /tmp/farmos.tar
|
||||
- name: Cache farmOS Docker image
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/farmos-2x.tar
|
||||
key: farmos-2x-${{ github.run_id }}
|
||||
path: /tmp/farmos.tar
|
||||
key: farmos-${{ github.run_id }}
|
||||
# This builds the dev Docker image using the specified FARMOS_VERSION,
|
||||
# but notably it does NOT override the default PROJECT_VERSION, so the
|
||||
# farmOS Composer project 2.x branch is always used.
|
||||
- name: Build and save farmOS 2.x-dev Docker image
|
||||
# farmOS Composer project 3.x branch is always used.
|
||||
- name: Build and save farmOS dev Docker image
|
||||
run: |
|
||||
docker build --build-arg FARMOS_REPO=https://github.com/${FARMOS_REPO} --build-arg FARMOS_VERSION=${FARMOS_VERSION} -t farmos/farmos:2.x-dev docker/dev
|
||||
docker save farmos/farmos:2.x-dev > /tmp/farmos-2x-dev.tar
|
||||
- name: Cache farmOS 2.x-dev Docker image
|
||||
docker build --build-arg FARMOS_REPO=https://github.com/${FARMOS_REPO} --build-arg FARMOS_VERSION=${FARMOS_VERSION} -t farmos/farmos:3.x-dev docker/dev
|
||||
docker save farmos/farmos:3.x-dev > /tmp/farmos-dev.tar
|
||||
- name: Cache farmOS dev Docker image
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/farmos-2x-dev.tar
|
||||
key: farmos-2x-dev-${{ github.run_id }}
|
||||
path: /tmp/farmos-dev.tar
|
||||
key: farmos-dev-${{ github.run_id }}
|
||||
outputs:
|
||||
farmos_version: ${{ env.FARMOS_VERSION }}
|
||||
sniff:
|
||||
|
@ -64,21 +64,21 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Restore farmOS 2.x-dev Docker image from cache
|
||||
- name: Restore farmOS dev Docker image from cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/farmos-2x-dev.tar
|
||||
key: farmos-2x-dev-${{ github.run_id }}
|
||||
- name: Load farmos/farmos:2.x-dev image
|
||||
run: docker load < /tmp/farmos-2x-dev.tar
|
||||
path: /tmp/farmos-dev.tar
|
||||
key: farmos-dev-${{ github.run_id }}
|
||||
- name: Load farmos/farmos:3.x-dev image
|
||||
run: docker load < /tmp/farmos-dev.tar
|
||||
- name: Run PHP CodeSniffer
|
||||
run: docker run farmos/farmos:2.x-dev phpcs /opt/drupal/web/profiles/farm
|
||||
run: docker run farmos/farmos:3.x-dev phpcs /opt/drupal/web/profiles/farm
|
||||
- name: Run PHPStan
|
||||
run: docker run farmos/farmos:2.x-dev phpstan analyze --memory-limit 1G /opt/drupal/web/profiles/farm
|
||||
run: docker run farmos/farmos:3.x-dev phpstan analyze --memory-limit 1G /opt/drupal/web/profiles/farm
|
||||
- name: Check PHP compatibility of contrib modules and themes (ignore warnings).
|
||||
run: |
|
||||
docker run farmos/farmos:2.x-dev phpcs --standard=PHPCompatibility --runtime-set testVersion 7.4- --warning-severity=0 /opt/drupal/web/modules
|
||||
docker run farmos/farmos:2.x-dev phpcs --standard=PHPCompatibility --runtime-set testVersion 7.4- --warning-severity=0 /opt/drupal/web/themes
|
||||
docker run farmos/farmos:3.x-dev phpcs --standard=PHPCompatibility --runtime-set testVersion 7.4- --warning-severity=0 /opt/drupal/web/modules
|
||||
docker run farmos/farmos:3.x-dev phpcs --standard=PHPCompatibility --runtime-set testVersion 7.4- --warning-severity=0 /opt/drupal/web/themes
|
||||
test:
|
||||
name: Run PHPUnit tests
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -104,13 +104,13 @@ jobs:
|
|||
run: echo "matrix.dbms=${{ matrix.dbms }}, matrix.DB_URL=${{ matrix.DB_URL }}"
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Restore farmOS 2.x-dev Docker image from cache
|
||||
- name: Restore farmOS dev Docker image from cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/farmos-2x-dev.tar
|
||||
key: farmos-2x-dev-${{ github.run_id }}
|
||||
- name: Load farmos/farmos:2.x-dev image
|
||||
run: docker load < /tmp/farmos-2x-dev.tar
|
||||
path: /tmp/farmos-dev.tar
|
||||
key: farmos-dev-${{ github.run_id }}
|
||||
- name: Load farmos/farmos:3.x-dev image
|
||||
run: docker load < /tmp/farmos-dev.tar
|
||||
# Build a new docker-compose.yml file from docker-compose.testing.common + docker-compose.testing.{dbms}.yml.
|
||||
# Copy to the current directory so that farmOS volume mounts don't change to the docker/www folder.
|
||||
- name: Create docker-compose.yml
|
||||
|
@ -140,15 +140,15 @@ jobs:
|
|||
steps:
|
||||
- name: Set FARMOS_VERSION from previous output.
|
||||
run: echo "FARMOS_VERSION=${{ needs.build.outputs.farmos_version }}" >> $GITHUB_ENV
|
||||
- name: Restore farmOS 2.x Docker image from cache
|
||||
- name: Restore farmOS Docker image from cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/farmos-2x.tar
|
||||
key: farmos-2x-${{ github.run_id }}
|
||||
- name: Load farmos/farmos:2.x image
|
||||
run: docker load < /tmp/farmos-2x.tar
|
||||
path: /tmp/farmos.tar
|
||||
key: farmos-${{ github.run_id }}
|
||||
- name: Load farmos/farmos:3.x image
|
||||
run: docker load < /tmp/farmos.tar
|
||||
- name: Run farmOS Docker container
|
||||
run: docker run --rm -v /tmp/farmOS:/opt/drupal farmos/farmos:2.x true
|
||||
run: docker run --rm -v /tmp/farmOS:/opt/drupal farmos/farmos:3.x true
|
||||
- name: Create artifact
|
||||
run: cd /tmp && tar -czf farmOS-${FARMOS_VERSION}.tar.gz farmOS
|
||||
- name: Create GitHub release
|
||||
|
@ -161,9 +161,9 @@ jobs:
|
|||
prerelease: false
|
||||
publish:
|
||||
name: Publish to Docker Hub
|
||||
# We only publish to Docker Hub if this is a tag or 2.x branch push event
|
||||
# We only publish to Docker Hub if this is a tag or 3.x branch push event
|
||||
# to the official repository.
|
||||
if: github.repository == 'farmOS/farmOS' && github.event_name == 'push' && (github.ref_type == 'tag' || (github.ref_type == 'branch' && needs.build.outputs.farmos_version == '2.x'))
|
||||
if: github.repository == 'farmOS/farmOS' && github.event_name == 'push' && (github.ref_type == 'tag' || (github.ref_type == 'branch' && needs.build.outputs.farmos_version == '3.x'))
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
|
@ -172,32 +172,32 @@ jobs:
|
|||
steps:
|
||||
- name: Set FARMOS_VERSION from previous output.
|
||||
run: echo "FARMOS_VERSION=${{ needs.build.outputs.farmos_version }}" >> $GITHUB_ENV
|
||||
- name: Restore farmOS 2.x Docker image from cache
|
||||
- name: Restore farmOS Docker image from cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/farmos-2x.tar
|
||||
key: farmos-2x-${{ github.run_id }}
|
||||
- name: Load farmos/farmos:2.x image
|
||||
run: docker load < /tmp/farmos-2x.tar
|
||||
- name: Restore farmOS 2.x-dev Docker image from cache
|
||||
path: /tmp/farmos.tar
|
||||
key: farmos-${{ github.run_id }}
|
||||
- name: Load farmos/farmos:3.x image
|
||||
run: docker load < /tmp/farmos.tar
|
||||
- name: Restore farmOS dev Docker image from cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/farmos-2x-dev.tar
|
||||
key: farmos-2x-dev-${{ github.run_id }}
|
||||
- name: Load farmos/farmos:2.x-dev image
|
||||
run: docker load < /tmp/farmos-2x-dev.tar
|
||||
path: /tmp/farmos-dev.tar
|
||||
key: farmos-dev-${{ github.run_id }}
|
||||
- name: Load farmos/farmos:3.x-dev image
|
||||
run: docker load < /tmp/farmos-dev.tar
|
||||
- name: Login to Docker Hub.
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
# If the 2.x branch was pushed...
|
||||
- name: Publish farmos/farmos:2.x image to Docker Hub.
|
||||
if: github.ref_type == 'branch' && env.FARMOS_VERSION == '2.x'
|
||||
run: docker push farmos/farmos:2.x
|
||||
- name: Publish farmos/farmos:2.x-dev image to Docker Hub.
|
||||
if: github.ref_type == 'branch' && env.FARMOS_VERSION == '2.x'
|
||||
run: docker push farmos/farmos:2.x-dev
|
||||
# If the 3.x branch was pushed...
|
||||
- name: Publish farmos/farmos:3.x image to Docker Hub.
|
||||
if: github.ref_type == 'branch' && env.FARMOS_VERSION == '3.x'
|
||||
run: docker push farmos/farmos:3.x
|
||||
- name: Publish farmos/farmos:3.x-dev image to Docker Hub.
|
||||
if: github.ref_type == 'branch' && env.FARMOS_VERSION == '3.x'
|
||||
run: docker push farmos/farmos:3.x-dev
|
||||
# If a tag was pushed, tag the Docker image and push to Docker Hub.
|
||||
# If the tag is a valid semantic versioning string, also tag "latest".
|
||||
# Semver regex from https://github.com/semver/semver/issues/199#issuecomment-43640395
|
||||
|
@ -205,10 +205,10 @@ jobs:
|
|||
- name: Tag and publish farmos/farmos:{tag} image to Docker Hub.
|
||||
if: github.ref_type == 'tag'
|
||||
run: |
|
||||
docker tag farmos/farmos:2.x farmos/farmos:${{ env.FARMOS_VERSION }}
|
||||
docker tag farmos/farmos:3.x farmos/farmos:${{ env.FARMOS_VERSION }}
|
||||
docker push farmos/farmos:${{ env.FARMOS_VERSION }}
|
||||
if echo ${{ env.FARMOS_VERSION }} | grep -Pq '^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'; then
|
||||
docker tag farmos/farmos:2.x farmos/farmos:latest
|
||||
docker tag farmos/farmos:3.x farmos/farmos:latest
|
||||
docker push farmos/farmos:latest
|
||||
echo "ANNOUNCE_RELEASE=1" >> $GITHUB_ENV
|
||||
else
|
||||
|
|
|
@ -2,7 +2,7 @@ name: Trigger Netlify to build docs
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- '2.x'
|
||||
- '3.x'
|
||||
paths:
|
||||
- 'docs/**'
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
services:
|
||||
php:
|
||||
image: farmos/farmos:2.x-dev
|
||||
image: farmos/farmos:3.x-dev
|
||||
default: true
|
||||
depends: mysql
|
||||
commands:
|
||||
|
|
|
@ -3,9 +3,9 @@ FROM drupal:9.5
|
|||
|
||||
# Set the farmOS and composer project repository URLs and versions.
|
||||
ARG FARMOS_REPO=https://github.com/farmOS/farmOS.git
|
||||
ARG FARMOS_VERSION=2.x
|
||||
ARG FARMOS_VERSION=3.x
|
||||
ARG PROJECT_REPO=https://github.com/farmOS/composer-project.git
|
||||
ARG PROJECT_VERSION=2.x
|
||||
ARG PROJECT_VERSION=3.x
|
||||
|
||||
# Set Apache ServerName directive globally to suppress AH00558 message.
|
||||
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
|
||||
|
|
|
@ -26,13 +26,13 @@ export COMPOSER_HOME="$(mktemp -d)"
|
|||
# Add the farmOS repository to composer.json.
|
||||
composer config repositories.farmos git ${FARMOS_REPO}
|
||||
|
||||
# Require the correct farmOS version in composer.json. Defaults to 2.x.
|
||||
# Require the correct farmOS version in composer.json. Defaults to 3.x.
|
||||
# If FARMOS_VERSION is not a valid semantic versioning string, we assume that
|
||||
# it is a branch, and prepend it with "dev-".
|
||||
# Otherwise FARMOS_VERSION is a valid semantic versioning string. We assume
|
||||
# that it is a tagged version and require that version.
|
||||
if [ "${FARMOS_VERSION}" = "2.x" ]; then
|
||||
FARMOS_COMPOSER_VERSION="2.x-dev"
|
||||
if [ "${FARMOS_VERSION}" = "3.x" ]; then
|
||||
FARMOS_COMPOSER_VERSION="3.x-dev"
|
||||
elif [[ ! "${FARMOS_VERSION}" =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then
|
||||
FARMOS_COMPOSER_VERSION="dev-${FARMOS_VERSION}"
|
||||
fi
|
||||
|
@ -60,7 +60,7 @@ else
|
|||
fi
|
||||
|
||||
# Set the version in farm.info.yml.
|
||||
sed -i "s|version: 2.x|version: ${FARMOS_VERSION}|g" /var/farmOS/web/profiles/farm/farm.info.yml
|
||||
sed -i "s|version: 3.x|version: ${FARMOS_VERSION}|g" /var/farmOS/web/profiles/farm/farm.info.yml
|
||||
|
||||
# Remove the Composer cache directory.
|
||||
rm -rf "$COMPOSER_HOME"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# Inherit from the farmOS 2.x image.
|
||||
FROM farmos/farmos:2.x
|
||||
# Inherit from the farmOS 3.x image.
|
||||
FROM farmos/farmos:3.x
|
||||
|
||||
# Set the farmOS and composer project repository URLs and versions.
|
||||
ARG FARMOS_REPO=https://github.com/farmOS/farmOS.git
|
||||
ARG FARMOS_VERSION=2.x
|
||||
ARG FARMOS_VERSION=3.x
|
||||
ARG PROJECT_REPO=https://github.com/farmOS/composer-project.git
|
||||
ARG PROJECT_VERSION=2.x
|
||||
ARG PROJECT_VERSION=3.x
|
||||
|
||||
# Set OPcache's revalidation frequency to 0 seconds for development.
|
||||
# See https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq
|
||||
|
|
|
@ -14,7 +14,7 @@ services:
|
|||
www:
|
||||
depends_on:
|
||||
- db
|
||||
image: farmos/farmos:2.x-dev
|
||||
image: farmos/farmos:3.x-dev
|
||||
volumes:
|
||||
- './www:/opt/drupal'
|
||||
ports:
|
||||
|
|
|
@ -2,7 +2,7 @@ version: '3'
|
|||
services:
|
||||
www:
|
||||
# Update this to the latest stable version before deploying.
|
||||
image: farmos/farmos:2.x.y
|
||||
image: farmos/farmos:3.x.y
|
||||
volumes:
|
||||
- './sites:/opt/drupal/web/sites'
|
||||
ports:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
version: '3'
|
||||
services:
|
||||
www:
|
||||
image: farmos/farmos:2.x-dev
|
||||
image: farmos/farmos:3.x-dev
|
||||
volumes:
|
||||
- './www:/opt/drupal'
|
||||
environment:
|
||||
|
|
|
@ -45,7 +45,7 @@ authenticated user and the farmOS server:
|
|||
"farm": {
|
||||
"name": "Farm Name",
|
||||
"url": "https://farmos.site",
|
||||
"version": "2.x",
|
||||
"version": "3.x",
|
||||
"system_of_measurement": "metric"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,14 +10,14 @@ Available arguments and their default values are described below:
|
|||
- `FARMOS_REPO` - The farmOS Git repository URL.
|
||||
- Default: `https://github.com/farmOS/farmOS.git`
|
||||
- `FARMOS_VERSION` - The farmOS Git branch/tag/commit to check out.
|
||||
- Default: `2.x`
|
||||
- Default: `3.x`
|
||||
- `PROJECT_REPO` - The farmOS Composer project Git repository URL.
|
||||
- Default: `https://github.com/farmOS/composer-project.git`
|
||||
- `PROJECT_VERSION` - The farmOS Composer project Git branch/tag/commit to
|
||||
check out.
|
||||
- Default: `2.x`
|
||||
- Default: `3.x`
|
||||
|
||||
The `2.x-dev` image also provides the following:
|
||||
The `3.x-dev` image also provides the following:
|
||||
|
||||
- `WWW_DATA_ID` - The ID to use for the `www-data` user and group inside the
|
||||
image. Setting this to the ID of the developer's user on the host machine
|
||||
|
|
|
@ -6,8 +6,8 @@ documentation which is hosted at [http://farmOS.org](http://farmos.org).
|
|||
It uses [mkdocs](http://www.mkdocs.org) to convert simple markdown files into
|
||||
static HTML files.
|
||||
|
||||
To get started contributing to the farmOS 2.x documentation, fork
|
||||
[farmOS](https://github.com/farmOS/farmOS/tree/2.x) on Github. Then install mkdocs and
|
||||
To get started contributing to the farmOS documentation, fork
|
||||
[farmOS](https://github.com/farmOS/farmOS) on Github. Then install mkdocs and
|
||||
clone this repo:
|
||||
|
||||
$ brew install python # For OSX users
|
||||
|
@ -15,11 +15,10 @@ clone this repo:
|
|||
$ sudo pip install mkdocs mkdocs-material
|
||||
$ git clone https://github.com/farmOS/farmOS.git farmOS
|
||||
$ cd farmOS
|
||||
$ git checkout 2.x
|
||||
$ git remote add sandbox git@github.com:<username>/farmOS.git
|
||||
$ mkdocs serve
|
||||
|
||||
Your local farmOS 2.x documentation site should now be available for browsing:
|
||||
Your local farmOS documentation site should now be available for browsing:
|
||||
http://127.0.0.1:8000/. When you find a typo, an error, unclear or missing
|
||||
explanations or instructions, hit ctrl-c, to stop the server, and start editing.
|
||||
Find the page you’d like to edit; everything is in the docs/ directory. Make
|
||||
|
|
|
@ -11,7 +11,7 @@ Run the following commands to create a farmOS directory and set up Docker
|
|||
containers for farmOS and PostgreSQL:
|
||||
|
||||
mkdir farmOS && cd farmOS
|
||||
curl https://raw.githubusercontent.com/farmOS/farmOS/2.x/docker/docker-compose.development.yml -o docker-compose.yml
|
||||
curl https://raw.githubusercontent.com/farmOS/farmOS/3.x/docker/docker-compose.development.yml -o docker-compose.yml
|
||||
docker compose up -d
|
||||
|
||||
## 2. Install farmOS
|
||||
|
|
|
@ -59,5 +59,5 @@ Alternatively, the `XDEBUG_MODE` environment variable can be specified directly:
|
|||
docker compose exec -u www-data -T --env XDEBUG_MODE=off www phpunit --verbose --debug /opt/drupal/web/profiles/farm
|
||||
```
|
||||
|
||||
[run-tests.yml]: https://raw.githubusercontent.com/farmOS/farmOS/2.x/.github/workflows/run-tests.yml
|
||||
[docker-compose.development.yml]: https://raw.githubusercontent.com/farmOS/farmOS/2.x/docker/docker-compose.development.yml
|
||||
[run-tests.yml]: https://raw.githubusercontent.com/farmOS/farmOS/3.x/.github/workflows/run-tests.yml
|
||||
[docker-compose.development.yml]: https://raw.githubusercontent.com/farmOS/farmOS/3.x/docker/docker-compose.development.yml
|
||||
|
|
|
@ -18,8 +18,8 @@ otherwise it will be deleted.
|
|||
# Backup www volume, just in case.
|
||||
sudo tar -czf www.tar.gz www
|
||||
|
||||
# Pull latest 2.x-dev Docker image.
|
||||
docker pull farmos/farmos:2.x-dev
|
||||
# Pull latest 3.x-dev Docker image.
|
||||
docker pull farmos/farmos:3.x-dev
|
||||
|
||||
# Move directories.
|
||||
mv www/web/profiles ./profiles
|
||||
|
@ -37,7 +37,7 @@ mv ./sites www/web/sites
|
|||
|
||||
# Update farmOS profile.
|
||||
cd www/web/profiles/farm
|
||||
git checkout 2.x && git pull origin 2.x
|
||||
git checkout 3.x && git pull origin 3.x
|
||||
|
||||
# Run Drupal database updates.
|
||||
docker compose exec -u www-data www drush updb
|
||||
|
|
|
@ -161,7 +161,7 @@ Both methods expect an array of field definition options. These include:
|
|||
and will take precedence if it is set. Defaults to `1`.
|
||||
|
||||
Other options are available for more advanced use-cases. Refer to the
|
||||
[FarmFieldFactory](https://github.com/farmOS/farmOS/blob/2.x/modules/core/field/src/FarmFieldFactory.php)
|
||||
[FarmFieldFactory](https://github.com/farmOS/farmOS/blob/3.x/modules/core/field/src/FarmFieldFactory.php)
|
||||
class to understand how they work.
|
||||
|
||||
For more information and example code, see [Adding fields](/development/module/fields).
|
||||
|
|
|
@ -9,7 +9,7 @@ If you are looking for information about hosting farmOS, or contributing to
|
|||
the development, refer to the dedicated documentation on those topics:
|
||||
|
||||
- [Hosting farmOS](/hosting)
|
||||
- [Contributing to farmOS](https://github.com/farmOS/farmOS/blob/2.x/CONTRIBUTING.md)
|
||||
- [Contributing to farmOS](https://github.com/farmOS/farmOS/blob/3.x/CONTRIBUTING.md)
|
||||
|
||||
## Logging in
|
||||
|
||||
|
|
|
@ -185,13 +185,13 @@ more information.
|
|||
### Pinning versions
|
||||
|
||||
The `farmos/farmos` dependency in the farmOS project template `composer.json`
|
||||
defaults to `^2.0`, which means "the latest stable version of the 2.x branch".
|
||||
defaults to `^3.0`, which means "the latest stable version of the 3.x branch".
|
||||
|
||||
You may want to pin this (or other dependencies) to a specific version so that
|
||||
you can be very intentional with your upgrade process.
|
||||
|
||||
To pin the `farmos/farmos` dependency to a specific version (eg: `2.0.1`),
|
||||
replace `^2.0` with `2.0.1` and run `composer update --no-dev`.
|
||||
To pin the `farmos/farmos` dependency to a specific version (eg: `3.0.1`),
|
||||
replace `^3.0` with `3.0.1` and run `composer update --no-dev`.
|
||||
|
||||
To update pinned dependencies, simply update the version in `composer.json` and
|
||||
run `composer update --no-dev` again. Remember to run automated updates and
|
||||
|
@ -210,8 +210,8 @@ custom Docker images with your custom codebase.
|
|||
Example `Dockerfile`:
|
||||
|
||||
```Dockerfile
|
||||
# Inherit from the upsteam farmOS 2.x image.
|
||||
FROM farmos/farmos:2.x
|
||||
# Inherit from the upsteam farmOS 3.x image.
|
||||
FROM farmos/farmos:3.x
|
||||
|
||||
# Install `jq` to help in extracting the farmOS version below.
|
||||
RUN apt-get update && apt-get install -y jq
|
||||
|
@ -230,7 +230,7 @@ RUN (cd /var/farmOS; composer install --no-dev)
|
|||
# Set the version in farm.info.yml to match the version locked by Composer.
|
||||
# This is optional but is useful because the version will appear as the
|
||||
# "Installation Profile" version at `/admin/reports/status` in farmOS.
|
||||
RUN sed -i "s|version: 2.x|version: $(jq -r '.packages[] | select(.name == "farmos/farmos").version' /var/farmOS/composer.lock)|g" /var/farmOS/web/profiles/farm/farm.info.yml
|
||||
RUN sed -i "s|version: 3.x|version: $(jq -r '.packages[] | select(.name == "farmos/farmos").version' /var/farmOS/composer.lock)|g" /var/farmOS/web/profiles/farm/farm.info.yml
|
||||
|
||||
# Copy the farmOS codebase into /opt/drupal.
|
||||
RUN rm -r /opt/drupal && cp -rp /var/farmOS /opt/drupal
|
||||
|
|
|
@ -90,10 +90,10 @@ Official farmOS Docker images are available on Docker Hub:
|
|||
|
||||
This allows farmOS to be run in a Docker container with:
|
||||
|
||||
docker pull farmos/farmos:2.x.y
|
||||
docker run --rm -p 80:80 -v "${PWD}/sites:/opt/drupal/web/sites" farmos/farmos:2.x.y
|
||||
docker pull farmos/farmos:3.x.y
|
||||
docker run --rm -p 80:80 -v "${PWD}/sites:/opt/drupal/web/sites" farmos/farmos:3.x.y
|
||||
|
||||
Replace `2.x.y` with the desired version. Find the latest farmOS version on the
|
||||
Replace `3.x.y` with the desired version. Find the latest farmOS version on the
|
||||
[GitHub release page](https://github.com/farmOS/farmOS/releases). Using the
|
||||
`latest` Docker tag is not recommended, because updates require manual steps.
|
||||
See [Updating farmOS](/hosting/update) for more info.
|
||||
|
|
|
@ -6,6 +6,8 @@ farmOS 2.x includes a **farmOS Migrate** module that leverage's Drupal core's
|
|||
migrations for each asset type, log type, etc. These migrations are defined in
|
||||
YML configuration files included with the farmOS Migrate module.
|
||||
|
||||
... migrate to 2.x then upgrade to 3.x
|
||||
|
||||
## Important considerations
|
||||
|
||||
* Do not migrate into a farmOS 2.x instance that already has records. This is
|
||||
|
|
|
@ -93,8 +93,8 @@ Basic Data Streams do not define any type-specific fields.
|
|||
|
||||
Listener (Legacy) Data Streams have an additional "public key" attribute,
|
||||
which is used in the Data Stream's API endpoint for posting/getting data. This
|
||||
was used in farmOS 1.x to provide a unique ID for the sensor, separate from the
|
||||
Sensor Asset ID that housed the data. This is no longer needed in farmOS 2.x,
|
||||
was used in farmOS v1 to provide a unique ID for the sensor, separate from the
|
||||
Sensor Asset ID that housed the data. This is no longer needed in farmOS v2+,
|
||||
because each Data Stream has its own UUID, which is used in the API endpoints
|
||||
instead. The public key is retained for Legacy (Listener) Data Streams to
|
||||
ensure that existing sensors can continue to push data without needing to be
|
||||
|
|
|
@ -7,7 +7,7 @@ core_version_requirement: ^9
|
|||
project: farm
|
||||
|
||||
# This is automatically set during release packaging.
|
||||
version: 2.x
|
||||
version: 3.x
|
||||
|
||||
# Declare this profile a distribution and mark it as 'exclusive' so that it is
|
||||
# automatically selected during installation.
|
||||
|
|
Loading…
Reference in New Issue