This commit is contained in:
Mayel de Borniol 2024-03-30 22:37:22 +00:00
parent 35b0e8aa23
commit d39c652285
3 changed files with 39 additions and 26 deletions

View file

@ -15,8 +15,8 @@ RUN apk --update add tar curl git rust cargo npm yarn bash make gcc libc-dev ope
ENV HOME=/opt/app/ TERM=xterm MIX_ENV=prod FLAVOUR_PATH=./
WORKDIR $HOME
# Cache elixir deps
COPY mix.exs mix.lock ./
# Prepare elixir deps
COPY mix.exs ./
COPY lib/mix ./lib/mix
# sometimes mix tries to read the config
RUN mkdir -p ./config
@ -24,35 +24,48 @@ COPY data/current_flavour/config/config_basics.exs ./config/config.exs
RUN mix do local.hex --force, local.rebar --force
# get deps from hex.pm
COPY data/current_flavour/config/deps*hex ./config/
COPY --parents flavours/*/config/deps*hex ./
# FIXME: copying mix.lock here means the optimisations of fetching hex and git deps seperately are useless, so commenting those for now
COPY mix.lock ./
# # first get deps from hex.pm
# COPY data/current_flavour/config/deps*hex ./config/
# COPY --parents flavours/*/config/deps*hex ./
# # RUN mix deps.get --only prod
# RUN HEX_HTTP_CONCURRENCY=1 HEX_HTTP_TIMEOUT=120 mix deps.get --only prod
# # ^ useful in case of spotty connectivity
# RUN ls -la config/*
# # Compile initial hex deps, only if we're not using forks (warning: this makes the assumption that no Bonfire extensions are coming from Hex. otherwise this should be done only after copying config)
# RUN if [ "$FORKS_TO_COPY_PATH" = "data/null" ] ; then MIX_ENV=prod mix deps.compile ; else echo "Skip" ; fi
# # add flavour's git deps (typically Bonfire extensions)
# COPY data/current_flavour/config/deps*git ./config/
# COPY --parents flavours/*/config/deps*git ./
# # fetch more deps/extensions
# RUN mix deps.get --only prod
# add main dep sources
COPY data/current_flavour/config/deps.* ./config/
RUN ls -la config/*
# RUN mix deps.get --only prod
RUN HEX_HTTP_CONCURRENCY=1 HEX_HTTP_TIMEOUT=120 mix deps.get --only prod
# ^ useful in case of spotty connectivity
RUN ls -la config/*
# Compile initial hex deps, only if we're not using forks (warning: this makes the assumption that no Bonfire extensions are coming from Hex. otherwise this should be done only after copying config)
RUN if [ "$FORKS_TO_COPY_PATH" = "data/null" ] ; then MIX_ENV=prod mix deps.compile ; else echo "Skip" ; fi
# add flavour's git deps (typically Bonfire extensions)
COPY data/current_flavour/config/deps*git ./config/
COPY --parents flavours/*/config/deps*git ./
# fetch more deps/extensions
RUN mix deps.get --only prod
# add extra deps (specified by the core app)
# add extra deps
# from other flavours
COPY --parents flavours/*/config/* ./
#specified by the core app
RUN cp -rfL deps/bonfire/deps.* ./config/
RUN ls -la config/* && ls -la flavours/*/config/*
# fetch (we need extensions for the non-configurable paths in config/deps_hooks.js)
RUN mix deps.get --only prod
# RUN HEX_HTTP_CONCURRENCY=1 HEX_HTTP_TIMEOUT=120 mix deps.get --only prod
# fetch extras (we need extensions for the non-configurable paths in config/deps_hooks.js)
# RUN mix deps.get --only prod
RUN HEX_HTTP_CONCURRENCY=1 HEX_HTTP_TIMEOUT=120 mix deps.get --only prod
# we need config before compiling Bonfire extensions
COPY data/current_flavour/config/ ./config/
COPY --parents flavours/*/config/* ./
RUN ls -la flavours/*/config/*
# Optionally include local forks
RUN if [ "$FORKS_TO_COPY_PATH" = "data/null" ] ; then rm ./config/deps*path && rm ./flavours/*/config/deps*path ; else echo "Include locally forked extensions." ; fi

View file

