https://github.com/byhbt/rails-classified
Rails Classified App
https://github.com/byhbt/rails-classified
classified-ads rails
Last synced: about 1 month ago
JSON representation
Rails Classified App
- Host: GitHub
- URL: https://github.com/byhbt/rails-classified
- Owner: byhbt
- License: mit
- Created: 2021-01-15T17:42:07.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-30T10:15:59.000Z (over 4 years ago)
- Last Synced: 2025-09-07T07:02:57.719Z (about 1 month ago)
- Topics: classified-ads, rails
- Language: Ruby
- Homepage:
- Size: 654 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](REPO_URL goes here)
## Introduction

## Project Setup
### Docker
* Install [Docker for Mac](https://docs.docker.com/docker-for-mac/install/)
* Setup and boot the Docker containers:
```sh
./bin/envsetup.sh
```### Development
* Setup the databases:
* Postgres:
```sh
rake db:setup
```* Run the Rails app
```sh
foreman start -f Procfile.dev
```## Tests
### Docker-based tests on the CI server
Add the following build settings to run the tests in the Docker environment via Docker Compose (configuration in `docker-compose.test.yml`):
* Configure the environment variable `BRANCH_TAG` to tag Docker images per branch:
```sh
export BRANCH_TAG=$SEMAPHORE_BRANCH_ID
```Each branch needs to have its own Docker image to avoid build settings disparities and leverage Docker image caching.
> BRANCH_TAG must not contain special characters (`/`) to be valid. So using $BRANCH_NAME will not work e.g. chore/setup-docker.
An alternative is to use a unique identifier such as PR_ID or BRANCH_ID on the CI server.* Pull the latest version the Docker image for the branch:
```sh
docker pull $DOCKER_IMAGE:$BRANCH_TAG || true
```On each build, the CI environment does not contain yet a cached version of the image. Therefore, it is required to pull
it first to leverage the `cache_from` settings of Docker Compose which avoids rebuilding the whole Docker image on subsequent test builds.* Build the Docker image:
```sh
docker-compose -f docker-compose.test.yml build
```Upon the first build, the whole Docker image is built from the ground up and tagged using `$BRANCH_TAG`.
* Push the latest version of the Docker image for this branch:
```sh
docker push $DOCKER_IMAGE:$BRANCH_TAG
```* Setup the test database:
```sh
docker-compose -f docker-compose.test.yml run test bin/bundle exec rake db:test:prepare
```#### Semaphore CI 2.0
To setup the semaphore CI 2.0 for the project, please follow [this guideline](.semaphore/README.md)
### Test
* Run all tests:
```sh
docker-compose -f docker-compose.test.yml run test
```* Run a specific test:
```sh
docker-compose -f docker-compose.test.yml run test bin/bundle exec spec [rspec-params]
```### Automated Code Review Setup
- Add a bot (i.e. `team-nimblehq`) to this repository or to the organization. The bot requires permission level “Write” to be able to set a PR’s status.- Create a [Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
from bot account with `public_repo` scope, and set it as `DANGER_GITHUB_API_TOKEN` secret on Semaphore Environment Settings.### Other
Ads listing based on following plugins or services:
- Bootsnip