Skip to content

Commit

Permalink
update docker compose and add renovate
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybellwood authored Jan 24, 2024
1 parent 0f27fab commit fb310d7
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/wagtail-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
sed -i -e "/###/d" docker-compose.yml
- name: Pull all images
run: |
docker-compose pull --ignore-pull-failures
docker compose pull --ignore-pull-failures
- name: Install test harness
run: |
yarn add leia-parser mocha chai command-line-test
yarn add leia-parser mocha chai@4 command-line-test
- name: Generate test files
run: |
yarn leia "TESTING*.md" test -r 2 -s 'Start up tests' -t 'Verification commands' -c 'Destroy tests' --split-file
- name: Run docker-compose tests
- name: Run docker compose tests
run: |
yarn mocha --timeout 900000 test/*compose*.func.js
# - name: Run Lando tests
Expand All @@ -48,4 +48,4 @@ jobs:
# - name: Show Lando logs
# continue-on-error: true
# run: |
# docker-compose -p drupal9base logs
# docker compose -p drupal9base logs
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ The important files to examine are
* Open up a command line prompt.
* Clone the repo.
* cd into the repo.
* Run `docker-compose build` to build the containers
* Run `docker-compose up -d` to stand up the wagtail stack
* Run `docker compose build` to build the containers
* Run `docker compose up -d` to stand up the wagtail stack

You can interact with your site using `docker-compose exec python sh` and `/code/mysite/manage.py` to see the admin options for wagtail
You can interact with your site using `docker compose exec python sh` and `/code/mysite/manage.py` to see the admin options for wagtail

## Included Services

Expand Down
40 changes: 20 additions & 20 deletions TESTING_dockercompose.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Docker Compose Wagtail - python, postgres
=========================================

This is a docker-compose version of the Lando example tests:
This is a docker compose version of the Lando example tests:

Start up tests
--------------
Expand All @@ -11,10 +11,10 @@ Run the following commands to get up and running with this example.
```bash
# Should remove any previous runs and poweroff
docker network inspect amazeeio-network >/dev/null || docker network create amazeeio-network
docker-compose down
docker compose down

# Should start up our Lagoon Wagtail site successfully
docker-compose build && docker-compose up -d
docker compose build && docker compose up -d

# Ensure postgres and python pods are ready to connect
docker run --rm --net wagtail-example_default amazeeio/dockerize dockerize -wait tcp://postgres:5432 -timeout 1m
Expand All @@ -32,40 +32,40 @@ docker ps --filter label=com.docker.compose.project=wagtail-example | grep Up |
docker ps --filter label=com.docker.compose.project=wagtail-example | grep Up | grep wagtail-example_postgres_1

# Should ssh against the python container by default
docker-compose exec -T python sh -c "env | grep LAGOON=" | grep python
docker compose exec -T python sh -c "env | grep LAGOON=" | grep python

# Should have the correct environment set
docker-compose exec -T python sh -c "env" | grep LAGOON_ROUTE | grep lagoon-wagtail-example.docker.amazee.io
docker compose exec -T python sh -c "env" | grep LAGOON_ROUTE | grep lagoon-wagtail-example.docker.amazee.io

# Should be running python 3.11
docker-compose exec -T python sh -c "python3 --version" | grep "Python 3."
docker compose exec -T python sh -c "python3 --version" | grep "Python 3."

# Should have Uwsgi
docker-compose exec -T python sh -c "uwsgi --version" | grep "2."
docker compose exec -T python sh -c "uwsgi --version" | grep "2."

# Should have dependencies via pip - uwsgi, wagtail
docker-compose exec -T python sh -c "pip list" | grep uWSGI | grep "2."
docker-compose exec -T python sh -c "pip list" | grep wagtail | grep "4."
docker-compose exec -T python sh -c "pip list" | grep Django | grep "."
docker compose exec -T python sh -c "pip list" | grep uWSGI | grep "2."
docker compose exec -T python sh -c "pip list" | grep wagtail | grep "4."
docker compose exec -T python sh -c "pip list" | grep Django | grep "."

# Should have a running site served by uwsgi on port 8800
docker-compose exec -T python sh -c "curl -kL http://localhost:8800" | grep "Wagtail"
docker compose exec -T python sh -c "curl -kL http://localhost:8800" | grep "Wagtail"

# Should be able to db-export and db-import the database
docker-compose exec -T python sh -c "/code/mysite/manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e auth.Permission --indent 2 > /code/dump.json"
docker-compose exec -T python sh -c "sed -i \'/title/ s/Home/Lag00m/\' /code/dump.json"
docker-compose exec -T python sh -c "/code/mysite/manage.py loaddata /code/dump.json"
docker compose exec -T python sh -c "/code/mysite/manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e auth.Permission --indent 2 > /code/dump.json"
docker compose exec -T python sh -c "sed -i \'/title/ s/Home/Lag00m/\' /code/dump.json"
docker compose exec -T python sh -c "/code/mysite/manage.py loaddata /code/dump.json"

# Should have a running site served by uwsgi on port 8800
docker-compose exec -T python sh -c "curl -kL http://localhost:8800" | grep "Lag00m"
docker compose exec -T python sh -c "curl -kL http://localhost:8800" | grep "Lag00m"

# Should be able to show the 'articles' tables
docker-compose exec -T python sh -c "/code/mysite/manage.py inspectdb wagtailcore_site" | grep "wagtailcore_site"
docker compose exec -T python sh -c "/code/mysite/manage.py inspectdb wagtailcore_site" | grep "wagtailcore_site"

# Should be able to rebuild and persist the database
docker-compose build && docker-compose up -d
docker-compose exec -T python sh -c "/code/mysite/manage.py inspectdb wagtailcore_site" | grep "wagtailcore_site"
docker-compose exec -T python sh -c "curl -kL http://localhost:8800" | grep "Lag00m"
docker compose build && docker compose up -d
docker compose exec -T python sh -c "/code/mysite/manage.py inspectdb wagtailcore_site" | grep "wagtailcore_site"
docker compose exec -T python sh -c "curl -kL http://localhost:8800" | grep "Lag00m"
```

Destroy tests
Expand All @@ -75,5 +75,5 @@ Run the following commands to trash this app like nothing ever happened.

```bash
# Should be able to destroy our rails site with success
docker-compose down --volumes --remove-orphans
docker compose down --volumes --remove-orphans
```
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ x-environment:
DATABASE_URL: postgres://${POSTGRES_USERNAME:-lagoon}:${POSTGRES_PASSWORD:-lagoon}@${POSTGRES_HOST:-postgres}:${POSTGRES_PORT:-5432}/${POSTGRES_DATABASE:-lagoon}
# Uncomment if you like to have the system behave like in production
#LAGOON_ENVIRONMENT_TYPE: production
# Uncomment to enable xdebug and then restart via `docker-compose up -d`
# Uncomment to enable xdebug and then restart via `docker compose up -d`
#XDEBUG_ENABLE: "true"

volumes:
Expand Down
6 changes: 6 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}

0 comments on commit fb310d7

Please sign in to comment.