Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
4e7cbf3
chore: init backend project
lucasdbr05 Jun 13, 2025
502e673
Merge pull request #1 from EmersonJr/chore/init_project
lucasdbr05 Jun 13, 2025
5878d6b
chore: add features for bdd
lucasdbr05 Jun 13, 2025
7b24c3b
bdd: form class bdd
lucasdbr05 Jun 15, 2025
600ffb2
bdd: download csv report
lucasdbr05 Jun 15, 2025
55c2cdd
bdd: reset password
lucasdbr05 Jun 15, 2025
7d6c224
Merge pull request #2 from EmersonJr/bdd/cucumber-scenarios-lucas
lucasdbr05 Jun 16, 2025
b021f14
adding Pedro features
pedro-neris Jun 21, 2025
0f20d94
docs: add reame with members
lucasdbr05 Jun 21, 2025
4e9da6d
feat: adding bdd cases descriptions
EmersonJr Jun 21, 2025
b009de5
Merge branch 'main' of https://github.com/EmersonJr/CAMAAR
EmersonJr Jun 21, 2025
cca7e0f
bdd: password redefinition
lucasdbr05 Jun 21, 2025
0a589bc
docs: add bdd on readme
lucasdbr05 Jun 21, 2025
f1ac5d9
Merge branch 'main' of https://github.com/EmersonJr/CAMAAR
lucasdbr05 Jun 21, 2025
21f8ed3
docs: add bdd on readme
lucasdbr05 Jun 21, 2025
d4f846d
docs: add bdd on readme
lucasdbr05 Jun 21, 2025
aeacaae
docs: branch and commit policy
lucasdbr05 Jun 21, 2025
aa1d8f1
feat: adding more scenarios
pedro-neris Jun 21, 2025
59aa024
docs: minor changes
lucasdbr05 Jun 21, 2025
5ba259d
fix: changing feature name to better readability
pedro-neris Jun 22, 2025
a849cae
Merge branch 'main' of https://github.com/EmersonJr/CAMAAR
pedro-neris Jun 22, 2025
55052d3
feat: adding features names and points to read me
pedro-neris Jun 22, 2025
0811831
fix: deleting emoji before 'features'
pedro-neris Jun 22, 2025
08a91e8
fix: changing features
pedro-neris Jun 22, 2025
ea1b4b5
refactor: rename some cucumber files
lucasdbr05 Jun 22, 2025
538d77f
Merge branch 'main' of https://github.com/EmersonJr/CAMAAR
lucasdbr05 Jun 22, 2025
6fbee13
fix: fixing miro url
pedro-neris Jun 22, 2025
be09653
chore: docker configs changes
lucasdbr05 Jul 10, 2025
2d589e1
chore: docker compose
lucasdbr05 Jul 10, 2025
676e856
feat: admin module
lucasdbr05 Jul 10, 2025
f601870
feat: user module
lucasdbr05 Jul 10, 2025
b79b7ae
feat: user module
lucasdbr05 Jul 10, 2025
a38ebda
feat: question module
lucasdbr05 Jul 10, 2025
c96884e
feat: formulario module
lucasdbr05 Jul 10, 2025
a53b356
feat: disciplina module
lucasdbr05 Jul 10, 2025
569740f
feat: departamentos module
lucasdbr05 Jul 10, 2025
431045e
refactor: minor changes
lucasdbr05 Jul 10, 2025
650872e
Merge pull request #3 from EmersonJr/feat/modules-scaffolding
lucasdbr05 Jul 10, 2025
4a7b6cd
docs: docker compose configuration
lucasdbr05 Jul 10, 2025
0edeac1
feat: adding some things to the turma crud
EmersonJr Jul 10, 2025
edf5314
feat: finishing migrations and models
pedro-neris Jul 10, 2025
7d47dad
Merge pull request #4 from EmersonJr/creating-database-and-models
EmersonJr Jul 10, 2025
2f3cb84
feat: adding mvp crud departamentos
EmersonJr Jul 10, 2025
6d50953
chore: ci pipeline configuration
lucasdbr05 Jul 10, 2025
deee632
chore: pull request template
lucasdbr05 Jul 10, 2025
97a510f
Frontend adm
Jul 10, 2025
ebe0034
chore: minor changes on ci pipeline
lucasdbr05 Jul 10, 2025
a14971c
feat: rspec configurations
lucasdbr05 Jul 10, 2025
14dd845
Merge pull request #5 from Desesperad0s/chore/ci-pipeline
lucasdbr05 Jul 10, 2025
ee2de92
feat: finishing migrations and models
pedro-neris Jul 10, 2025
298c1e7
chore: ci pipeline configuration
lucasdbr05 Jul 10, 2025
62e6da3
chore: pull request template
lucasdbr05 Jul 10, 2025
9cd7bd2
chore: minor changes on ci pipeline
lucasdbr05 Jul 10, 2025
a60c4fa
feat: rspec configurations
lucasdbr05 Jul 10, 2025
19ccf65
merging
EmersonJr Jul 10, 2025
4bde005
feat: adding some things to the turma crud
EmersonJr Jul 10, 2025
e455a38
feat: adding mvp crud departamentos
EmersonJr Jul 10, 2025
2823c70
feat: rspec configurations
lucasdbr05 Jul 10, 2025
f5ec568
merging
EmersonJr Jul 10, 2025
eb3dda4
feat: merging
EmersonJr Jul 10, 2025
8953245
fix: fixing troubles in merge
EmersonJr Jul 10, 2025
e37498a
minor changes
lucasdbr05 Jul 10, 2025
e5d1311
minor changes
lucasdbr05 Jul 10, 2025
87702e4
minor changes
lucasdbr05 Jul 10, 2025
fc37d3d
Merge pull request #6 from Desesperad0s/feat/CRUD-turma-dep
lucasdbr05 Jul 10, 2025
7d4bd89
chore: front end configurations
lucasdbr05 Jul 10, 2025
c46f18f
Frontend adm
Jul 10, 2025
c795030
feat: gerenciamento page changes
lucasdbr05 Jul 11, 2025
aae2cab
Merge branch 'Front' of https://github.com/EmersonJr/CAMAAR into Front
lucasdbr05 Jul 11, 2025
250a123
fix: removing not necessary files
lucasdbr05 Jul 11, 2025
88588a7
refactor: minor changes
lucasdbr05 Jul 11, 2025
abd98ab
Merge pull request #7 from Desesperad0s/Front
lucasdbr05 Jul 11, 2025
3a8ebc2
refactor: changes users migrations
lucasdbr05 Jul 11, 2025
2170262
test: controller test spec
lucasdbr05 Jul 11, 2025
249abee
test: model test spec
lucasdbr05 Jul 11, 2025
19bbcf6
test: requests test spec
lucasdbr05 Jul 11, 2025
7ffa04b
feat: users module
lucasdbr05 Jul 11, 2025
296967d
chore: cors configurations
lucasdbr05 Jul 11, 2025
ac3215a
fix: add orign on cors and set new frontend port
lucasdbr05 Jul 11, 2025
6658bd7
Merge pull request #8 from Desesperad0s/feat/users-module
lucasdbr05 Jul 11, 2025
99619e2
refactor: change default frontend port
lucasdbr05 Jul 11, 2025
7b8c2df
Merge branch 'main' of https://github.com/EmersonJr/CAMAAR
lucasdbr05 Jul 11, 2025
9eaa304
chore: add tools to tests
lucasdbr05 Jul 11, 2025
10fee76
test: factories to help tests
lucasdbr05 Jul 11, 2025
ac1873f
tests: template tests
lucasdbr05 Jul 11, 2025
d87a8c4
tests: question and templates models
lucasdbr05 Jul 11, 2025
b26d661
tests: rails helper changes
lucasdbr05 Jul 11, 2025
0265c1f
fix: database minor changes
lucasdbr05 Jul 11, 2025
fe142ac
refactor: minor database and config changes
lucasdbr05 Jul 11, 2025
1ef3a8c
tests: template resquests
lucasdbr05 Jul 11, 2025
1a61a51
feat: models definitions for question and template
lucasdbr05 Jul 11, 2025
d871a5c
feat: template controller
lucasdbr05 Jul 11, 2025
0e61733
refactor: mionr linter changes
lucasdbr05 Jul 11, 2025
9ee3a51
Merge pull request #9 from Desesperad0s/feat/template-and-questions-m…
lucasdbr05 Jul 11, 2025
931cc28
chore: configure docker setup for frontend
lucasdbr05 Jul 11, 2025
c969568
feat: init api client
lucasdbr05 Jul 11, 2025
5f4ec16
minor changes
lucasdbr05 Jul 11, 2025
5c6fc9e
feat: login page
lucasdbr05 Jul 11, 2025
58c0275
feat: create template modal
lucasdbr05 Jul 11, 2025
fd14931
Merge pull request #10 from Desesperad0s/feat/frontend-configurations
lucasdbr05 Jul 11, 2025
b6d4ffe
docs: configuration with docker and manual
lucasdbr05 Jul 11, 2025
f2348fa
docs: configuration with docker and manual
lucasdbr05 Jul 11, 2025
11bc356
feat: alternativas module
lucasdbr05 Jul 11, 2025
6b505c4
tests: alternativas tests
lucasdbr05 Jul 11, 2025
45d7afa
refactor: implementa testes pendentes com multiplas alternativas
lucasdbr05 Jul 11, 2025
5ff792f
refactor: db changes to support forms
lucasdbr05 Jul 11, 2025
78eaa50
refactor: minor changes
lucasdbr05 Jul 11, 2025
d86298a
tests: controller tests
lucasdbr05 Jul 11, 2025
2bd2bec
tests: factories to support test creation
lucasdbr05 Jul 11, 2025
4f24295
tests: forms and answers module
lucasdbr05 Jul 11, 2025
de7a15c
tests: forms resquests
lucasdbr05 Jul 11, 2025
0671a5e
feat: forms and aswers module
lucasdbr05 Jul 11, 2025
ca8ca3c
Merge pull request #11 from Desesperad0s/feat/forms-and-answers-module
lucasdbr05 Jul 11, 2025
6c8082d
hotfix: solve problems on docker compose
lucasdbr05 Jul 11, 2025
a1de624
minor changes
lucasdbr05 Jul 11, 2025
01a49d9
feat/ login api
hsaless Jul 12, 2025
a64495b
feat: minor changes
lucasdbr05 Jul 12, 2025
a6f7e3f
feat: minor changes
lucasdbr05 Jul 12, 2025
7628c66
feat/ login api
hsaless Jul 12, 2025
5790fce
hotfix: o futebol é foda
lucasdbr05 Jul 12, 2025
6b5402b
hotfix: minor changes
lucasdbr05 Jul 12, 2025
bbf4cc4
Delete CAMAAR_frontend/node_modules directory
lucasdbr05 Jul 12, 2025
e2e8577
Merge pull request #12 from Desesperad0s/feat/API
hsaless Jul 12, 2025
d84ce96
feat: auth module
lucasdbr05 Jul 12, 2025
bbaf3f3
readicionando a merda dos testes
EmersonJr Jul 13, 2025
6b57bb3
feat: frontend changes
lucasdbr05 Jul 13, 2025
d939042
hotfix: forms creation
lucasdbr05 Jul 13, 2025
7a56f2d
feat/ integr forms
hsaless Jul 13, 2025
eb1481e
merging
EmersonJr Jul 13, 2025
e3b5dc7
tests: fix tests
lucasdbr05 Jul 13, 2025
4a17da8
Merge pull request #13 from Desesperad0s/feat/auth
lucasdbr05 Jul 13, 2025
5502f66
Merge remote-tracking branch 'origin/main' into feat/forms-ger
hsaless Jul 13, 2025
b9bce8f
aaaaaaaaaaaaa
EmersonJr Jul 13, 2025
03507a4
allowing user to answer
pedro-neris Jul 13, 2025
f0625a0
feat: adding some cruds
EmersonJr Jul 13, 2025
a75df7e
Merge branch 'main' of https://github.com/Desesperad0s/CAMAAR into fe…
EmersonJr Jul 13, 2025
40088c1
fixing delete error
pedro-neris Jul 13, 2025
3acedab
feat: adding the json Processor service
EmersonJr Jul 13, 2025
feda62c
feat/ tela avaliações + ger
hsaless Jul 13, 2025
2ac0c38
Merge pull request #15 from Desesperad0s/feat-adding-forms-answer
lucasdbr05 Jul 13, 2025
e70e05a
refactor: forms model changes
lucasdbr05 Jul 13, 2025
23583bb
Merge branch 'main' of https://github.com/EmersonJr/CAMAAR
lucasdbr05 Jul 13, 2025
8c259fa
submitting forms
pedro-neris Jul 13, 2025
466ce3f
fixing sintax error
pedro-neris Jul 13, 2025
7a27690
feat: minor changes
lucasdbr05 Jul 13, 2025
1ec2a20
fix: renormalize
lucasdbr05 Jul 13, 2025
1fde8d4
fix: renormalize
lucasdbr05 Jul 13, 2025
e2c3a9f
Delete CAMAAR_backend/a.out
lucasdbr05 Jul 13, 2025
7893ae5
Merge pull request #16 from Desesperad0s/feat/CRUDdisc
lucasdbr05 Jul 13, 2025
b1ca2bc
feat: adding the json processor
EmersonJr Jul 13, 2025
814d0bb
Merge branch 'main' of https://github.com/EmersonJr/CAMAAR
lucasdbr05 Jul 13, 2025
980a800
feat: solve conflicts
lucasdbr05 Jul 13, 2025
da7419e
Merge pull request #17 from Desesperad0s/feat-adding-forms-answer
lucasdbr05 Jul 13, 2025
541be81
feat/ formulário n sei oq mais botar aqui
hsaless Jul 13, 2025
d9e444c
rebase main
lucasdbr05 Jul 13, 2025
bf27186
refactor: add missing relations and update seed
lucasdbr05 Jul 13, 2025
8f8d827
refactor: minor changes
lucasdbr05 Jul 13, 2025
ec1767e
feat: controller changes to aswer form
lucasdbr05 Jul 13, 2025
32fbb7e
feat: answer form page
lucasdbr05 Jul 13, 2025
28361f5
feat: create forms by admin
lucasdbr05 Jul 13, 2025
96fb313
feat: available forms
lucasdbr05 Jul 13, 2025
9e67110
tests: fix tests with problems
lucasdbr05 Jul 13, 2025
8412bf4
Merge pull request #19 from Desesperad0s/feat/answer-forms
lucasdbr05 Jul 13, 2025
2020770
fix: solve conflicts
lucasdbr05 Jul 13, 2025
1727f72
solve problems
lucasdbr05 Jul 13, 2025
440cfb8
Merge pull request #18 from Desesperad0s/feat/forms-ger
lucasdbr05 Jul 13, 2025
08c616b
feat: change templates
lucasdbr05 Jul 13, 2025
923ddff
feat: excel report generator
lucasdbr05 Jul 13, 2025
afefaa3
feat: visualize forms
lucasdbr05 Jul 13, 2025
dec3733
merging
EmersonJr Jul 13, 2025
5d9de74
Merge pull request #20 from Desesperad0s/feat/answers-analysis
lucasdbr05 Jul 13, 2025
b338982
fix: minor routing changes
lucasdbr05 Jul 13, 2025
e87b5c5
Redefinir senha e ajuste login
suzanassm Jul 13, 2025
0361537
feat: adding the send email body feature
EmersonJr Jul 13, 2025
9450b16
Merge branch 'main' of https://github.com/Desesperad0s/CAMAAR into fe…
EmersonJr Jul 13, 2025
801c649
fix: fixing mistakes
EmersonJr Jul 13, 2025
b150231
fix: fixing other mistake
EmersonJr Jul 13, 2025
89996df
tests: init bdd tests
lucasdbr05 Jul 13, 2025
16f4bc4
feat: load users data from json working
lucasdbr05 Jul 13, 2025
f6bf809
tests: minor changes
lucasdbr05 Jul 13, 2025
d86063d
Merge pull request #21 from Desesperad0s/feat/jsonProcessor
lucasdbr05 Jul 13, 2025
16ddf67
Tela de criar nova senha
suzanassm Jul 13, 2025
8d5335d
to remote
lucasdbr05 Jul 13, 2025
543fb63
fix/ roteamento
hsaless Jul 13, 2025
7dd7987
Tetes bdds
suzanassm Jul 13, 2025
23f6567
docs: minor changes
lucasdbr05 Jul 13, 2025
2300f8c
refactor: minor changes
lucasdbr05 Jul 14, 2025
a79ff0c
Testes bdds
suzanassm Jul 14, 2025
fbc7c89
refactor: minor changes
lucasdbr05 Jul 14, 2025
6a75e43
Merge pull request #22 from Desesperad0s/Front2
pedro-neris Jul 14, 2025
fc0622d
Merge branch 'test/bdd-tests' into Tests-bdds
lucasdbr05 Jul 14, 2025
035b752
Merge pull request #25 from Desesperad0s/Tests-bdds
lucasdbr05 Jul 14, 2025
b4d004b
merge main into this branch
lucasdbr05 Jul 14, 2025
281e0b9
fix: solve problems
lucasdbr05 Jul 14, 2025
5dd14ea
Merge pull request #24 from Desesperad0s/fix/roteamento
lucasdbr05 Jul 14, 2025
2c284cd
Merge remote-tracking branch 'origin/main' into test/bdd-tests
lucasdbr05 Jul 14, 2025
b518462
Merge pull request #26 from Desesperad0s/test/bdd-tests
lucasdbr05 Jul 14, 2025
0de4541
Update README.md
pedro-neris Jul 14, 2025
173c3d6
Update README.md
pedro-neris Jul 14, 2025
6c766d4
Update README.md
pedro-neris Jul 14, 2025
add7bcd
refactor: login page change
lucasdbr05 Jul 14, 2025
555b922
Merge branch 'main' of https://github.com/EmersonJr/CAMAAR
lucasdbr05 Jul 14, 2025
48074a0
Update README.md
pedro-neris Jul 14, 2025
162eafa
Update README.md
pedro-neris Jul 14, 2025
f2093b5
chore: minor fixes for react dockerfile
lucasdbr05 Jul 14, 2025
3a7845e
Merge branch 'main' of https://github.com/EmersonJr/CAMAAR
lucasdbr05 Jul 14, 2025
7501e4a
refactor: changes at template and question models
lucasdbr05 Jul 21, 2025
595e8f2
feat: migration to allow template id null on question
lucasdbr05 Jul 21, 2025
65ba3a4
fix: delete template
lucasdbr05 Jul 21, 2025
f86a088
test: fix tests with problems
lucasdbr05 Jul 21, 2025
cd4eb59
Merge pull request #29 from Desesperad0s/fix/delete-template
lucasdbr05 Jul 21, 2025
6cfaea6
testes Bdds
suzanassm Jul 22, 2025
ae49582
Testes bdds
suzanassm Jul 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BACKEND_PORT=3333

