-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0e6c446
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
sudo: required | ||
language: python | ||
services: | ||
- docker | ||
group: trusty_latest | ||
env: | ||
global: | ||
- REGISTRY_USER=rapidproautomation | ||
- IMAGE="praekeltfoundation/mailroom" VERSION="" REPO="nyaruka/mailroom" | ||
- secure: Pmjh6uFpiFbqEo4WeTZdMTcyNG26+IsoWy6KD6vKCyCmGTfwIMkvR7pBULQ5Ks7FA4XPukj+Ke2S4Nnbpt4rbZSKcuwQIr/Qn5Stb654MM1hB8kyerL15kooB/55H+aZRAKqyNW5tjBUO5xt40ku0XPnPSvE4f+IDBQyFiIyeFXlH2CLRwRvzWPiL8uF7+hM/B6U8UsKMIbu7b6wKudutleB7hAThIe3PPnU3GecjilJrA/1VPpNV44crIVYDmMumJN+CYj62WCuyNqAeJCyCepDCTAmOz/Ly+OuQ5pq1qpZWSkksvF64Wm0Tl0ey6rkHAdKLWSnqOcAGF2+cmEhaWcLoUit47UfOiRhzaD8hLwsnLvF3UWhIm6c9F1gu2cEegL7X2OCxk/ZniJVnhJCG1OoVoKKy7r4NPG0Y322HqKLDu8sC+tHzpaZmN+37Q7vjrW94CgvEPErOIrLev/dEz2tTiXyJchkDUwkYFhjDbmN1zEfDQ9aLy0QCnKiyiYINp9V/3TAigvSo/vJ/vg1RZI7uxfjoQ6Gqwk/0cemXDgiZ7POYaSTl8Z4eCeQN2AKR8I6bgrZMqRlNx7rx5sweH2V9CWYimI4Fx6b3JFFiSBI+yAB0v5GpofVTgdqbE1VY0AMRPCLEfWvI+q9RSq5v022M6uBlyEoDn6tpjYkrVc= | ||
- secure: TWPxn1y445WKlQgxUrLei3Mq4navyajOIsIEt3GLxwFhlrRuUmKTQ1TpOXAz7xnmdienNu2IX+97Y0jgIbCfaq/Hc3xl2dUOQp/8niwzpFMQTrrn2BRd7RzSsIy8AMtJvroQFmU4hUrQZ1v8VMNIrigJQE/SgUkepFWpGIYeIqw6DTxWm6+tVXMUQtvNeg1bEzrhSGW/iePlDW5nnew2RbE5NvjHOC2ETuAfhF/am8ioPSS3ou33JeL0Tbdc0dMeZKnSTcnYerS4cB/D9JfoK7GX4Sp9/liQH7sgX8kD1bhPwRmaNU5i6+LUbufZjG0Ody2J9OQwNZ/d839fOfI3q2MuBXCDvHD8Keejt3oka+Uh8CeqronqPzIhinPWU6Yc6E/w6eJdeT83W7d/5BPZSo8VeUCvSM8K5Xf6tRyE/sKLonsV6Ytr+PwqtRm7v4DQpHa9JRX03pLKvWT1kMqbCaIcUDy8K1ySmTE2jFe8Jfn1ye8qOsbzE9eTNiVvsuwwf2EygKnJPzWLjfu6VJo3UaNVD1KQbZMJoEVNvmLFs7QeHQVg77d5MeikpMkdxLb+MDyfziNzDZ2Kv1sJ0et6fm0OY7BYQywxLsqpuPTT382zi/yjQZQgfg6l2C+xSWNeEIR+VhKIK+dkDktm+Iybc43mw480vlAAf7njr/nZBJg= | ||
before_script: | ||
- 'LATEST_TAG=$(curl -H "Authorization: Bearer $GITHUB_ACCESS_TOKEN" -s https://api.github.com/repos/$REPO/tags | | ||
jq -r ''.[0].name'')' | ||
- LATEST_TAG="${LATEST_TAG//[v]}" | ||
- VERSION=${VERSION:-$LATEST_TAG} | ||
install: [] | ||
script: | ||
- docker pull "$IMAGE" || true | ||
- | | ||
docker build --pull --cache-from "$IMAGE" \ | ||
--tag "$IMAGE" \ | ||
--build-arg MAILROOM_VERSION=$VERSION \ | ||
--build-arg MAILROOM_REPO=$REPO \ | ||
. | ||
after_script: | ||
- docker images | ||
before_deploy: | ||
- pip install docker-ci-deploy==0.3.0 | ||
- echo -n $REGISTRY_PASS | docker login -u "$REGISTRY_USER" --password-stdin | ||
deploy: | ||
provider: script | ||
skip_cleanup: true | ||
script: dcd --tag-version "$VERSION" --tag-semver --tag-latest "$IMAGE" | ||
on: | ||
branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM debian:stretch-slim | ||
|
||
RUN set -ex; \ | ||
addgroup --system mailroom; \ | ||
adduser --system --ingroup mailroom mailroom | ||
|
||
# Install ca-certificates so HTTPS works in general | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends ca-certificates && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ARG MAILROOM_REPO | ||
ENV MAILROOM_REPO=${MAILROOM_REPO:-nyaruka/mailroom | ||
ARG MAILROOM_VERSION | ||
ENV MAILROOM_VERSION=${MAILROOM_VERSION:-0.0.201} | ||
|
||
RUN set -ex; \ | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends wget; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
\ | ||
wget -O mailroom.tar.gz "https://github.com/$MAILROOM_REPO/releases/download/v${MAILROOM_VERSION}/courier_${MAILROOM_VERSION}_linux_amd64.tar.gz"; \ | ||
mkdir /usr/local/src/mailroom; \ | ||
tar -xzC /usr/local/src/mailroom -f mailroom.tar.gz; \ | ||
\ | ||
# Just grab the binary and ignore the other packaged files | ||
mv /usr/local/src/mailroom/mailroom /usr/local/bin/; \ | ||
rm -rf /usr/local/src/mailroom mailroom.tar.gz; \ | ||
\ | ||
apt-get purge -y --auto-remove wget | ||
|
||
EXPOSE 8080 | ||
|
||
USER mailroom | ||
|
||
ENTRYPOINT [] | ||
CMD ["mailroom"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# mailroom-docker | ||
|
||
Compiles the mailroom at nyaruka/mailroom |