-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Gabriele Ghio <[email protected]>
- Loading branch information
1 parent
d207ed0
commit d99cccf
Showing
9 changed files
with
1,903 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Config | ||
|
||
config :logger, :console, | ||
format: {PrettyLog.LogfmtFormatter, :format}, | ||
metadata: [:realm, :datacenter, :replication_factor, :module, :function, :tag] | ||
|
||
# Configure your database | ||
config :astarte_dev_tool, Astarte.DataAccess.Repo, | ||
# Overrides the default type `bigserial` used for version attribute in schema migration | ||
migration_primary_key: [name: :id, type: :binary_id], | ||
contact_points: [System.get_env("CASSANDRA_DB_HOST") || "localhost"], | ||
keyspace: "astarte", | ||
port: System.get_env("CASSANDRA_DB_PORT") || 9042, | ||
# Waiting time in milliseconds for the database connection | ||
sync_connect: 5000, | ||
log: :info, | ||
stacktrace: true, | ||
show_sensitive_data_on_connection_error: true, | ||
pool_size: 10 | ||
|
||
config :astarte_dev_tool, ecto_repos: [Astarte.DataAccess.Repo] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# | ||
# This file is part of Astarte. | ||
# | ||
# Copyright 2024 SECO Mind Srl | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
defmodule AstarteDevTool.Commands.System.Check do | ||
@moduledoc false | ||
require Logger | ||
alias AstarteDevTool.Utilities.System, as: SystemUtilities | ||
|
||
@astarte_services [ | ||
"astarte-dashboard", | ||
"astarte-appengine-api", | ||
"astarte-housekeeping", | ||
"astarte-housekeeping-api", | ||
"astarte-grafana", | ||
"astarte-realm-management", | ||
"astarte-realm-management-api", | ||
"astarte-data-updater-plant", | ||
"astarte-trigger-engine", | ||
"astarte-pairing", | ||
"astarte-pairing-api", | ||
"vernemq", | ||
"scylla", | ||
"traefik", | ||
"rabbitmq", | ||
"cfssl" | ||
] | ||
|
||
def exec(path) do | ||
case SystemUtilities.system_status(path) do | ||
{:ok, list} -> | ||
current_list = list |> Enum.map(fn %{"name" => name} -> name end) |> MapSet.new() | ||
|
||
case Enum.filter(@astarte_services, &(not MapSet.member?(current_list, &1))) do | ||
[] -> :ok | ||
rest -> {:error, rest} | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.