Commit 2875a1ad authored by Grégoire Locqueville's avatar Grégoire Locqueville

Split bin/ into scripts/ and app/

- Split bin/ into:
  - app/ for Haskell source files
  - scripts/ for scripts
- Added bench/ into app/, devops/ into scripts/
- Updated gargantext.cabal and README accordingly
parent 9c2f627d
Pipeline #6875 failed with stages
in 16 minutes and 9 seconds
...@@ -54,7 +54,7 @@ cd .. ...@@ -54,7 +54,7 @@ cd ..
Run the install script from inside the `haskell-gargantext/` directory: Run the install script from inside the `haskell-gargantext/` directory:
```bash ```bash
./bin/install ./scripts/install
``` ```
This will build Gargantext, run the tests, and build the documentation. This will build Gargantext, run the tests, and build the documentation.
...@@ -63,7 +63,7 @@ This will build Gargantext, run the tests, and build the documentation. ...@@ -63,7 +63,7 @@ This will build Gargantext, run the tests, and build the documentation.
Move into the `purescript-gargantext/` directory, then run the install script: Move into the `purescript-gargantext/` directory, then run the install script:
```bash ```bash
cd purescript-gargantext cd purescript-gargantext
./bin/install ./scripts/install
cd .. cd ..
``` ```
...@@ -80,21 +80,21 @@ and fill in the missing fields. ...@@ -80,21 +80,21 @@ and fill in the missing fields.
convert it into a file `gargantext-settings.toml` by running the following convert it into a file `gargantext-settings.toml` by running the following
from a Nix shell: from a Nix shell:
```shell ```shell
n$ ./bin/cli ini n$ ./scripts/cli ini
``` ```
### Launching and Initializing the Database ### Launching and Initializing the Database
Launch the docker image from inside the dedicated directory: Launch the docker image from inside the dedicated directory:
```bash ```bash
cd devops/docker/ cd scripts/devops/docker/
docker compose up docker compose up
``` ```
Then initialize the database using the dedicated command: from inside the Then initialize the database using the dedicated command: from inside the
`haskell-gargantext/` directory, run `haskell-gargantext/` directory, run
```bash ```bash
./bin/cli init ./scripts/cli init
``` ```
And provide a name and a password for the master user as requested. And provide a name and a password for the master user as requested.
...@@ -103,7 +103,7 @@ And provide a name and a password for the master user as requested. ...@@ -103,7 +103,7 @@ And provide a name and a password for the master user as requested.
From inside the `haskell-gargantext/` directory, run From inside the `haskell-gargantext/` directory, run
```bash ```bash
./bin/run ./scripts/run
``` ```
## Use Cases <a name="use-cases"></a> ## Use Cases <a name="use-cases"></a>
...@@ -111,7 +111,7 @@ From inside the `haskell-gargantext/` directory, run ...@@ -111,7 +111,7 @@ From inside the `haskell-gargantext/` directory, run
### Multi-User with Graphical User Interface (Server Mode) ### Multi-User with Graphical User Interface (Server Mode)
``` shell ``` shell
$ ~/.local/bin/stack --docker exec gargantext-server -- --run Prod $ ~/.local/scripts/stack --docker exec gargantext-server -- --run Prod
``` ```
Then you can log in with `user1` / `1resu` Then you can log in with `user1` / `1resu`
...@@ -229,11 +229,11 @@ The CI is on gitlab and is controlled by the `.gitlab-ci.yml` file. ...@@ -229,11 +229,11 @@ The CI is on gitlab and is controlled by the `.gitlab-ci.yml` file.
The Docker image that is used can be built with: The Docker image that is used can be built with:
```shell ```shell
podman build -t cgenie/gargantext:9.4.8 -f ./devops/docker/Dockerfile --format=docker . podman build -t cgenie/gargantext:9.4.8 -f ./scripts/devops/docker/Dockerfile --format=docker .
``` ```
or or
```shell ```shell
docker build -t cgenie/gargantext:9.4.8 -f ./devops/docker/Dockerfile . docker build -t cgenie/gargantext:9.4.8 -f ./scripts/devops/docker/Dockerfile .
``` ```
NOTE: if podman/docker complains about not enough space, it's probably NOTE: if podman/docker complains about not enough space, it's probably
...@@ -255,9 +255,9 @@ When a development is needed on libraries (for instance, the HAL crawler in http ...@@ -255,9 +255,9 @@ When a development is needed on libraries (for instance, the HAL crawler in http
2. When changes work and tests are OK, commit in repo `hal` 2. When changes work and tests are OK, commit in repo `hal`
2. When changes are commited / merged: 2. When changes are commited / merged:
1. Get the hash id, and edit `cabal.project` with the **new commit id** 1. Get the hash id, and edit `cabal.project` with the **new commit id**
2. run `./bin/update-project-dependencies` 2. run `./scripts/update-project-dependencies`
- get an error that sha256 don't match, so update the `./bin/update-project-dependencies` with new sha256 hash - get an error that sha256 don't match, so update the `./scripts/update-project-dependencies` with new sha256 hash
- run again `./bin/update-project-dependencies` (to make sure it's a fixed point now) - run again `./scripts/update-project-dependencies` (to make sure it's a fixed point now)
> Note: without `stack.yaml` we would have to only fix `cabal.project` -> `source-repository-package` commit id. Sha256 is there to make sure CI reruns the tests. > Note: without `stack.yaml` we would have to only fix `cabal.project` -> `source-repository-package` commit id. Sha256 is there to make sure CI reruns the tests.
...@@ -305,7 +305,7 @@ To upgrade PostgreSQL in Docker containers, for example from 11.x to 14.x, simpl ...@@ -305,7 +305,7 @@ To upgrade PostgreSQL in Docker containers, for example from 11.x to 14.x, simpl
$ docker exec -it <container-id> pg_dumpall -U gargantua > 11-db.dump $ docker exec -it <container-id> pg_dumpall -U gargantua > 11-db.dump
``` ```
Then, shut down the container, replace `image` section in `devops/docker/docker-compose.yaml` with `postgres:14`. Also, it is a good practice to create a new volume, say `garg-pgdata14` and bind the new container to it. If you want to keep the same volume, remember about removing it like so: Then, shut down the container, replace `image` section in `scripts/devops/docker/docker-compose.yaml` with `postgres:14`. Also, it is a good practice to create a new volume, say `garg-pgdata14` and bind the new container to it. If you want to keep the same volume, remember about removing it like so:
```shell ```shell
$ docker-compose rm postgres $ docker-compose rm postgres
$ docker volume rm docker_garg-pgdata $ docker volume rm docker_garg-pgdata
......
...@@ -646,7 +646,7 @@ executable gargantext-cli ...@@ -646,7 +646,7 @@ executable gargantext-cli
CLI.Upgrade CLI.Upgrade
Paths_gargantext Paths_gargantext
hs-source-dirs: hs-source-dirs:
bin/gargantext-cli app/gargantext-cli
build-depends: build-depends:
aeson ^>= 2.1.2.1 aeson ^>= 2.1.2.1
, aeson-pretty , aeson-pretty
...@@ -690,7 +690,7 @@ executable gargantext-server ...@@ -690,7 +690,7 @@ executable gargantext-server
other-modules: other-modules:
Paths_gargantext Paths_gargantext
hs-source-dirs: hs-source-dirs:
bin/gargantext-server app/gargantext-server
build-depends: build-depends:
cassava ^>= 0.5.2.0 cassava ^>= 0.5.2.0
, containers ^>= 0.6.7 , containers ^>= 0.6.7
...@@ -842,7 +842,7 @@ test-suite garg-test-tasty ...@@ -842,7 +842,7 @@ test-suite garg-test-tasty
Test.Utils.Crypto Test.Utils.Crypto
Test.Utils.Jobs Test.Utils.Jobs
hs-source-dirs: hs-source-dirs:
test bin/gargantext-cli test app/gargantext-cli
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
test-suite garg-test-hspec test-suite garg-test-hspec
...@@ -879,7 +879,7 @@ test-suite garg-test-hspec ...@@ -879,7 +879,7 @@ test-suite garg-test-hspec
benchmark garg-bench benchmark garg-bench
main-is: Main.hs main-is: Main.hs
hs-source-dirs: bench hs-source-dirs: app/bench
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
other-modules: other-modules:
Paths_gargantext Paths_gargantext
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment