25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

feat: do not clone repo inside container build

This commit is contained in:
Roman Hargrave 2022-09-06 10:59:33 -07:00 committed by badlop
parent 42e384beb7
commit f542a82309
3 changed files with 48 additions and 6 deletions

View File

@ -1,3 +1,46 @@
.git .git
.win32 .win32
.examples .examples
*.swp
*~
\#*#
.#*
.edts
*.dump
/Makefile
/config.log
/config.status
/config/releases.exs
/configure
/aclocal.m4
/*.cache
/deps/
/.deps-update/
/ebin/
/ejabberd.init
/ejabberd.service
/ejabberdctl
/ejabberdctl.example
/rel/ejabberd/
/rel/overlays/
/src/eldap_filter_yecc.erl
/vars.config
/dialyzer/
/test/*.beam
/test/*.ctc
/logs/
/priv/bin/captcha*sh
/priv/sql
/rel/ejabberd
/_build
/database/
/.rebar
/rebar.lock
/log/
Mnesia.nonode@nohost/
# Binaries created with tools/make-{binaries,installers,packages}:
/ejabberd_*.deb
/ejabberd-*.rpm
/ejabberd-*.run
/ejabberd-*.tar.gz

View File

@ -1,5 +1,4 @@
FROM alpine:3.15.4 AS build FROM alpine:3.15.4 AS build
ARG REPOSITORY=https://github.com/processone/ejabberd.git
ARG VERSION=master ARG VERSION=master
RUN apk upgrade --update musl \ RUN apk upgrade --update musl \
@ -29,11 +28,11 @@ RUN apk upgrade --update musl \
RUN mix local.hex --force \ RUN mix local.hex --force \
&& mix local.rebar --force && mix local.rebar --force
COPY . ./ejabberd
WORKDIR ejabberd WORKDIR ejabberd
RUN git clone $REPOSITORY . \ RUN mv .github/container/ejabberdctl.template . \
&& git checkout $VERSION \
&& mv .github/container/ejabberdctl.template . \
&& ./autogen.sh \ && ./autogen.sh \
&& ./configure --with-rebar=mix --enable-all \ && ./configure --with-rebar=mix --enable-all \
&& make deps \ && make deps \

View File

@ -58,11 +58,11 @@ jobs:
uses: docker/build-push-action@v2.10.0 uses: docker/build-push-action@v2.10.0
with: with:
build-args: | build-args: |
REPOSITORY=https://github.com/${{ github.repository }}.git
VERSION=${{ steps.gitdescribe.outputs.ver }} VERSION=${{ steps.gitdescribe.outputs.ver }}
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
context: .github/container context: .
file: .github/container/Dockerfile
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: true push: true