Skip to content

Commit

Permalink
Merge pull request #542 from maxking/update-rolling-builds
Browse files Browse the repository at this point in the history
Remove the get_latest_ref script and use the primary branch.
  • Loading branch information
maxking authored Apr 14, 2022
2 parents 7cb4bad + 0b470ba commit d928d36
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 97 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ jobs:
workflows:
version: 2
build-and-deploy-workflow:
test-stable:
jobs:
- build:
rolling: "no"
filters:
tags:
only: /^v\d+\.\d+\.\d+$/

cron-workflow:
cron-builds:
triggers:
- schedule:
cron: "0 0 * * *"
Expand All @@ -65,7 +65,7 @@ workflows:
rolling: "yes"
context: org-global

rolling-workflow:
test-rolling:
jobs:
- build:
rolling: "yes"
Expand Down
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,36 +89,24 @@ $ docker pull docker.io/maxking/mailman-web:rolling
$ docker pull docker.io/maxking/mailman-core:rolling
```

Rolling releases are built with every commit and also re-generated weekly. You
Rolling releases are built with every commit and also re-generated nightly. You
can inspect the images to get which commit it was built using:

```bash
$ docker inspect --format '{{json .Config.Labels }}' mailman-core | python -m json.tool
{
"version.core": "31f434d0",
"version.git_commit": "45a4d7805b2b3d0e7c51679f59682d64ba02f05f",
"version.mm3-hk": "c625bfd2"
}

$ docker inspect --format '{{json .Config.Labels }}' mailman-web | python -m json.tool
{
"version.client": "d9e9cb73",
"version.dj-mm3": "72a7d6c4",
"version.git_commit": "45a4d7805b2b3d0e7c51679f59682d64ba02f05f",
"version.hyperkitty": "b67ca8a8",
"version.postorius": "73328ad4"
}

```

- `version.git_commit` : This is the commit hash of the Dockerfile in the
[Github repo](https://github.com/maxking/docker-mailman)
- `version.core`: The commit hash of Mailman Core
- `version.mm3-hk`: The commit hash of Mailman3-hyperkitty plugin.
- `version.client`: The commit hash of Mailman Client.
- `version.hyperkitty`: The commit hash of Hyperkitty.
- `version.postorius`: The commit hash of Postorius.
- `version.dj-mm3`: The commit hash of Django-Mailman3 project.

## Dependencies

Expand Down Expand Up @@ -414,7 +402,7 @@ smtp_port: $SMTP_PORT
configuration: /etc/postfix-mailman.cfg
```

So, if you need to update the values, you can set `SMTP_HOST`, `SMTP_PORT`,
So, if you need to update the values, you can set `SMTP_HOST`, `SMTP_PORT`,
`MM_HOSTNAME` environment variables in `mailman-core` container.

Please verify the output for `[mta]` section to ensure that it points to
Expand Down
30 changes: 0 additions & 30 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,19 @@ DOCKER=docker

if [ "$BUILD_ROLLING" = "yes" ]; then
echo "Building rolling releases..."
python3 -m venv venv
source venv/bin/activate
pip install python-gitlab
# Get the latest commit for repositories and set their reference values to be
# used in the development builds.
CORE_REF=$(python get_latest_ref.py mailman/mailman)
CLIENT_REF=$(python get_latest_ref.py mailman/mailmanclient)
POSTORIUS_REF=$(python get_latest_ref.py mailman/postorius)
HYPERKITTY_REF=$(python get_latest_ref.py mailman/hyperkitty)
DJ_MM3_REF=$(python get_latest_ref.py mailman/django-mailman3)
MM3_HK_REF=$(python get_latest_ref.py mailman/mailman-hyperkitty)

# Build the mailman-core image.
$DOCKER build -f core/Dockerfile.dev \
--build-arg CORE_REF=$CORE_REF \
--build-arg MM3_HK_REF=$MM3_HK_REF \
--label version.core="$CORE_REF" \
--label version.mm3-hk="$MM3_HK_REF" \
--label version.git_commit="$COMMIT_ID" \
-t maxking/mailman-core:rolling core/

