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 ..
Run the install script from inside the `haskell-gargantext/` directory:
```bash
./bin/install
./scripts/install
```
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:
```bash
cd purescript-gargantext
./bin/install
./scripts/install
cd ..
```
......@@ -80,21 +80,21 @@ and fill in the missing fields.
convert it into a file `gargantext-settings.toml` by running the following
from a Nix shell:
```shell
n$ ./bin/cli ini
n$ ./scripts/cli ini
```
### Launching and Initializing the Database
Launch the docker image from inside the dedicated directory:
```bash
cd devops/docker/
cd scripts/devops/docker/
docker compose up
```
Then initialize the database using the dedicated command: from inside the
`haskell-gargantext/` directory, run
```bash
./bin/cli init
./scripts/cli init
```
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
```bash
./bin/run
./scripts/run
```
## Use Cases <a name="use-cases"></a>
......@@ -111,7 +111,7 @@ From inside the `haskell-gargantext/` directory, run
### Multi-User with Graphical User Interface (Server Mode)
``` 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`
......@@ -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:
```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
```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
......@@ -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 are commited / merged:
1. Get the hash id, and edit `cabal.project` with the **new commit id**
2. run `./bin/update-project-dependencies`
- get an error that sha256 don't match, so update the `./bin/update-project-dependencies` with new sha256 hash
- run again `./bin/update-project-dependencies` (to make sure it's a fixed point now)
2. run `./scripts/update-project-dependencies`
- get an error that sha256 don't match, so update the `./scripts/update-project-dependencies` with new sha256 hash
- 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.
......@@ -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
```
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
$ docker-compose rm postgres
$ docker volume rm docker_garg-pgdata
......
......@@ -646,7 +646,7 @@ executable gargantext-cli
CLI.Upgrade
Paths_gargantext
hs-source-dirs:
bin/gargantext-cli
app/gargantext-cli
build-depends:
aeson ^>= 2.1.2.1
, aeson-pretty
......@@ -690,7 +690,7 @@ executable gargantext-server
other-modules:
Paths_gargantext
hs-source-dirs:
bin/gargantext-server
app/gargantext-server
build-depends:
cassava ^>= 0.5.2.0
, containers ^>= 0.6.7
......@@ -842,7 +842,7 @@ test-suite garg-test-tasty
Test.Utils.Crypto
Test.Utils.Jobs
hs-source-dirs:
test bin/gargantext-cli
test app/gargantext-cli
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
test-suite garg-test-hspec
......@@ -879,7 +879,7 @@ test-suite garg-test-hspec
benchmark garg-bench
main-is: Main.hs
hs-source-dirs: bench
hs-source-dirs: app/bench
type: exitcode-stdio-1.0
other-modules:
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