Compare commits

...

8 Commits

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

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

@ -166,8 +166,8 @@ debugwarning()
echo "Please be extremely cautious with your actions," echo "Please be extremely cautious with your actions,"
echo "and exit immediately if you are not completely sure." echo "and exit immediately if you are not completely sure."
echo "" echo ""
echo "To detach this shell from ejabberd, press:" echo "To exit and detach this shell from ejabberd, press:"
echo " control+c, control+c" echo " control+g and then q"
echo "" echo ""
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:" 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 "Please be extremely cautious with your actions,"
echo "and exit immediately if you are not completely sure." echo "and exit immediately if you are not completely sure."
echo "" echo ""
echo "To exit this LIVE mode and stop ejabberd, press:" echo "To exit and detach this shell from ejabberd, press:"
echo " q(). and press the Enter key" echo " control+g and then q"
echo "" echo ""
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:" echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:"
@ -205,12 +205,18 @@ help()
{ {
echo "" echo ""
echo "Commands to start an ejabberd node:" echo "Commands to start an ejabberd node:"
echo " start Start an ejabberd node in server mode" echo " start Start in server mode"
echo " debug Attach an interactive Erlang shell to a running ejabberd node" echo " foreground Start in server mode (attached)"
echo " iexdebug Attach an interactive Elixir shell to a running ejabberd node" echo " foreground-quiet Start in server mode (attached), show only critical messages"
echo " live Start an ejabberd node in live (interactive) mode" echo " live Start in interactive mode, with Erlang shell"
echo " iexlive Start an ejabberd node in live (interactive) mode, within an Elixir shell" echo " iexlive Start in interactive mode, with Elixir shell"
echo " foreground Start an ejabberd node in server mode (attached)" 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 ""
echo "Optional parameters when starting an ejabberd node:" echo "Optional parameters when starting an ejabberd node:"
echo " --config-dir dir Config ejabberd: $ETC_DIR" 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>" \ LABEL maintainer="ProcessOne <contact@process-one.net>" \
product="Ejabberd mix development environment" product="Ejabberd mix development environment"

Loading…
Cancel
Save