-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Save listener duration en milliseconds
- Loading branch information
1 parent
f0d56c4
commit 8d96365
Showing
9 changed files
with
79 additions
and
12 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
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
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
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,29 @@ | ||
# Local testing | ||
|
||
To test the Lenra server locally... | ||
|
||
## Start the dependency tools | ||
|
||
```bash | ||
docker compose up -d | ||
``` | ||
|
||
## Initiate the database | ||
|
||
```bash | ||
mix setup | ||
``` | ||
|
||
## Add an app in database | ||
|
||
First, you need to add an app in the database. You can do this by running the following command: | ||
|
||
```bash | ||
./scripts/create_test_user.sh | ||
``` | ||
|
||
## Run the server | ||
|
||
```bash | ||
FAAS_URL="http://localhost:3000" mix phx.server | ||
``` |
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
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
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
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
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,27 @@ | ||
#!/bin/bash | ||
|
||
# Add your code here | ||
echo "Creating a test user" | ||
user_id="$(mix run -e ' | ||
{:ok, %{inserted_user: user}} = Lenra.Accounts.register_user(%{"email" => "[email protected]","password" => "Johndoe@thefirst","password_confirmation" => "Johndoe@thefirst"}, :dev); | ||
IO.inspect "user_id=" <> to_string(user.id)' | grep -E '^"user_id=' | sed -E 's/^"user_id=(.+)"$/\1/')" | ||
echo "User created with id: $user_id" | ||
|
||
echo "Creating a test app" | ||
app_name="$(mix run -e " | ||
{:ok, %{inserted_application: app, inserted_env: env}} = Lenra.Apps.create_app(${user_id}, %{ name: \"test\", color: \"FFFFFF\", icon: \"60189\" }); | ||
{:ok, %{inserted_build: build}} = Lenra.Repo.transaction(Lenra.Apps.create_build(${user_id}, app.id, %{})); | ||
{:ok, %{inserted_deployment: deployment}} = Lenra.Apps.create_deployment( | ||
env.id, | ||
build.id, | ||
${user_id}, | ||
%{} | ||
); | ||
Lenra.Apps.update_build(build, %{status: :success}); | ||
Lenra.Apps.update_deployment(deployment, %{status: :success}); | ||
env | ||
|> Ecto.Changeset.change(is_public: true, deployment_id: deployment.id) | ||
|> Lenra.Repo.update(); | ||
IO.inspect \"app_name=\" <> to_string(app.service_name)" | grep -E '^\"app_name=' | sed -E 's/^\"app_name=(.+)\"$/\1/')" | ||
|
||
echo "App created with name: $app_name" |