Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename application #197

Merged
merged 3 commits into from
Mar 18, 2022
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: tronto_test
POSTGRES_DB: trento_test
ports:
- 5433:5432
# Set health checks to wait until postgres has started
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
packages: write
env:
REGISTRY: ghcr.io
IMAGE_REPOSITORY: ghcr.io/${{ github.repository_owner }}/tronto
IMAGE_REPOSITORY: ghcr.io/${{ github.repository_owner }}/trento-web-dev
IMAGE_TAG: "${{ (github.event_name == 'release' && github.event.release.tag_name) || (github.event_name == 'push' && github.ref_name == 'master' && 'rolling') || github.sha }}"
steps:
- uses: actions/checkout@v3
Expand All @@ -188,7 +188,7 @@ jobs:
with:
context: .
push: true
target: tronto
target: trento
tags: ${{ env.IMAGE_REPOSITORY }}:${{ env.IMAGE_TAG }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# The directory Mix will write compiled artifacts to.
/_build/

# The Elixir language server directory
/.elixir_ls/

# If you run "mix test --cover", coverage assets end up here.
/cover/

Expand All @@ -20,15 +23,15 @@ erl_crash.dump
*.ez

# Ignore package tarball (built via "mix hex.build").
tronto-*.tar
trento-*.tar

# Since we are building assets from assets/,
# we ignore priv/static. You may want to comment
# this depending on your deployment strategy.
/priv/static/
/priv/static/assets

# In case you use Node.js/npm, you want to ignore these.
npm-debug.log
/assets/node_modules/

.pgdata/
.pgdata/
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ RUN mix phx.digest
RUN mix release


FROM registry.suse.com/bci/bci-base:15.3 AS tronto
FROM registry.suse.com/bci/bci-base:15.3 AS trento
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
WORKDIR /app
COPY --from=release /build/_build/prod/rel/tronto .
COPY --from=release /build/_build/prod/rel/trento .
EXPOSE 4000/tcp
ENTRYPOINT ["/app/bin/tronto"]
ENTRYPOINT ["/app/bin/trento"]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# tronto
# trento

A vaporware version of Trento - SUSE Console for SAP Applications

![tronto](https://user-images.githubusercontent.com/828651/144742801-88d49dcd-9d7d-4086-8d7e-b77db9a57de8.jpg)
![trento](https://user-images.githubusercontent.com/828651/144742801-88d49dcd-9d7d-4086-8d7e-b77db9a57de8.jpg)

# Table of contents

- [Hack on the tronto](#hack-on-the-tronto)
- [Hack on the trento](#hack-on-the-trento)
- [Install dependencies](#install-dependencies)
- [Development environment](#development-environment)
- [Setup tronto](#setup-tronto)
- [Start tronto in the repl](#start-tronto-in-the-repl)
- [Setup trento](#setup-trento)
- [Start trento in the repl](#start-trento-in-the-repl)
- [Scenario loading with photofinish](#scenario-loading-with-photofinish)

# Hack on the tronto
# Hack on the trento

## Install dependencies

Expand All @@ -28,13 +28,13 @@ A `docker-compose` development environment is provided.
$> docker-compose up -d
```

## Setup tronto
## Setup trento

```
$> mix setup
```

## Start tronto in the repl
## Start trento in the repl

```
$> iex -S mix phx.server
Expand Down
2 changes: 1 addition & 1 deletion assets/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const resolvePath = (p) => path.resolve(__dirname, p);

require('esbuild')
.build({
entryPoints: ['js/app.js', 'js/tronto.jsx'],
entryPoints: ['js/app.js', 'js/trento.jsx'],
outdir: resolvePath('../priv/static/assets'),
bundle: true,
minify: !process.env.ESBUILD_WATCH,
Expand Down
2 changes: 1 addition & 1 deletion assets/js/tronto.jsx → assets/js/trento.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ const App = () => {
);
};

render(<App />, document.getElementById('tronto'));
render(<App />, document.getElementById('trento'));
44 changes: 22 additions & 22 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
# General application configuration
import Config

config :tronto,
ecto_repos: [Tronto.Repo]
config :trento,
ecto_repos: [Trento.Repo]

# Configures the endpoint
config :tronto, TrontoWeb.Endpoint,
config :trento, TrentoWeb.Endpoint,
url: [host: "localhost"],
render_errors: [view: TrontoWeb.ErrorView, accepts: ~w(html json), layout: false],
pubsub_server: Tronto.PubSub,
render_errors: [view: TrentoWeb.ErrorView, accepts: ~w(html json), layout: false],
pubsub_server: Trento.PubSub,
live_view: [signing_salt: "4tNZ+tm7"]

# Configures the mailer
Expand All @@ -24,7 +24,7 @@ config :tronto, TrontoWeb.Endpoint,
#
# For production it's recommended to configure a different adapter
# at the `config/runtime.exs`.
config :tronto, Tronto.Mailer, adapter: Swoosh.Adapters.Local
config :trento, Trento.Mailer, adapter: Swoosh.Adapters.Local

# Swoosh API client is needed for adapters other than SMTP.
config :swoosh, :api_client, false
Expand All @@ -34,7 +34,7 @@ config :esbuild,
version: "0.12.18",
default: [
args:
~w(js/app.js js/tronto.jsx --bundle --target=es2016 --loader:.svg=dataurl --loader:.png=dataurl --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
~w(js/app.js js/trento.jsx --bundle --target=es2016 --loader:.svg=dataurl --loader:.png=dataurl --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
cd: Path.expand("../assets", __DIR__),
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
]
Expand All @@ -47,57 +47,57 @@ config :logger, :console,
# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason

config :tronto, Tronto.Commanded,
config :trento, Trento.Commanded,
event_store: [
adapter: Commanded.EventStore.Adapters.EventStore,
event_store: Tronto.EventStore
event_store: Trento.EventStore
],
pubsub: :local,
registry: :local

config :tronto, Tronto.EventStore, serializer: EventStore.TermSerializer
config :trento, Trento.EventStore, serializer: EventStore.TermSerializer

config :tronto, event_stores: [Tronto.EventStore]
config :trento, event_stores: [Trento.EventStore]

config :tronto, :pow,
user: Tronto.Accounts.User,
repo: Tronto.Repo,
web_module: TrontoWeb,
config :trento, :pow,
user: Trento.Accounts.User,
repo: Trento.Repo,
web_module: TrentoWeb,
extensions: [PowPersistentSession],
controller_callbacks: Pow.Extension.Phoenix.ControllerCallbacks

config :tronto, Tronto.Monitoring.Heartbeats, interval: :timer.seconds(5)
config :trento, Trento.Monitoring.Heartbeats, interval: :timer.seconds(5)

config :tronto, Tronto.Scheduler,
config :trento, Trento.Scheduler,
jobs: [
heartbeat_check: [
# Runs every ten seconds
schedule: {:extended, "*/10"},
task: {Tronto.Monitoring.Heartbeats, :dispatch_heartbeat_failed_commands, []},
task: {Trento.Monitoring.Heartbeats, :dispatch_heartbeat_failed_commands, []},
run_strategy: {Quantum.RunStrategy.Random, :cluster},
overlap: false
]
],
debug_logging: false

config :tronto,
config :trento,
uuid_namespace: "fb92284e-aa5e-47f6-a883-bf9469e7a0dc"

config :vex,
sources: [
[uuid: Tronto.Support.UUIDValidator],
[uuid: Trento.Support.UUIDValidator],
Vex.Validators
]

config :fun_with_flags,
:persistence,
adapter: FunWithFlags.Store.Persistent.Ecto,
repo: Tronto.Repo
repo: Trento.Repo

config :fun_with_flags, :cache_bust_notifications,
enabled: true,
adapter: FunWithFlags.Notifications.PhoenixPubSub,
client: Tronto.PubSub
client: Trento.PubSub

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
Expand Down
16 changes: 8 additions & 8 deletions config/dev.exs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import Config

# Configure your database
config :tronto, Tronto.Repo,
config :trento, Trento.Repo,
username: "postgres",
password: "postgres",
database: "tronto_dev",
database: "trento_dev",
hostname: "localhost",
port: 5433,
show_sensitive_data_on_connection_error: true,
pool_size: 10,
log: false

config :tronto, Tronto.EventStore,
config :trento, Trento.EventStore,
username: "postgres",
password: "postgres",
database: "tronto_eventstore_dev",
database: "trento_eventstore_dev",
hostname: "localhost",
port: 5433,
pool_size: 10
Expand All @@ -25,7 +25,7 @@ config :tronto, Tronto.EventStore,
# The watchers configuration can be used to run external
# watchers to your application. For example, we use it
# with esbuild to bundle .js and .css sources.
config :tronto, TrontoWeb.Endpoint,
config :trento, TrentoWeb.Endpoint,
# Binding to loopback ipv4 address prevents access from other machines.
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
http: [ip: {0, 0, 0, 0}, port: 4000],
Expand Down Expand Up @@ -74,13 +74,13 @@ config :tronto, TrontoWeb.Endpoint,
# different ports.

# Watch static and templates for browser reloading.
config :tronto, TrontoWeb.Endpoint,
config :trento, TrentoWeb.Endpoint,
live_reload: [
patterns: [
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/gettext/.*(po)$",
~r"lib/tronto_web/(live|views)/.*(ex)$",
~r"lib/tronto_web/templates/.*(eex)$"
~r"lib/trento_web/(live|views)/.*(ex)$",
~r"lib/trento_web/templates/.*(eex)$"
]
]

Expand Down
2 changes: 1 addition & 1 deletion config/prod.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Config

config :tronto, TrontoWeb.Endpoint,
config :trento, TrentoWeb.Endpoint,
check_origin: :conn,
cache_static_manifest: "priv/static/cache_manifest.json",
server: true
Expand Down
10 changes: 5 additions & 5 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if config_env() == :prod do
For example: ecto://USER:PASS@HOST/DATABASE
"""

config :tronto, Tronto.Repo,
config :trento, Trento.Repo,
# ssl: true,
# socket_options: [:inet6],
url: database_url,
Expand All @@ -27,7 +27,7 @@ if config_env() == :prod do
For example: ecto://USER:PASS@HOST/DATABASE
"""

config :tronto, Tronto.EventStore,
config :trento, Trento.EventStore,
url: evenstore_url,
pool_size: String.to_integer(System.get_env("EVENTSTORE_POOL_SIZE") || "10")

Expand All @@ -43,7 +43,7 @@ if config_env() == :prod do
You can generate one by calling: mix phx.gen.secret
"""

config :tronto, TrontoWeb.Endpoint,
config :trento, TrentoWeb.Endpoint,
http: [
# Enable IPv6 and bind on all interfaces.
# Set it to {0, 0, 0, 0, 0, 0, 0, 1} for local network only access.
Expand All @@ -59,7 +59,7 @@ if config_env() == :prod do
# If you are doing OTP releases, you need to instruct Phoenix
# to start each relevant endpoint:
#
# config :tronto, TrontoWeb.Endpoint, server: true
# config :trento, TrentoWeb.Endpoint, server: true
#
# Then you can assemble a release by calling `mix release`.
# See `mix help release` for more information.
Expand All @@ -70,7 +70,7 @@ if config_env() == :prod do
# Also, you may need to configure the Swoosh API client of your choice if you
# are not using SMTP. Here is an example of the configuration:
#
# config :tronto, Tronto.Mailer,
# config :trento, Trento.Mailer,
# adapter: Swoosh.Adapters.Mailgun,
# api_key: System.get_env("MAILGUN_API_KEY"),
# domain: System.get_env("MAILGUN_DOMAIN")
Expand Down
10 changes: 5 additions & 5 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ import Config
# The MIX_TEST_PARTITION environment variable can be used
# to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information.
config :tronto, Tronto.Repo,
config :trento, Trento.Repo,
username: "postgres",
password: "postgres",
database: "tronto_test#{System.get_env("MIX_TEST_PARTITION")}",
database: "trento_test#{System.get_env("MIX_TEST_PARTITION")}",
hostname: "localhost",
port: 5433,
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: 10

config :tronto, Tronto.Commanded,
config :trento, Trento.Commanded,
event_store: [
adapter: Commanded.EventStore.Adapters.InMemory,
serializer: Commanded.Serialization.JsonSerializer
]

# We don't run a server during test. If one is required,
# you can enable the server option below.
config :tronto, TrontoWeb.Endpoint,
config :trento, TrentoWeb.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4002],
secret_key_base: "dN6epjGF+jdAdq1+q4cuJSMVwrwDMWUcakjB6ISxfFmvNziaOpBsJcCPaBaydJIk",
server: false

# In test we don't send emails.
config :tronto, Tronto.Mailer, adapter: Swoosh.Adapters.Test
config :trento, Trento.Mailer, adapter: Swoosh.Adapters.Test

# Print only warnings and errors during test
config :logger, level: :warn
Expand Down
2 changes: 1 addition & 1 deletion hack/dump_scenario_from_k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dump-scenario() {
fi

kubectl exec deploy/trento-server-web -- rm -rf /scenarios
kubectl exec -ti deploy/trento-server-web -- /app/bin/tronto eval "Tronto.Release.dump_scenario([\"$name\", \"-p\", \"/scenarios\"])"
kubectl exec -ti deploy/trento-server-web -- /app/bin/trento eval "Trento.Release.dump_scenario([\"$name\", \"-p\", \"/scenarios\"])"
kubectl exec deploy/trento-server-web -- tar cf - scenarios | tar xf - -C "$path"
}

Expand Down
4 changes: 2 additions & 2 deletions lib/tronto.ex → lib/trento.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Tronto do
defmodule Trento do
@moduledoc """
Tronto keeps the contexts that define your domain
Trento keeps the contexts that define your domain
and business logic.

Contexts are also responsible for managing your data, regardless
Expand Down
Loading