From ae6ccf40c3390d96547a514d862fb43dbb72ecb9 Mon Sep 17 00:00:00 2001 From: pedrofnseca Date: Tue, 30 Jul 2024 10:12:22 -0300 Subject: [PATCH] feat: Add scripts folder for build and run scripts --- README-PT.md | 9 ++------- README.md | 12 +++--------- bin/main | Bin 21728 -> 21728 bytes build.sh => scripts/build.sh | 1 + docker_run.sh => scripts/docker_run.sh | 2 ++ main_run.sh => scripts/main_run.sh | 2 +- 6 files changed, 9 insertions(+), 17 deletions(-) rename build.sh => scripts/build.sh (95%) mode change 100755 => 100644 rename docker_run.sh => scripts/docker_run.sh (96%) mode change 100755 => 100644 rename main_run.sh => scripts/main_run.sh (84%) mode change 100755 => 100644 diff --git a/README-PT.md b/README-PT.md index 4743284..059cb82 100644 --- a/README-PT.md +++ b/README-PT.md @@ -46,19 +46,14 @@ Neste projeto, estou usando um banco de dados Postgres para armazenar informaƧ - Atualize as variƔveis com suas credenciais de banco de dados. 4. Executando o Servidor: - - Usando Docker: + - Usando Docker (Linux): ```bash - docker build -t rest-api-c . - docker run -d -p 8080:80 --name rest-api-c rest-api-c + ./docker_run.sh ``` - Sem Docker (Linux): ```bash ./main_run.sh ``` - - Sem Docker (Windows): - ```bash - ./main_run.bat - ``` 5. Acesse o servidor em `http://localhost:8080/` no seu navegador. ## Endpoints diff --git a/README.md b/README.md index d445334..f7299ad 100644 --- a/README.md +++ b/README.md @@ -47,19 +47,13 @@ In this project, I'm using a Postgres database to store user information. The da - Update the variables with your database credentials. 4. Running the Server: - - Using Docker: + - Using Docker (Linux): ```bash - docker build -t rest-api-c . - docker run -d -p 8080:80 --name rest-api-c rest-api-c + ./scripts/docker_run.sh ``` - Without Docker (Linux): ```bash - ./main_run.sh - ``` - - Without Docker (Windows): - ```bash - make - ./bin/main + ./scripts/main_run.sh ``` 5. Access the API at http://localhost:8080 diff --git a/bin/main b/bin/main index b8b2342a7859dc7d9e38d7205af4aba4ee54745b..b1a7583f058a1bcdcaab2b2c9f648170fb252c6a 100755 GIT binary patch delta 703 zcmYk4ZAg<*6vv-)b(Jrv)8^dV_DqLNw3@c(VXPMDhoW~-GMPbap`O7$>aS#9C>Df0fhUX6H3YqgOZuF`mZTNZxKo{JQb%xo=`gh5 ztx{*UTa%u@mPpO#88n5PlU7Jmo$4g#Jt!N(kb}<*9q#htcu0lSWs7$40Dgy=R4Eg z+qyGdwjS^Do^1PFw0HabNxAjEH1~A(rpzj3uI4dZyfer7EIpzB9p{-K2>nC@QJUv` zl6>QP&Lye?#KXi0(NFwD3=^9_a2_Gf5?>KlKXRTRR(z&?m>?V@x`^T;=N=-9bKXy^ zS>pUA6ZFCei77Hv%bYJ0cMx+k1YroBb}O`_*RF-EQg9W@NnV5b7UrXh17k|>!X)Kd1a0z$G zBD}yh*}~LuyeylTHI8Gl3A&W0GGB*Zb1Ri8S0oc6*jI0ZPUUueegT}oM-8^De?M@o R!I4#BPhYS^aW>vyzW|`w?~4Ec delta 855 zcmYL|ZAepL6vywmYC1F9baOa2H@3>Y%&FVdg@X+(jMVVuLs3L~!+hE9a1$vinM5Qg zDQ7`n1tkrGa!Cde1VJYIP*BjDwQA%`f)G^tA)d~iu^u?*_nh-T=Ww6r-kX?##0=bZ zfFzm4rB*U_6igtCR_%mo;xNA{f56*>7tNbfXTvzQb7!p&XibzU%NxRFKT`~zn zI9p=NjVN~NZ*HaP^VN!i4ly;VXiq6({WY|zqhQ7*bvLY{RkI(K@RX(n2JyD00^0Gt z#=`66C@Vb(3=fr_gn5jXUIZt~vCD*lx9$|6MJ|)eC`u&lBzv0=lrE^SZ)R8jDxV!r;gO-)Iic zan&n~)e(Oa&l2CQGIoWSv(DHw&#Aaev{|IY@^{8Ih=m)BlQL0ff1((qOp6Pl diff --git a/build.sh b/scripts/build.sh old mode 100755 new mode 100644 similarity index 95% rename from build.sh rename to scripts/build.sh index f6b5876..00b3a8a --- a/build.sh +++ b/scripts/build.sh @@ -1,4 +1,5 @@ #!/bin/bash +cd .. set -e diff --git a/docker_run.sh b/scripts/docker_run.sh old mode 100755 new mode 100644 similarity index 96% rename from docker_run.sh rename to scripts/docker_run.sh index 2b48320..7bf0b45 --- a/docker_run.sh +++ b/scripts/docker_run.sh @@ -1,5 +1,7 @@ #!/bin/bash +cd .. + CONTAINER_NAME="rest-api-c" docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1 diff --git a/main_run.sh b/scripts/main_run.sh old mode 100755 new mode 100644 similarity index 84% rename from main_run.sh rename to scripts/main_run.sh index ed2f314..9bb1cd2 --- a/main_run.sh +++ b/scripts/main_run.sh @@ -6,4 +6,4 @@ set -e echo "Executando o programa..." -./bin/main +../bin/main