Currently, GitHub Actions builds and deploys images in a methodology similar to how official Docker images are produced, specifically the WordPress image(s). One major difference is that
docker buildx
is used to produce the image sets.
phpCollab's build methodology is essentially a clone of the WordPress official Docker image. It's flow is basically:
update.sh
-> (not currently used) callsversions.sh
andapply-template.sh
.versions.sh
-> (not currently used) automatically creates/updates theversions.json
file, which is the parameter file for the rest of the process.versions.json
is manually maintained for phpCollab.apply-template.sh
-> creates folder and file layouts and processes theDocker.template
file for each image set.generate.sh
-> callsgenerate-stackbrew-library.sh
, which produces thebashbrew
input file.generate.sh
then and produces the command strategic/matrix used by GitHub Actions to build the desired permutation of images.
With the exceptions of the versions.json
file being manually maintained, the rest of the flow is automated via GitHub actions.
After a new release of phpCollab has been created and released, the Docker image repo needs to be touched.
Part of the release process generally requires a Linux (Ubuntu) environment. See the Local Builds -> "One-time" Setup section for details.
- Make any desired changes to the general source files:
Dockerfile.template
,docker-entrypoint*.sh
, etc. - Update the
versions.json
with at a minimum of the new phpCollab version and download hash.See the versions.json section for details.
- Run the following to propagate the changes to the raw image source:
./apply-template.sh
- Commit and push the changes to the GitHub repo.
- Check the build results on GitHub Actions and Docker Hub.
The build process generally requires a Linux (Ubuntu) environment. It's easy to create one with Docker.
-
Start a Docker container
docker run -it --rm -v $(pwd):/tmp/code ubuntu:latest
Note with
--rm
the container will be cleaned up upon exiting. -
In the container, run:
apt-get update -y \ && apt-get install -y curl gawk git jq wget \ && cd /tmp/code \ && curl -o bashbrew https://doi-janky.infosiftr.net/job/bashbrew/job/master/lastSuccessfulBuild/artifact/bashbrew-amd64 \ && chmod +x bashbrew; \ export PATH=".:$PATH"; \ export GITHUB_REPOSITORY=phpcollab
After making template file changes:
- Run the following to propagate the changes to the image set:
./apply-template.sh
- Commit (but not necessarily push).
- Create the build scripts.
./generate.sh
- From the host machine (that has
docker buildx
installed) run the appropriaterun
command from the output of the./generate.sh
script, for the desired image.
- Running
./generate-stackbrew-library.sh
can be helpful in viewing the bashbrew manifest used by thegenerate.sh
script, but do not commit this file. It will likely break the build.
Format:
{
"<label>": {
"phpVersions": ["<php_docker_image_versions>"],
"sha1": "<phpCollab_download_hash>",
"upstream": "<phpCollab_download_version>",
"variants": ["<php_docker_image_variants>"],
"version": "<phpCollab_docker_image_version>"
}
}
Example files:
-
Barebones (just php 7.4 on Apache):
{ "latest": { "phpVersions": ["7.4"], "sha1": "1f0a41545a28d12e7364167544c55ade7b7e7814", "upstream": "2.8.1", "variants": ["apache"], "version": "2.8.1" } }
-
A fairly complete, but only
latest
and nofpm-alpine
:{ "latest": { "phpVersions": ["8.0", "7.4", "7.3"], "sha1": "1f0a41545a28d12e7364167544c55ade7b7e7814", "upstream": "2.8.1", "variants": ["apache", "fpm"], "version": "2.8.1" } }
-
Complete (lots of possibilites):
{ "beta": { "phpVersions": ["8.0", "7.4", "7.3"], "sha1": "1f0a41545a28d12e7364167544c55ade7b7e7814", "upstream": "2.8.1", "variants": ["apache", "fpm", "fpm-alpine"], "version": "2.8.1" }, "latest": { "phpVersions": ["8.0", "7.4", "7.3"], "sha1": "1f0a41545a28d12e7364167544c55ade7b7e7814", "upstream": "2.8.1", "variants": ["apache", "fpm", "fpm-alpine"], "version": "2.8.1" } }
Note: Beta refers to the Docker image being beta (new entrypoint, configs, etc) and not necessarily the phpCollab deployment itself.
To generate the docs/README.md
file, perform the same steps in Local Build: One-time Setup through step 2.
Then run /docs/update.sh
and the docs/README.md
file should get generated.