Skip to content

Commit f7c672c

Browse files
Commit from GitHub Actions (Build readme)
1 parent 0769a31 commit f7c672c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.adoc

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,45 @@ See `.env.example` for a list of available environment variables.
7777
* `ckan/`: Includes the CKAN Dockerfile, custom entrypoint scripts (in `docker-entrypoint.d`), patches, and setup scripts.
7878
* `postgresql/`: Contains the Docker setup for PostgreSQL, including database initialization.
7979
* `setup/`: Houses the initialization scripts that handle database setup, plugin configuration, Solr checks, and sysadmin creation.
80+
81+
== Developing
82+
In the following section, we show how changes can be made to the CKAN extension "ckanext-organisation-group" and how these are immediately visible in the running containers. The customisation of CSS classes in a template serves as an example. Before we can make the actual changes, we need to make some preparations:
83+
84+
=== 1) Clone the extension code next to CKAN Docker (`docker-ckan`)
85+
To be able to make changes independently of CKAN, it makes sense to check out the extension alongside CKAN Docker. This makes it easy to commit changes to the extension without having to change CKAN Docker.
86+
87+
A typical directory might look like this:
88+
```
89+
drwxrwxrwx 6 alex 502 4096 Feb 17 18:17 ckanext-organization-group
90+
drwxr-xr-x 5 alex alex 4096 Jan 20 08:45 ckanext-system-stats
91+
drwxr-xr-x 5 alex alex 4096 Jan 23 10:52 ckanext-tif-imageview
92+
drwxr-xr-x 5 alex alex 4096 Jan 20 16:46 ckanext-user-manual
93+
drwxr-xr-x 7 alex alex 4096 Feb 17 16:05 docker-ckan
94+
```
95+
96+
=== 2) Add a volume to `docker-compose.override.yaml`
97+
Now we want to replace the code of the extension included in the container with the checked-out code. To do this, we use a so-called "volume" which is specified in `docker-compose.override.yaml`:
98+
99+
```
100+
services:
101+
ckan:
102+
ports:
103+
- 5000:5000
104+
volumes:
105+
- ~/_dev/github.com/TIBHannover/ckanext-organization-group:/srv/app/src/ckanext-organization-group
106+
```
107+
108+
=== 3) Add a temporary startup script for the CKAN container
109+
Add a startup script `ckan/docker-entrypoint.d/99_dev.sh` with the following content. This script ensures that the correct file permissions and ownership are set, and that the installation is complete:
110+
111+
```
112+
#!/bin/bash
113+
114+
chgrp -R ckan-sys /srv/app/src
115+
find /srv/app/src -type d -exec chmod 777 {} \;
116+
pip install -e /srv/app/src/ckanext-organization-group
117+
pip install -r /srv/app/src/ckanext-organization-group/requirements.txt
118+
```
119+
120+
=== 4) Build and run the conainers
121+
Run `make build bash` to build and run the containers including the volume and the startup script. All changes to the extension code are now "mirrored" directly in the container and are generally visible immediately.

0 commit comments

Comments
 (0)