Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions .github/workflows/run-automatest-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,37 @@ jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build image for tests
run: docker build -t proxy-tester -f Dockerfile.test .
- name: Build image for tests (bookworm, OpenSSL 3)
run: docker compose build epp_proxy

- name: Verify OpenSSL and OTP in image
run: |
docker compose run --rm epp_proxy bash -l -c \
'openssl version; erl -noshell -eval "io:format(\"OTP ~s crypto=~p~n\", [erlang:system_info(otp_release), crypto:info_lib()]), halt()."'

- name: Start the container
run: docker run -d --name tester proxy-tester
run: docker compose up -d epp_proxy

- name: Install rebar dependencies
run: docker exec -i tester bash -l -c "source /root/.asdf/asdf.sh && rebar3 as test get-deps"
run: docker compose exec -T epp_proxy bash -l -c "source /root/.asdf/asdf.sh && rebar3 as test get-deps"

- name: Integrated Ruby app setup
run: docker exec -d tester bash -l -c "cd apps/epp_proxy/priv/test_backend_app && bundle install && bundle exec rackup"
run: docker compose exec -d epp_proxy bash -l -c "cd apps/epp_proxy/priv/test_backend_app && bundle install && bundle exec rackup -p 9292 -o 0.0.0.0 -D"

- name: Compile for tests
run: |
sleep 15
docker exec -i tester bash -l -c "source /root/.asdf/asdf.sh && rebar3 as test compile"
docker compose exec -T epp_proxy bash -l -c "source /root/.asdf/asdf.sh && rebar3 as test compile"

- name: Run tests
run: |
docker exec -i -e DEBUG=1 tester bash -l -c "source /root/.asdf/asdf.sh && rebar3 ct --sys_config config/test.config --readable=false --cover --verbose=true"
docker compose exec -T -e DEBUG=1 epp_proxy bash -l -c "source /root/.asdf/asdf.sh && rebar3 ct --sys_config config/test.config --readable=false --cover --verbose=true"

- name: Show test coverage
run: docker exec -i tester bash -l -c "source /root/.asdf/asdf.sh && rebar3 cover --verbose"
run: docker compose exec -T epp_proxy bash -l -c "source /root/.asdf/asdf.sh && rebar3 cover --verbose"

- name: Stop container
if: always()
run: docker compose down
6 changes: 3 additions & 3 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
erlang 23.3.4.20
ruby 3.2.2
rebar 3.15.2
erlang 26.2.5.5
ruby 3.4.9
rebar 3.23.0
28 changes: 28 additions & 0 deletions COMMANDS
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Docker (from epp_proxy/ — see docker-compose.yml)

- Run all tests (OpenSSL 3):
./scripts/docker-ct.sh

- Build image:
docker compose build

- Run specific test suite:
docker compose run --rm epp_proxy bash -l -c "source ~/.asdf/asdf.sh && rebar3 ct --sys_config config/test.config --suite apps/epp_proxy/test/epp_http_client_SUITE"

- Run all tests manually (start test backend in another shell or use docker-ct.sh):
docker compose run --rm epp_proxy bash -l -c "source ~/.asdf/asdf.sh && rebar3 ct --sys_config config/test.config"

- Debugging shell:
docker compose run --rm epp_proxy bash -l -c "source ~/.asdf/asdf.sh && rebar3 shell --config config/test.config"

- Show loaded configuration (in Erlang shell):
application:get_all_env(epp_proxy).

- Quit shell:
halt().

- Production tarball:
docker compose run --rm epp_proxy bash -l -c "source ~/.asdf/asdf.sh && rebar3 as prod tar"

# Full registry stack (epp_proxy + Rails EPP) — ../docker-images/docker-compose.yml
cd ../docker-images && docker compose up epp epp_proxy
29 changes: 13 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
FROM debian:bullseye-slim
FROM debian:bookworm-slim

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY ./docker/apt/sources.list /etc/apt/

# Install all dependencies in a single layer to reduce image size
RUN apt-get update && apt-get install -y -qq \
wget \
git \
build-essential \
libncurses5-dev \
automake \
autoconf \
curl \
ca-certificates \
libssl3 \
libssl-dev \
libreadline-dev \
libdpkg-perl \
Expand All @@ -22,41 +21,39 @@ RUN apt-get update && apt-get install -y -qq \
perl \
procps \
inotify-tools \
libssl1.1 \
perl-base \
zlib1g-dev \
# Additional dependencies for Erlang build
libncurses-dev \
libsctp-dev \
# Documentation tools to prevent build failures
xsltproc \
libxml2-utils \
# Dependencies for Ruby 3.2.2
libffi-dev \
libyaml-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Set environment variables for Erlang build
ENV KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac --without-wx --without-odbc --disable-hipe --without-jinterface --without-docs"
ENV KERL_BUILD_DOCS="no"
ENV KERL_DOC_TARGETS=""
ENV KERL_INSTALL_HTMLDOCS="no"
ENV KERL_INSTALL_MANPAGES="no"

