Skip to content

SIGS-UnB/core

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SIGS - Sistema Inteligente de Gestão de Salas

SIGS-image

Build Status Maintainability Test Coverage Ruby Rails MIT License

SIGS is a Ruby on Rails website project design for UnB (University of Brasília). The project aims to facilitate and automate the process of allocation of university rooms by city officials, coordinators and other stakeholders. For more informations see the The Wiki Project (wrote in brazilian portuguese).

Further information about how to contribute and information about the project community, you may also want to read our Contributing document and our Code of Conduct, we strongly recommend.

Features

To see the features of the project Click Here.

License

To see the license of the project Click Here

Getting Started

The SIGS project uses Docker to isolate both the staging and production environment, the staging environment is also used to test new features and corrections. With Docker Compose both environments cited can be easily run with a few commands in your terminal (you should install and set up Docker and Docker Compose on your machine, see steps below). You may also run SIGS via rails serve, for this, you should enter the SIGS folder and run it as a normal rails web app, but we strongly recommend to not do so, if you still want to run this way, do it at your own risk.

Set up using Docker

  • Install Docker

  • Install Docker Compose

  • Build the container image

    • Development Environment

      $ docker-compose -f docker-compose-dev.yml build
      
    • Production Environment

      $ docker-compose -f docker-compose-prod.yml build
      
  • Run the container

    • Development Environment

      $ docker-compose -f docker-compose-dev.yml up -d
      
    • Production Environment

      $ docker-compose -f docker-compose-prod.yml up -d
      
    • Homolog Environment

      $ docker-compose -f docker-compose-homolog.yml up -d
      

    OBS: The option -d is used to run SIGS in background mode, so, this way, you can still use your terminal after starting the docker of SIGS. If you want to see the container log just remove the -d option

  • Set up the Database

    To create the database, run the migration and populate it with fictional data

      $ docker-compose run web rails db:create db:migrate db:seed
    
  • Open the internet browser in http://localhost:3000/.

Running Tests

Cucumber

docker exec sigs bundle exec rake cucumber

RSpec

bundle exec rspec

Rubocop

bundle exec rubocop

Set up Production

  1. Change environment variables on production.env file

  2. If you want to get auto letsencrypt certificates uncomment nginx config.

#server {
#    listen 80;
#    server_name $SIGS_DOMAIN;

#    location / {
#        return 301 https://$host$request_uri;
#    }

#    location /.well-known/acme-challenge/ {
#        root /var/www/certbot;
#    }
#}

server {
    #listen 443 ssl;

    #ssl_certificate /etc/letsencrypt/live/$SIGS_DOMAIN/fullchain.pem;
    #ssl_certificate_key /etc/letsencrypt/live/$SIGS_DOMAIN/privkey.pem;
    #include /etc/letsencrypt/options-ssl-nginx.conf;
    #ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
  1. Point DNS record to your External IP
  2. Change your domain and email on docker/prod/init-letencrypt.sh
domains=(example.com)
email="[email protected]" # Adding a valid address is strongly recommended
  1. Run sudo ./docker/prod/init-letencrypt.sh
  2. Run docker-compose -f docker-compose-prod.yml up --build
  3. Open your favorite browser and navigate to your domain

Using the application

Deploy

Deploy SIGS is an easy task, all you have to do is follow these steps:

  • First, clone our repository on your machine:

      $ git clone --depth=50 --branch=develop https://github.com/SIGS-UnB/core.git SIGS-GCES/core
    
  • Now ensure that you have installed Docker and Docker Compose on your machine:

      $ docker --version
      $ Docker version 18.06.1-ce, build e68fc7a # terminal output
      $ docker-compose --version
      $ docker-compose version 1.21.2, build a133471 # terminal output
    

    OBS: This is an example output, the output may vary.

  • (Optional) Configure your docker hub credentials on your .bashrc or .profile file:

      export DOCKERHUB_USER=<your-username>
      export DOCKERHUB_PASS=<your-dockerhub-password>
    

    Save the file and then run on your terminal:

      source ~/.bashrc
    
  • Lastly, run the script deploy file on project's folder:

      bash scprit/deploy.sh
    

    You may run this script time to time to keep your SIGS up-to-date, just stay tuned on project's releases on this link.

    OBS: You should correct the script to the right path on the 'docker compose' file, on line 15 to 17, and if you didn't set up your docker hub login credentials you should, as well, receive an error but that is expected.

Further configuration may be needed (nginx configurations, domain purchase and configurations, machine configurations and so on), but you're free to customize and run SIGS at your own way, remember, this is an open source project!

The project maintainers' deploy is running on a digitalocean droplet that's also easy to do and keep! You can access it from this link.

Packages

No packages published

Languages

  • Ruby 53.9%
  • HTML 32.2%
  • CSS 4.0%
  • Gherkin 3.8%
  • JavaScript 3.3%
  • CoffeeScript 1.8%
  • Other 1.0%