Skip to content

Commit

Permalink
Merge pull request #1020 from eyra/feature/debian-and-upgrades-melle
Browse files Browse the repository at this point in the history
Feature/debian and upgrades Melle
  • Loading branch information
mellelieuwes authored Dec 31, 2024
2 parents aac3c04 + 212b960 commit 5a8abbe
Show file tree
Hide file tree
Showing 138 changed files with 496 additions and 423 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96
with:
images: |
${{env.REGISTRY}}/eyra/${{github.event.inputs.bundle}}
Expand All @@ -47,7 +47,7 @@ jobs:
# type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355
with:
context: core
push: true
Expand Down
90 changes: 44 additions & 46 deletions .github/workflows/release-debian.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,75 @@
name: Release - Debian
name: Release

on:
push:
branches:
- master
- feature/*

workflow_dispatch:
inputs:
branch:
description: "Branch to release from"
required: true
default: "feature/debian-and-upgrades-melle"
bundle:
description: "Bundle ID (next, self)"
required: true
default: "next"

jobs:
tagged-release:
runs-on: ubuntu-latest
container: debian:12
build-release:
runs-on: ubuntu-20.04
env:
MIX_ENV: prod

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch || github.ref }}

- name: Add Debian 11 repository and install OpenSSL 1.1
run: |
echo "deb http://deb.debian.org/debian bullseye main" | tee -a /etc/apt/sources.list.d/bullseye.list
apt update
apt install -y libssl1.1
rm /etc/apt/sources.list.d/bullseye.list
apt update
- name: Install Node.js
- name: Set TAG and VERSION
id: vars
run: |
apt-get update
apt-get install -y curl git build-essential
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt-get install -y nodejs
TAG="${{ inputs.bundle || 'next' }}_$(date +%F)_${{ github.run_number }}"
echo "TAG=$TAG" >> $GITHUB_ENV
echo "VERSION=$TAG" >> $GITHUB_ENV
shell: bash

- name: Tag name
id: tag
run: echo "TAG=${{ github.event.inputs.bundle }}_$(date +%F)_${{ github.run_number }}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- id: setup-elixir
uses: erlef/setup-elixir@v1
- name: Build Docker Image (dev target) with cache
uses: docker/build-push-action@v5
with:
otp-version: "25.3.2.7"
elixir-version: "1.14.0"
context: .
file: ./Dockerfile
target: dev
tags: next-platform:latest
push: false
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Setup the Elixir project
- name: Run build inside Docker
run: |
mix deps.get
working-directory: core

- name: Build Frontend
run: |
./scripts/build-frontend
working-directory: core

- name: Build release
run: |
./scripts/build-release
working-directory: core
env:
BUNDLE: ${{ github.event.inputs.bundle }}
VERSION: ${{ env.TAG }}
docker run --rm \
-e MIX_ENV=$MIX_ENV \
-e BUNDLE=${{ inputs.bundle || 'next' }} \
-e VERSION=${{ env.VERSION }} \
-v ${{ github.workspace }}:/app \
next-platform:latest \
bash -c "cd /app/core && ./scripts/build-frontend && ./scripts/build-release"
- name: Archive release
run: |
tar cfj "../${{ env.TAG }}.tar.bz2" "${{ env.TAG }}"
run: tar cfj "../${{env.VERSION}}.tar.bz2" "${{env.VERSION}}"
working-directory: core

- name: Publish Release
uses: softprops/action-gh-release@v2
- uses: softprops/action-gh-release@v2
with:
tag_name: "${{ env.TAG }}"
tag_name: "${{env.VERSION}}"
prerelease: false
fail_on_unmatched_files: true
files: |
${{ env.TAG }}.tar.bz2
${{env.VERSION}}.tar.bz2
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

## \#7 unreleased

## \#6.2 unreleased

* Added: AppSignal support

## \#6.1 2024-11-19

* Fixed: Memory issues by temporary removing Sentry support
Expand Down
43 changes: 18 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM debian:12
# ======================
# Builder Stage
# ======================
FROM debian:12 AS builder

WORKDIR /root

Expand All @@ -14,39 +17,29 @@ RUN apt-get update && apt-get install -y \
libncurses-dev \
&& rm -rf /var/lib/apt/lists/*

RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8

ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2
ENV PATH="/root/.asdf/bin:/root/.asdf/shims:${PATH}"


RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2 \
&& echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc \
&& echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc

RUN echo "export PATH=\"$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH\"" >> ~/.bashrc

RUN bash -c "source ~/.bashrc && \
asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git && \
RUN asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git && \
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git && \
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git"

asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git

COPY .tool-versions /root/.tool-versions
RUN asdf install
RUN asdf reshim

RUN bash -c "source ~/.bashrc && asdf install"

RUN echo "source ~/.bashrc" >> ~/.profile

RUN bash -c "source ~/.bashrc && mix local.hex --force && mix local.rebar --force"
RUN mix local.hex --force && mix local.rebar --force
RUN chmod -R a+rX /root/.asdf

COPY ./core /app/core
WORKDIR /app/core

RUN bash -c "source ~/.bashrc && mix deps.get"

# ======================
# Dev Stage
# ======================
FROM builder AS dev
CMD ["tail", "-f", "/dev/null"]


17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,17 @@ docs: ${MIX_PROJECTS:%=%/docs}

.PHONY: FORCE

dockermigrate:
$(MAKE) dockermix cmd="ecto.migrate"

deps:
docker compose exec app cd /app/core && mix deps.get
dockerdeps:
$(MAKE) dockermix cmd="deps.get"

run:
docker compose exec app bash -c "source ~/.bashrc && mix run"
dockerrun:
$(MAKE) dockermix cmd="run"

bash:
docker compose exec app bash
dockermix:
$(MAKE) dockerbash cmd="mix $(cmd)"

dockerbash:
docker compose exec app bash -c "source ~/.bashrc && $(cmd)"
2 changes: 1 addition & 1 deletion banking_proxy/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule BankingProxy.MixProject do
{:ranch, "~> 2.1"},
# Dev and test deps
{:mox, "~> 1.0", only: :test},
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
# {:exsync, "~> 0.2", only: :dev},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.26", only: [:dev, :test], runtime: false}
Expand Down
8 changes: 4 additions & 4 deletions banking_proxy/mix.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
%{
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
"credo": {:hex, :credo, "1.6.7", "323f5734350fd23a456f2688b9430e7d517afb313fbd38671b8a4449798a7854", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "41e110bfb007f7eda7f897c10bf019ceab9a0b269ce79f015d54b0dcf4fc7dd3"},
"credo": {:hex, :credo, "1.7.10", "6e64fe59be8da5e30a1b96273b247b5cf1cc9e336b5fd66302a64b25749ad44d", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "71fbc9a6b8be21d993deca85bf151df023a3097b01e09a2809d460348561d8cd"},
"dialyxir": {:hex, :dialyxir, "1.2.0", "58344b3e87c2e7095304c81a9ae65cb68b613e28340690dfe1a5597fd08dec37", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "61072136427a851674cab81762be4dbeae7679f85b1272b6d25c3a839aff8463"},
"earmark_parser": {:hex, :earmark_parser, "1.4.32", "fa739a0ecfa34493de19426681b23f6814573faee95dfd4b4aafe15a7b5b32c6", [:mix], [], "hexpm", "b8b0dd77d60373e77a3d7e8afa598f325e49e8663a51bcc2b88ef41838cca755"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_doc": {:hex, :ex_doc, "0.29.4", "6257ecbb20c7396b1fe5accd55b7b0d23f44b6aa18017b415cb4c2b91d997729", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "2c6699a737ae46cb61e4ed012af931b57b699643b24dabe2400a8168414bc4f5"},
"exsync": {:hex, :exsync, "0.2.4", "5cdc824553e0f4c4bf60018a9a6bbd5d3b51f93ef8401a0d8545f93127281d03", [:mix], [{:file_system, "~> 0.2", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm", "f7622d8bb98abbe473aa066ae46f91afdf7a5346b8b89728404f7189d2e80896"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"file_system": {:hex, :file_system, "1.0.1", "79e8ceaddb0416f8b8cd02a0127bdbababe7bf4a23d2a395b983c1f8b3f73edd", [:mix], [], "hexpm", "4414d1f38863ddf9120720cd976fce5bdde8e91d8283353f0e31850fa89feb9e"},
"hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
"httpoison": {:hex, :httpoison, "1.8.2", "9eb9c63ae289296a544842ef816a85d881d4a31f518a0fec089aaa744beae290", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "2bb350d26972e30c96e2ca74a1aaf8293d61d0742ff17f01e0279fef11599921"},
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
"jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"},
Expand Down
25 changes: 21 additions & 4 deletions core/assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lodash": "^4.17.21",
"pdfjs-dist": "^3.11.174",
"stringify": "^5.2.0",
"trix": "^2.1.4"
"trix": "^2.1.9"
},
"devDependencies": {
"prettier": "2.7.1",
Expand Down
2 changes: 1 addition & 1 deletion core/bundles/next/lib/account/session_controller.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Next.Account.SessionController do
use CoreWeb, :controller
import CoreWeb.Gettext
use Gettext, backend: CoreWeb.Gettext

alias Systems.Account

Expand Down
2 changes: 1 addition & 1 deletion core/bundles/next/lib/account/signin_page_builder.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Next.Account.SigninPageBuilder do
import CoreWeb.Gettext
use Gettext, backend: CoreWeb.Gettext
import Frameworks.Utility.List

import Core.FeatureFlags
Expand Down
2 changes: 1 addition & 1 deletion core/bundles/next/lib/menu/items.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Next.Menu.Items do
use CoreWeb, :verified_routes
@behaviour CoreWeb.Menu.ItemsProvider

import CoreWeb.Gettext
use Gettext, backend: CoreWeb.Gettext

@impl true
def values() do
Expand Down
2 changes: 1 addition & 1 deletion core/bundles/next/start_pages.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defmodule Next.StartPages do

defmacro __using__(_opts) do
quote do
import CoreWeb.Gettext
use Gettext, backend: CoreWeb.Gettext

unquote do
for {id, %{domain: domain}} <- Next.StartPages.pages() do
Expand Down
2 changes: 1 addition & 1 deletion core/bundles/self/lib/account/session_controller.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Self.Account.SessionController do
use CoreWeb, :controller
import CoreWeb.Gettext
use Gettext, backend: CoreWeb.Gettext

alias Systems.Account

Expand Down
2 changes: 1 addition & 1 deletion core/bundles/self/lib/menu/items.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Self.Menu.Items do
@behaviour CoreWeb.Menu.ItemsProvider

use CoreWeb, :verified_routes
import CoreWeb.Gettext
use Gettext, backend: CoreWeb.Gettext

@impl true
def values() do
Expand Down
2 changes: 1 addition & 1 deletion core/bundles/self/start_pages.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule Self.StartPages do

defmacro __using__(_opts) do
quote do
import CoreWeb.Gettext
use Gettext, backend: CoreWeb.Gettext

unquote do
for {id, %{domain: domain}} <- Self.StartPages.pages() do
Expand Down
Loading

0 comments on commit 5a8abbe

Please sign in to comment.