diff --git a/.env.sample b/.env.sample index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..505d6efd13f08cbded81ee31f741a3bca352b919 100644 --- a/.env.sample +++ b/.env.sample @@ -0,0 +1,6 @@ +COMPOSE_PROJECT_NAME=entrainement +DATABASE_USERNAME=ilovethierion +DATABASE_PASSWORD=ilovethierion +DATABASE_NAME=entrainement_db + +JDBC_URL=jdbc:postgresql:15.2://db:5432/${DATABASE_NAME} \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7c9d24816e2a40c403bc1e6a8ff4114e1e5b4832..5cb7e0d1ffaa0a1366529b8a0cfd5c7361e70267 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,20 +6,9 @@ variables: include: "/generic-config-template.yml" -#workflow: -# rules: -# - if: $CI_COMMIT_BRANCH -# variables: -# DEPLOYMENT_ENV: Dev -# - if: $CI_COMMIT_TAG -# variables: -# DEPLOYMENT_ENV: Production - - stages: - build - test -# - package backend:build: image: $MAVEN_IMAGE diff --git a/README.md b/README.md index 8fa92d92ed52b281dfba342459d34a5844d92d0f..4dd2dc5d77a59a04cdc4ea01f78f742d36ab344b 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,21 @@ -# Takima Store +# TO-DO List + +## Présentation + +Ce projet est une application de gestion de tâches, avec les operations basiques de creation/ajout/modification/suppression +La pagination est intégrée, ainsi qu'un panel de recherche ## Lancer le projet -Pour lancer le projet en local, il faut utiliser le docker-compose mais en forçant le build si les droits d'accès au -registry git sont refusés, et en précisant le profil "reviewer". +Pour lancer le projet en local, il faut utiliser le docker-compose et utiliser le profil "local" La commande : `docker compose --profile reviewer up --build` Il faut également créer un fichier .env à la racine du projet à partir du .env.sample ( les variables sont déjà bien instanciées pour les tests en local ). -## Serveurs : - -Le serveur de build est accessible à l'adresse suivante : http://gdemonteynard-build.takima.io:8080/ ## API tests : -Une collection postman est disponible dans le dossier `postman` du projet, pour des tests rapides sur les différents +Une collection postman est disponible a la racine du projet, pour des tests rapides sur les différents portraits. \ No newline at end of file diff --git a/ToDoList.postman_collection.json b/ToDoList.postman_collection.json new file mode 100644 index 0000000000000000000000000000000000000000..e94b90d78bc705e428b6d6ef456913afaa8e03c8 --- /dev/null +++ b/ToDoList.postman_collection.json @@ -0,0 +1,134 @@ +{ + "info": { + "_postman_id": "a7e04244-aef6-4134-81c6-f650194a0c8a", + "name": "ToDoList", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "26148234" + }, + "item": [ + { + "name": "ToDo", + "item": [ + { + "name": "getAll Todo", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:8080/api/todos?limit=5&search=state=~todo~", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "api", + "todos" + ], + "query": [ + { + "key": "limit", + "value": "5" + }, + { + "key": "search", + "value": "state=~todo~" + } + ] + } + }, + "response": [] + }, + { + "name": "add Todo", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\":\"beurre\",\n \"state\":\"TODO\"\n \n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:8080/api/todos", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "api", + "todos" + ] + } + }, + "response": [] + }, + { + "name": "delete todo", + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\":\"gauthier\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:8080/api/todos/58", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "api", + "todos", + "58" + ] + } + }, + "response": [] + }, + { + "name": "modify todo", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\":\"aaaa\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:8080/api/todos/51", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "api", + "todos", + "51" + ] + } + }, + "response": [] + } + ] + } + ] +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index dfae12751896cf3bd9c9c9529bb2cf0c5bd5dd22..1506e84e1338378adcdfe218f4fa768484f82c38 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,9 +6,9 @@ services: networks: - db environment: - - POSTGRES_PASSWORD=ilovethierion - - POSTGRES_USER=ilovethierion - - POSTGRES_DB=entrainement_db + - POSTGRES_PASSWORD=${DATABASE_PASSWORD:-ilovethierion} + - POSTGRES_USER=${DATABASE_USERNAME:-ilovethierion} + - POSTGRES_DB=${DATABASE_NAME:-entrainement_db} volumes: - db-data:/var/lib/postgresql/data healthcheck: @@ -23,19 +23,6 @@ services: ports: - "5432:5432" - flyway: - image: flyway/flyway:9-alpine - command: -connectRetries=60 -baselineVersion="0.0" baseline migrate info - volumes: - - ./flyway/sql:/flyway/sql:ro - environment: - - FLYWAY_URL=${JDBC_URL} - - FLYWAY_USER=${DATABASE_USERNAME} - - FLYWAY_PASSWORD=${DATABASE_PASSWORD} - depends_on: - - db - networks: - - db networks: db: