Compare commits

...

8 Commits

@ -13,15 +13,19 @@ on:
- 'mix/**'
env:
REGISTRY: ghcr.io
REGISTRY_GHCR: ghcr.io
REGISTRY_LOCAL: localhost:5000
MIX_IMAGE_NAME: ${{ github.repository_owner }}/mix
ECS_IMAGE_NAME: ${{ github.repository_owner }}/ecs
REGISTRY_DOCKER: docker.io
MIX_IMAGENAME_GHCR: ${{ github.repository_owner }}/mix
ECS_IMAGENAME_GHCR: ${{ github.repository_owner }}/ecs
MIX_IMAGENAME_DOCKERHUB: ${{ secrets.DOCKERHUB_USERNAME }}/mix
ECS_IMAGENAME_DOCKERHUB: ${{ secrets.DOCKERHUB_USERNAME }}/ecs
jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: true
max-parallel: 1
@ -36,38 +40,48 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@v2
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
registry: ${{ env.REGISTRY_GHCR }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get git describe
id: gitdescribe
run: echo "ver=$(git describe --exact-match 2>/dev/null || echo latest)" >> $GITHUB_OUTPUT
- name: Extract mix metadata (tags, labels) for Docker
- name: Extract mix metadata (tags, labels)
id: mixmeta
if: github.ref_type == 'tag'
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.MIX_IMAGE_NAME }}
images: |
${{ env.REGISTRY_GHCR }}/${{ env.MIX_IMAGENAME_GHCR }}
${{ env.REGISTRY_DOCKER }}/${{ env.MIX_IMAGENAME_DOCKERHUB }}
labels: |
org.opencontainers.image.revision=${{ steps.gitdescribe.outputs.ver }}
org.opencontainers.image.licenses=GPL-2.0
org.opencontainers.image.vendor=ProcessOne
- name: Extract ecs metadata (tags, labels) for Docker
- name: Extract ecs metadata (tags, labels)
id: ecsmeta
if: github.ref_type == 'tag'
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.ECS_IMAGE_NAME }}
images: |
${{ env.REGISTRY_GHCR }}/${{ env.ECS_IMAGENAME_GHCR }}
${{ env.REGISTRY_DOCKER }}/${{ env.ECS_IMAGENAME_DOCKERHUB }}
labels: |
org.opencontainers.image.revision=${{ steps.gitdescribe.outputs.ver }}
org.opencontainers.image.licenses=GPL-2.0
@ -77,18 +91,16 @@ jobs:
id: localreg
run: |
tag="$(echo ${{ github.ref_name }} | sed -e 's|[/]\+|-|g')"
echo "mixlocaltag=${{ env.REGISTRY_LOCAL }}/${{ env.MIX_IMAGE_NAME }}:$tag" >> $GITHUB_OUTPUT
echo "ecslocaltag=${{ env.REGISTRY_LOCAL }}/${{ env.ECS_IMAGE_NAME }}:$tag" >> $GITHUB_OUTPUT
echo "mixtag=${{ env.REGISTRY }}/${{ env.MIX_IMAGE_NAME }}:$tag" >> $GITHUB_OUTPUT
echo "ecstag=${{ env.REGISTRY }}/${{ env.ECS_IMAGE_NAME }}:$tag" >> $GITHUB_OUTPUT
echo "mixlocaltag=${{ env.REGISTRY_LOCAL }}/${{ env.MIX_IMAGENAME_GHCR }}:$tag" >> $GITHUB_OUTPUT
echo "ecslocaltag=${{ env.REGISTRY_LOCAL }}/${{ env.ECS_IMAGENAME_GHCR }}:$tag" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Build and push local mix image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
build-args: |
VERSION=${{ steps.gitdescribe.outputs.ver }}
@ -100,13 +112,12 @@ jobs:
push: true
tags: |
${{ steps.localreg.outputs.mixlocaltag }}
${{ steps.mixmeta.outputs.tags }}
- name: Prepare ecs Dockerfile
run: sed -i 's|ejabberd/mix|${{ steps.localreg.outputs.mixlocaltag }}|g' ecs/Dockerfile
- name: Build and push local ecs image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
build-args: |
VERSION=${{ steps.gitdescribe.outputs.ver }}
@ -118,7 +129,6 @@ jobs:
push: true
tags: |
${{ steps.localreg.outputs.ecslocaltag }}
${{ steps.ecsmeta.outputs.tags }}
- name: Run ecs image
run: |
@ -143,7 +153,7 @@ jobs:
docker image save ${{ steps.localreg.outputs.ecslocaltag }} --output ejabberd-latest.tar
- name: Upload image
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ejabberd-image
path: ejabberd-latest.tar
@ -153,8 +163,8 @@ jobs:
"uncompress it and run: " \
"docker image load -i ejabberd-latest.tar"
- name: Build and push mix image to GHCR
uses: docker/build-push-action@v4
- name: Build and push mix image
uses: docker/build-push-action@v5
if: github.ref_type == 'tag'
with:
build-args: |
@ -166,11 +176,10 @@ jobs:
platforms: linux/amd64
push: true
tags: |
${{ steps.localreg.outputs.mixtag }}
${{ steps.mixmeta.outputs.tags }}
- name: Build and push ecs image to GHCR
uses: docker/build-push-action@v3
- name: Build and push ecs image
uses: docker/build-push-action@v5
if: github.ref_type == 'tag'
with:
build-args: |
@ -182,5 +191,4 @@ jobs:
platforms: linux/amd64
push: true
tags: |
${{ steps.localreg.outputs.ecstag }}
${{ steps.ecsmeta.outputs.tags }}