FRONTEND_PORT=3000
REACT_APP_BACKEND_URL="http://camaar_backend:3333"
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## What does this merge request do?

- Implement feature X
- Fix bug Y
- Refactor code Z

## How to test?

What should the person reviewing your code do to comprove your code is working

## Images (optional)

## Checklist

- [ ] I've tested my code manually
- [ ] I've self-reviewed and refactored my code
- [ ] I've commented my code, particularly in hard-to-understand areas
- [ ] My changes generate no new errors or warnings
- [ ] My changes contribute to the project
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI - Rails Backend

on:
push:
paths:
- 'CAMAAR_backend/**'
pull_request:
paths:
- 'CAMAAR_backend/**'

jobs:
test:
runs-on: ubuntu-latest
env:
RAILS_ENV: test
defaults:
run:
working-directory: ./CAMAAR_backend
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4.3
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Setup database
run: |
rails db:create
rails db:migrate
- name: Run tests
run: bundle exec rspec
51 changes: 51 additions & 0 deletions CAMAAR_backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.

# Ignore git directory.
/.git/
/.gitignore

# Ignore bundler config.
/.bundle

# Ignore all environment files.
/.env*

# Ignore all default key files.
/config/master.key
/config/credentials/*.key

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/.keep

# Ignore storage (uploaded files in development and any SQLite databases).
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/.keep

# Ignore assets.
/node_modules/
/app/assets/builds/*
!/app/assets/builds/.keep
/public/assets

# Ignore CI service files.
/.github

# Ignore Kamal files.
/config/deploy*.yml
/.kamal

# Ignore development files
/.devcontainer

# Ignore Docker-related files
/.dockerignore
/Dockerfile*
11 changes: 11 additions & 0 deletions CAMAAR_backend/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.

# Mark the database schema as having been generated.
db/schema.rb linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
config/credentials/*.yml.enc diff=rails_credentials
config/credentials.yml.enc diff=rails_credentials

* text=auto
12 changes: 12 additions & 0 deletions CAMAAR_backend/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
90 changes: 90 additions & 0 deletions CAMAAR_backend/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI

on:
pull_request:
push:
branches: [ main ]

jobs:
scan_ruby:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Scan for common Rails security vulnerabilities using static analysis
run: bin/brakeman --no-pager

scan_js:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Scan for security vulnerabilities in JavaScript dependencies
run: bin/importmap audit

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Lint code for consistent style
run: bin/rubocop -f github

test:
runs-on: ubuntu-latest

# services:
# redis:
# image: redis
# ports:
# - 6379:6379
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Install packages
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config google-chrome-stable

- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Run tests
env:
RAILS_ENV: test
# REDIS_URL: redis://localhost:6379/0
run: bin/rails db:test:prepare test test:system

- name: Keep screenshots from failed system tests
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots
path: ${{ github.workspace }}/tmp/screenshots
if-no-files-found: ignore
36 changes: 36 additions & 0 deletions CAMAAR_backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# Temporary files generated by your text editor or operating system
# belong in git's global ignore instead:
# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`

# Ignore bundler config.
/.bundle

# Ignore all environment files.
/.env*

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore storage (uploaded files in development and any SQLite databases).
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

/public/assets

# Ignore master key for decrypting credentials and more.
/config/master.key

/config/master.key
3 changes: 3 additions & 0 deletions CAMAAR_backend/.kamal/hooks/docker-setup.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

echo "Docker set up on $KAMAL_HOSTS..."
3 changes: 3 additions & 0 deletions CAMAAR_backend/.kamal/hooks/post-app-boot.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

echo "Booted app version $KAMAL_VERSION on $KAMAL_HOSTS..."
14 changes: 14 additions & 0 deletions CAMAAR_backend/.kamal/hooks/post-deploy.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

# A sample post-deploy hook
#
# These environment variables are available:
# KAMAL_RECORDED_AT
# KAMAL_PERFORMER
# KAMAL_VERSION
# KAMAL_HOSTS
# KAMAL_ROLES (if set)
# KAMAL_DESTINATION (if set)
# KAMAL_RUNTIME

echo "$KAMAL_PERFORMER deployed $KAMAL_VERSION to $KAMAL_DESTINATION in $KAMAL_RUNTIME seconds"
3 changes: 3 additions & 0 deletions CAMAAR_backend/.kamal/hooks/post-proxy-reboot.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

echo "Rebooted kamal-proxy on $KAMAL_HOSTS"
3 changes: 3 additions & 0 deletions CAMAAR_backend/.kamal/hooks/pre-app-boot.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

echo "Booting app version $KAMAL_VERSION on $KAMAL_HOSTS..."
51 changes: 51 additions & 0 deletions CAMAAR_backend/.kamal/hooks/pre-build.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/sh

# A sample pre-build hook
#
# Checks:
# 1. We have a clean checkout
# 2. A remote is configured
# 3. The branch has been pushed to the remote
# 4. The version we are deploying matches the remote
#
# These environment variables are available:
# KAMAL_RECORDED_AT
# KAMAL_PERFORMER
# KAMAL_VERSION
# KAMAL_HOSTS
# KAMAL_ROLES (if set)
# KAMAL_DESTINATION (if set)

if [ -n "$(git status --porcelain)" ]; then
echo "Git checkout is not clean, aborting..." >&2
git status --porcelain >&2
exit 1
fi

first_remote=$(git remote)

if [ -z "$first_remote" ]; then
echo "No git remote set, aborting..." >&2
exit 1
fi

current_branch=$(git branch --show-current)

if [ -z "$current_branch" ]; then
echo "Not on a git branch, aborting..." >&2
exit 1
fi

remote_head=$(git ls-remote $first_remote --tags $current_branch | cut -f1)

if [ -z "$remote_head" ]; then
echo "Branch not pushed to remote, aborting..." >&2
exit 1
fi

if [ "$KAMAL_VERSION" != "$remote_head" ]; then
echo "Version ($KAMAL_VERSION) does not match remote HEAD ($remote_head), aborting..." >&2
exit 1
fi

exit 0
47 changes: 47 additions & 0 deletions CAMAAR_backend/.kamal/hooks/pre-connect.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env ruby

# A sample pre-connect check
#
# Warms DNS before connecting to hosts in parallel
#
# These environment variables are available:
# KAMAL_RECORDED_AT
# KAMAL_PERFORMER
# KAMAL_VERSION
# KAMAL_HOSTS
# KAMAL_ROLES (if set)
# KAMAL_DESTINATION (if set)
# KAMAL_RUNTIME

hosts = ENV["KAMAL_HOSTS"].split(",")
results = nil
max = 3

elapsed = Benchmark.realtime do
results = hosts.map do |host|
Thread.new do
tries = 1

begin
Socket.getaddrinfo(host, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)
rescue SocketError
if tries < max
puts "Retrying DNS warmup: #{host}"
tries += 1
sleep rand
retry
else
puts "DNS warmup failed: #{host}"
host
end
end

tries
end
end.map(&:value)
end

retries = results.sum - hosts.size
nopes = results.count { |r| r == max }

puts "Prewarmed %d DNS lookups in %.2f sec: %d retries, %d failures" % [ hosts.size, elapsed, retries, nopes ]
Loading