RUN git clone https://github.com/asdf-vm/asdf.git --branch v0.6.3 "$HOME"/.asdf && \
RUN git clone https://github.com/asdf-vm/asdf.git --branch v0.14.0 "$HOME"/.asdf && \
echo '. $HOME/.asdf/asdf.sh' >> "$HOME"/.bashrc && \
echo '. $HOME/.asdf/asdf.sh' >> "$HOME"/.profile
echo '. $HOME/.asdf/asdf.sh' >> "$HOME"/.profile

ENV PATH="${PATH}:/root/.asdf/shims:/root/.asdf/bin"
ENV GIT_TERMINAL_PROMPT=0

RUN mkdir -p /opt/erlang/epp_proxy
WORKDIR /opt/erlang/epp_proxy

COPY .tool-versions ./
RUN asdf plugin-add erlang
RUN . $HOME/.asdf/asdf.sh && asdf install
RUN asdf global erlang $(grep erlang .tool-versions | cut -d' ' -f2)
RUN asdf plugin-add ruby
RUN asdf plugin-add rebar
RUN asdf install
RUN . "$HOME"/.asdf/asdf.sh && \
asdf plugin add erlang && \
asdf plugin add ruby && \
asdf plugin add rebar && \
asdf install && \
asdf global erlang "$(grep erlang .tool-versions | awk '{print $2}')" && \
asdf global ruby "$(grep ruby .tool-versions | awk '{print $2}')" && \
asdf global rebar "$(grep rebar .tool-versions | awk '{print $2}')"
56 changes: 31 additions & 25 deletions Dockerfile.Erlang-ruby.base
Original file line number Diff line number Diff line change
@@ -1,42 +1,48 @@
FROM debian:bullseye-slim
FROM debian:bookworm-slim

COPY ./docker/apt/sources.list /etc/apt/

RUN apt-get update && apt-get install -y \
wget \
git \
build-essential=* \
libncurses5-dev=* \
automake=* \
autoconf=* \
curl=* \
ca-certificates=* \
libssl-dev=* \
libreadline-dev=* \
libdpkg-perl=* \
liberror-perl=* \
libc6=* \
build-essential \
libncurses-dev \
automake \
autoconf \
curl \
ca-certificates \
libssl3 \
libssl-dev \
libreadline-dev \
libdpkg-perl \
liberror-perl \
libc6 \
libc-dev \
perl=* \
procps=* \
inotify-tools=* \
libssl1.1=* \
perl-base=* \
perl \
procps \
inotify-tools \
perl-base \
zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/asdf-vm/asdf.git --branch v0.6.3 "$HOME"/.asdf && \
RUN git clone https://github.com/asdf-vm/asdf.git --branch v0.14.0 "$HOME"/.asdf && \
echo '. $HOME/.asdf/asdf.sh' >> "$HOME"/.bashrc && \
echo '. $HOME/.asdf/asdf.sh' >> "$HOME"/.profile
echo '. $HOME/.asdf/asdf.sh' >> "$HOME"/.profile

ENV PATH="${PATH}:/root/.asdf/shims:/root/.asdf/bin"

RUN mkdir -p /opt/erlang/epp_proxy/release
WORKDIR /opt/erlang/epp_proxy

ENV GIT_TERMINAL_PROMPT=0

COPY .tool-versions ./
RUN asdf plugin-add erlang
RUN asdf install
RUN asdf global erlang $(grep erlang .tool-versions | cut -d' ' -f2)
RUN asdf plugin-add ruby
RUN asdf plugin-add rebar
RUN asdf install
RUN . "$HOME"/.asdf/asdf.sh && \
asdf plugin add erlang && \
asdf plugin add ruby && \
asdf plugin add rebar && \
asdf install && \
asdf global erlang "$(grep erlang .tool-versions | awk '{print $2}')" && \
asdf global ruby "$(grep ruby .tool-versions | awk '{print $2}')" && \
asdf global rebar "$(grep rebar .tool-versions | awk '{print $2}')"
58 changes: 0 additions & 58 deletions Dockerfile.amd64.legacy

This file was deleted.

Loading
Loading