@ -122,7 +122,7 @@ defmodule Bonfire.Umbrella.MixProject do
# TODO: put these in ENV or an external writeable config file similar to deps.*
@config [
# note that the flavour will automatically be added where the dash appears
version: "0.9.10-beta.11",
version: "0.9.10-beta.12",
elixir: ">= #{System.get_env("ELIXIR_VERSION", "1.13.4")}",
flavour: @flavour,
default_flavour: @default_flavour,

View file

@ -57,7 +57,7 @@
"bonfire_posts": {:git, "https://github.com/bonfire-networks/bonfire_posts", "92d40004ab1948370b737a7f72757df72e0b252a", []},
"bonfire_quantify": {:git, "https://github.com/bonfire-networks/bonfire_quantify", "d43b4bce2e6f8343782c3db3b0740a1fde6f8759", [branch: "main"]},
"bonfire_search": {:git, "https://github.com/bonfire-networks/bonfire_search", "b820bd081ff470e09122cf0946f8e066833652ba", [branch: "main"]},
"bonfire_social": {:git, "https://github.com/bonfire-networks/bonfire_social", "b30c4fbf34e97752900c8f461aea722f40c2ebd4", [branch: "main"]},
"bonfire_social": {:git, "https://github.com/bonfire-networks/bonfire_social", "9cca1dab684cf4f36ce3dec10cb1a4772c4c7c84", [branch: "main"]},
"bonfire_social_graph": {:git, "https://github.com/bonfire-networks/bonfire_social_graph", "9291533228adcabf320819f31599736f2ea6721e", []},
"bonfire_tag": {:git, "https://github.com/bonfire-networks/bonfire_tag", "273339cb177707c90d7af6040f61b20611532b5b", [branch: "main"]},
"bonfire_ui_common": {:git, "https://github.com/bonfire-networks/bonfire_ui_common", "cb72a8db95bc0f311f970b05cc5ce25aa0becb55", [branch: "main"]},
@ -226,7 +226,7 @@
"mogrify": {:hex, :mogrify, "0.9.3", "238c782f00271dace01369ad35ae2e9dd020feee3443b9299ea5ea6bed559841", [:mix], [], "hexpm", "0189b1e1de27455f2b9ae8cf88239cefd23d38de9276eb5add7159aea51731e6"},
"mox": {:hex, :mox, "1.1.0", "0f5e399649ce9ab7602f72e718305c0f9cdc351190f72844599545e4996af73c", [:mix], [], "hexpm", "d44474c50be02d5b72131070281a5d3895c0e7a95c780e90bc0cfe712f633a13"},
"nebulex": {:hex, :nebulex, "2.6.1", "58c1924fa9f4e844c3470c20e6351b311a556652de29ed3b05fd2e5d817c6fef", [:mix], [{:decorator, "~> 1.4", [hex: :decorator, repo: "hexpm", optional: true]}, {:shards, "~> 1.1", [hex: :shards, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "177949fef2dc34a0055d7140b6bc94f6904225e2b5bbed6266ea9679522d23c6"},
"needle": {:git, "https://github.com/bonfire-networks/needle", "813529ba34a32e9c26856ebe1dca3f8c131fdcd2", [branch: "main"]},
"needle": {:hex, :needle, "0.7.2", "4efa403c9223d934a73964038b06fe7d4b9544f560ee29a0852807df0ef3a194", [:mix], [{:ecto_sql, "~> 3.8", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:exto, "~> 0.3", [hex: :exto, repo: "hexpm", optional: false]}, {:needle_ulid, "~> 0.3", [hex: :needle_ulid, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d9fa506e0db7ec14404ec0a08a77068cdc8cba2785a1a30d9a40a51e59b6a804"},
"needle_ulid": {:hex, :needle_ulid, "0.3.0", "7ecccec131c5218ec7cf5f8a236c016f436e78dfd684204de9f66c40271e7e04", [:mix], [{:ecto, "~> 3.4", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.8", [hex: :ecto_sql, repo: "hexpm", optional: true]}, {:ex_ulid, "~> 0.1", [hex: :ex_ulid, repo: "hexpm", optional: false]}], "hexpm", "d54d0dc5267b3ba3a7f981060b329bc8fb1f55104d790e54d808c8a5f4cb3e93"},
"neuron": {:hex, :neuron, "5.1.0", "dd321d5c2d9c03706ee7161ab49f8af634bfd1becb6fb95d8caa28bc95b6c655", [:mix], [{:httpoison, "~> 1.0 or ~> 2.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "23cddb0e0dd9c0eea247bc5b4bc3e1f8b52dbaf63f1637623920ec0b2385b6ce"},
"nimble_csv": {:hex, :nimble_csv, "1.2.0", "4e26385d260c61eba9d4412c71cea34421f296d5353f914afe3f2e71cce97722", [:mix], [], "hexpm", "d0628117fcc2148178b034044c55359b26966c6eaa8e2ce15777be3bbc91b12a"},