# Build the mailman-web image.
$DOCKER build -f web/Dockerfile.dev \
--label version.git_commit="$COMMIT_ID" \
--label version.postorius="$POSTORIUS_REF" \
--label version.hyperkitty="$HYPERKITTY_REF" \
--label version.client="$CLIENT_REF" \
--label version.dj-mm3="$DJ_MM3_REF" \
--build-arg POSTORIUS_REF=$POSTORIUS_REF \
--build-arg CLIENT_REF=$CLIENT_REF \
--build-arg HYPERKITTY_REF=$HYPERKITTY_REF \
--build-arg DJ_MM3_REF=$DJ_MM3_REF \
-t maxking/mailman-web:rolling web/

# build the postorius image.
$DOCKER build -f postorius/Dockerfile.dev\
--label version.git_commit="$COMMIT_ID"\
--label version.postorius="$POSTORIUS_REF" \
--label version.client="$CLIENT_REF" \
--label version.dj-mm3="$DJ_MM3_REF" \
--build-arg POSTORIUS_REF=$POSTORIUS_REF \
--build-arg CLIENT_REF=$CLIENT_REF \
--build-arg DJ_MM3_REF=$DJ_MM3_REF \
-t maxking/postorius:rolling postorius/
else
echo "Building stable releases..."
Expand Down
4 changes: 2 additions & 2 deletions core/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ RUN --mount=type=cache,target=/root/.cache \
&& apk add --no-cache bash su-exec postgresql-client mysql-client curl python3 py3-pip linux-headers py-cryptography mariadb-connector-c \
&& python3 -m pip install -U psycopg2 pymysql setuptools wheel \
&& python3 -m pip install \
git+https://gitlab.com/mailman/mailman@${CORE_REF} \
git+https://gitlab.com/mailman/mailman-hyperkitty@${MM3_HK_REF} \
git+https://gitlab.com/mailman/mailman \
git+https://gitlab.com/mailman/mailman-hyperkitty \
gunicorn==19.9.0 \
&& apk del build-deps \
&& adduser -S mailman
Expand Down
41 changes: 0 additions & 41 deletions get_latest_ref.py

This file was deleted.

6 changes: 3 additions & 3 deletions postorius/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ RUN --mount=type=cache,target=/root/.cache \
python3 py3-pip libffi gettext py-cryptography \
&& python3 -m pip install -U pip setuptools wheel \
&& python3 -m pip install -U \
git+https://gitlab.com/mailman/mailmanclient@${CLIENT_REF} \
git+https://gitlab.com/mailman/postorius@${POSTORIUS_REF} \
git+https://gitlab.com/mailman/mailmanclient \
git+https://gitlab.com/mailman/postorius \
uwsgi \
'psycopg2<2.9' \
dj-database-url \
Expand All @@ -32,7 +32,7 @@ RUN --mount=type=cache,target=/root/.cache \
django-utils-six \
&& python3 -m pip install -U 'Django<3.2' \
&& python3 -m pip install -U \
git+https://gitlab.com/mailman/django-mailman3@${DJ_MM3_REF} \
git+https://gitlab.com/mailman/django-mailman3 \
&& apk del .build-deps \
&& addgroup -S mailman \
&& adduser -S -G mailman mailman \
Expand Down
8 changes: 4 additions & 4 deletions web/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ RUN --mount=type=cache,target=/root/.cache \
curl mailcap xapian-core xapian-bindings-python3 libffi gettext py-cryptography \
&& python3 -m pip install -U pip setuptools wheel \
&& python3 -m pip install -U \
git+https://gitlab.com/mailman/mailmanclient@${CLIENT_REF} \
git+https://gitlab.com/mailman/postorius@${POSTORIUS_REF} \
git+https://gitlab.com/mailman/hyperkitty@${HYPERKITTY_REF} \
git+https://gitlab.com/mailman/mailmanclient \
git+https://gitlab.com/mailman/postorius \
git+https://gitlab.com/mailman/hyperkitty \
whoosh \
uwsgi \
'psycopg2<2.9' \
Expand All @@ -38,7 +38,7 @@ RUN --mount=type=cache,target=/root/.cache \
django-utils-six \
&& python3 -m pip install -U 'Django<3.2' \
&& python3 -m pip install -U \
git+https://gitlab.com/mailman/django-mailman3@${DJ_MM3_REF} \
git+https://gitlab.com/mailman/django-mailman3 \
&& apk del .build-deps \
&& addgroup -S mailman \
&& adduser -S -G mailman mailman \
Expand Down

0 comments on commit d928d36

Please sign in to comment.