@ -42,7 +42,7 @@ RUN mkdir runtime \
&& cp -r /ejabberd/sql lib/ejabberd-*/priv
# Runtime container
FROM alpine:3.17
FROM alpine:3.19
ARG VERSION
ARG VCS_REF
ARG BUILD_DATE

@ -166,8 +166,8 @@ debugwarning()
echo "Please be extremely cautious with your actions,"
echo "and exit immediately if you are not completely sure."
echo ""
echo "To detach this shell from ejabberd, press:"
echo " control+c, control+c"
echo "To exit and detach this shell from ejabberd, press:"
echo " control+g and then q"
echo ""
echo "--------------------------------------------------------------------"
echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:"
@ -189,8 +189,8 @@ livewarning()
echo "Please be extremely cautious with your actions,"
echo "and exit immediately if you are not completely sure."
echo ""
echo "To exit this LIVE mode and stop ejabberd, press:"
echo " q(). and press the Enter key"
echo "To exit and detach this shell from ejabberd, press:"
echo " control+g and then q"
echo ""
echo "--------------------------------------------------------------------"
echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:"
@ -205,12 +205,18 @@ help()
{
echo ""
echo "Commands to start an ejabberd node:"
echo " start Start an ejabberd node in server mode"
echo " debug Attach an interactive Erlang shell to a running ejabberd node"
echo " iexdebug Attach an interactive Elixir shell to a running ejabberd node"
echo " live Start an ejabberd node in live (interactive) mode"
echo " iexlive Start an ejabberd node in live (interactive) mode, within an Elixir shell"
echo " foreground Start an ejabberd node in server mode (attached)"
echo " start Start in server mode"
echo " foreground Start in server mode (attached)"
echo " foreground-quiet Start in server mode (attached), show only critical messages"
echo " live Start in interactive mode, with Erlang shell"
echo " iexlive Start in interactive mode, with Elixir shell"
echo ""
echo "Commands to interact with a running ejabberd node:"
echo " debug Attach an interactive Erlang shell to a running node"
echo " iexdebug Attach an interactive Elixir shell to a running node"
echo " etop Attach to a running node and start Erlang Top"
echo " ping Send ping to the node, returns pong or pang"
echo " started|stopped Wait for the node to fully start|stop"
echo ""
echo "Optional parameters when starting an ejabberd node:"
echo " --config-dir dir Config ejabberd: $ETC_DIR"

@ -1,4 +1,4 @@
FROM alpine:3.17
FROM alpine:3.19
LABEL maintainer="ProcessOne <contact@process-one.net>" \
product="Ejabberd mix development environment"

Loading…
Cancel
Save