diff --git a/README-MAINTENANCE.md b/README-MAINTENANCE.md index 4229201..67356d6 100644 --- a/README-MAINTENANCE.md +++ b/README-MAINTENANCE.md @@ -6,30 +6,90 @@ The structure and usage of this repository is influenced by other, official dock **This is important!** -Never ever change a file/folder inside a directory without a `.` at the beginning (`2018.05-rc`, ...). +The `update.sh` script automatically deletes all non-`.`-directories (= version directories) at first. + +Never ever change a file/folder inside a directory without a `.` a t the beginning (`2018.05-rc`, ...). This folder will get updated automatically based on the templates you want to change. All changes in such folders will get overwritten during an update. -# Maintenance scripts +# How to update -# `update.sh` +This section describes how to update the official Friendica docker images. +The official docker image is available at https://hub.docker.com/_/friendica. + +## How to update the Docker Image + +1. Review your changes based on the official Docker [Review guidelines](https://github.com/docker-library/official-images#review-guidelines). +2. Check for a new stable version (see chapter `generate-stackbrew-library.sh`) +3. Check if you have to adjust the minimum version (see chapter `update.sh`) +4. Check if all tests are green (common issue: you forgot to commit all changes because of `update.sh`) +5. Check if all commits are available at the stable branch (= all required PRs are committed into stable) +6. Download & install [`bashbrew`](https://github.com/docker-library/bashbrew) +7. Execute `generate-stackbrew-library.sh` +8. Copy the output & overwrite the whole official Friendica [docker manifest](https://github.com/docker-library/official-images/blob/master/library/friendica). +9. Create a new PR at https://github.com/docker-library/official-images/pulls + +After the PR is merged, the images aren't immediately available, they've to get build. +Check the official Docker Continuous Deployment server https://doi-janky.infosiftr.net/job/multiarch/ for the current status of the builds. + +## How to update the docker hub description + +1. At first, read https://github.com/docker-library/docs#how-do-i-update-an-images-docs +2. Checkout & change the content of https://github.com/docker-library/docs/tree/master/friendica +3. Create a new Pull Request at https://github.com/docker-library/docs/pulls + +# Tools & Scripts + +## Github Action + +GitHub Actions helps to automate tasks for Continuous Integration (= autotest docker images) and Continuous Deployment (= autocreate docker images based on the friendica upstream). + +For mor details see [Introduction to github actions](https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/introduction-to-github-actions). + +### [`update-sh.yml`](https://github.com/friendica/docker/blob/stable/.github/workflows/update-sh.yml) + +This script is a cronjob every 15 minutes and automatically runs `update.sh`. +In case there are changes because of `update.sh`, it starts `images.yml`. + +### [`images.yml`](https://github.com/friendica/docker/blob/stable/.github/workflows/images.yml) + +This script automatically creates autotests actions based on the docker image version structure and variants. +For example if there are two versions (like `2021.03-dev` and `2021.01`), it would create 3 runs (apache, apache-fpm, fpm-alpine) for each version, having 6 runs at all. + +Therefore, the script uses the official docker github action tool [`bashbrew`](https://github.com/docker-library/bashbrew.git) to transform the repository version structure into github action commands + +This workflow is automatically executed because of a PR, a commit to `stable` or if the cronjob has found new updates. + +## Maintenance scripts + +### [`update.sh`](https://github.com/friendica/docker/blob/stable/update.sh) -Creates a directory and the necessary files for each combination of version (2018.05-rc, 3.6, ...) and variant (apache, fpm, fpm-alpine): +Creates a directory, and the necessary files for each combination of version (2018.05-rc, 3.6, ...) and variant (apache, fpm, fpm-alpine): - Creating the right `Dockerfile` (from one of the two *.template files) - Copy each config file in `.config/` - Recreating the version/variant environment in `.travis.yml` + +All possible Friendica versions are retrieved from https://files.friendi.ca/. + +#### Version patterns + +The update script parses the source https://files.friendi.ca/ automatically based on these patterns: +- stable: `friendica-full-%YYYY%.%MM%.tar.gz` (e.g. `friendica-full-2021.10.tar.gz`) +- dev/rc: `friendica-full-%YYYY%.%MM%-dev/rc.tar.gz` (e.g. `friendica-full-2021.10-dev.tar.gz`) +- hotfix: `friendica-full-%YYYY%.%MM%-%i.tar.gz` (e.g. `friendica-full-2021.10-01.tar.gz`) -If you want to update the Docker-images to a newer version, just change the list in `update.sh` at -```shell -versions=( - 2018.05-rc -) -``` - -# `generate-stackbrew-library.sh` - -This file automatically creates a "manifest" for the docker-images. +Any other pattern will completely be ignored(!) + +#### Minimum version + +Please adjust the `min_version` variable. +It contains the minimum supported version, which will automatically be available as a docker image. +Any other versions lower than this won't be available from the official docker hub anymore. + +### [`generate-stackbrew-library.sh`](https://github.com/friendica/docker/blob/stable/generate-stackbrew-library.sh) + +This file creates a "manifest" for the docker-images. This "manifest" is used to create a new PR in the official-images [repository](https://github.com/docker-library/official-images/) for deploying the changes to the docker hub. Like: @@ -54,3 +114,9 @@ GitCommit: b46fae917321394e1482df59dc4e39daffbe5c59 Directory: 2018.05-rc/fpm-alpine This is the input-file for the official-images in a later step :-) ``` + +#### Release channels + +Please adjust the `release_channel` array. +It maps additional tags onto docker image versions. +Most important is the `stable` tag.