Skip to content

Commit

Permalink
Some adjusts and add statestore in mix.exs
Browse files Browse the repository at this point in the history
  • Loading branch information
sleipnir committed Jul 4, 2024
1 parent 0af6c07 commit 1c1b1d6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion elixir/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"app_module_name": "ElixirSdkExample",
"spawn_app_spawm_system": "spawn-system",
"spawn_app_namespace": "default",
"spawn_app_statestore_type": "Postgres",
"spawn_app_statestore_type": "postgres",
"spawn_sdk_version": "1.14",
"_copy_without_render": [
".github",
Expand Down
5 changes: 2 additions & 3 deletions elixir/{{cookiecutter.app_name}}/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ ENV RELEASE_NAME="{{cookiecutter.app_name}}"
# This will be the full nodename
ENV RELEASE_NODE="${RELEASE_NAME}@${POD_IP}"

RUN cd spawn_proxy/proxy \
&& mix deps.get \
&& mix release proxy
RUN mix deps.get \
&& mix release {{cookiecutter.app_name}}

# ---- Application Stage ----
FROM alpine:3.20
Expand Down
2 changes: 1 addition & 1 deletion elixir/{{cookiecutter.app_name}}/compile-protos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ mix protobuf.generate \
--generate-descriptors=true \
--include-path=$BASE_PATH/priv/protos/ \
--include-path=./priv/protos/google/api \
--plugins=ProtobufGenerate.Plugins.GRPCWithOptions \
--plugin=ProtobufGenerate.Plugins.GRPCWithOptions \
--one-file-per-module \
$BASE_PATH/priv/protos/joe.proto
20 changes: 13 additions & 7 deletions elixir/{{cookiecutter.app_name}}/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,19 @@ defmodule {{cookiecutter.app_module_name}}.MixProject do
[
{:bakeware, "~> 0.2"},
{:spawn_sdk, "~> {{cookiecutter.spawn_sdk_version}}"},
# You can uncomment one of those dependencies if you are going to use Persistent Actors
#{:spawn_statestores_mariadb, "~> {{cookiecutter.spawn_sdk_version}}"},
#{:spawn_statestores_mysql, "~> {{cookiecutter.spawn_sdk_version}}"},
#{:spawn_statestores_postgres, "~> {{cookiecutter.spawn_sdk_version}}"},
#{:spawn_statestores_mssql, "~> {{cookiecutter.spawn_sdk_version}}"},
#{:spawn_statestores_cockroachdb, "~> {{cookiecutter.spawn_sdk_version}}"},
#{:spawn_statestores_sqlite, "~> {{cookiecutter.spawn_sdk_version}}"}
{%- if cookiecutter.spawn_app_statestore_type == "mariadb" -%}
{:spawn_statestores_mariadb, "~> {{cookiecutter.spawn_sdk_version}}"}
{%- elif cookiecutter.spawn_app_statestore_type == "mysql" -%}
{:spawn_statestores_mysql, "~> {{cookiecutter.spawn_sdk_version}}"}
{%- elif cookiecutter.spawn_app_statestore_type == "postgres" -%}
{:spawn_statestores_postgres, "~> {{cookiecutter.spawn_sdk_version}}"}
{%- elif cookiecutter.spawn_app_statestore_type == "mssql" -%}
{:spawn_statestores_mssql, "~> {{cookiecutter.spawn_sdk_version}}"}
{%- elif cookiecutter.spawn_app_statestore_type == "cockroachdb" -%}
{:spawn_statestores_cockroachdb, "~> {{cookiecutter.spawn_sdk_version}}"}
{%- elif cookiecutter.spawn_app_statestore_type == "sqlite" -%}
{:spawn_statestores_sqlite, "~> {{cookiecutter.spawn_sdk_version}}"}
{% endif %}
]
end

Expand Down

0 comments on commit 1c1b1d6

Please sign in to comment.