This repository has been archived by the owner on May 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from YACS-RCOS/staging
Merge Yacs on Docker into Master for release.
- Loading branch information
Showing
30 changed files
with
365 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
RAILS_ENV=development | ||
WEB_CONCURRENCY=1 | ||
MAX_THREADS=4 | ||
SECRET_TOKEN=temp | ||
SECRET_KEY_BASE=temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,5 @@ | |
# Ignore tern files | ||
\.tern-port | ||
|
||
/coverage/ | ||
/coverage/ | ||
/data/**/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
language: ruby | ||
rvm: | ||
- 2.2.3 | ||
before_install: | ||
- wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 | ||
- tar -xjf phantomjs-2.0.0-ubuntu-12.04.tar.bz2 | ||
- sudo rm -rf /usr/local/phantomjs/bin/phantomjs | ||
- sudo mv phantomjs /usr/local/phantomjs/bin/phantomjs | ||
before_script: | ||
- psql -c 'create database "yacs-test";' -U postgres | ||
sudo: required | ||
|
||
services: | ||
- docker | ||
|
||
env: | ||
- RAILS_ENV=test | ||
|
||
install: | ||
- bin/yacs-build | ||
- bin/yacs-startd && docker ps | ||
- sleep 10 | ||
- bin/yacs-dbsetup | ||
|
||
script: | ||
- bin/yacs-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM ruby:2.2.3 | ||
|
||
MAINTAINER Richie Young <richiejoeyoung@gmail.com> | ||
|
||
RUN apt-get update && apt-get install -qq -y build-essential nodejs wget --fix-missing --no-install-recommends | ||
|
||
ENV PHANTOMJS_VERSION 2.1.1 | ||
RUN \ | ||
apt-get install -y vim git wget libfreetype6 libfontconfig bzip2 && \ | ||
wget -q --no-check-certificate -O /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 https://github.com/paladox/phantomjs/releases/download/2.1.7/phantomjs-2.1.1-linux-x86_64.tar.bz2 && \ | ||
tar -xjf /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C /tmp && \ | ||
rm -f /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 && \ | ||
mv /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin/phantomjs /usr/bin/phantomjs | ||
|
||
ENV INSTALL_PATH /usr/src/app/ | ||
RUN mkdir -p $INSTALL_PATH | ||
RUN mkdir -p /var/run/puma | ||
|
||
WORKDIR $INSTALL_PATH | ||
COPY Gemfile Gemfile.lock $INSTALL_PATH | ||
|
||
RUN bundle install | ||
COPY . $INSTALL_PATH | ||
|
||
RUN mkdir -p /etc/puma/ssl | ||
COPY nginx/ssl/ /etc/puma/ssl/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose run web rake assets:precompile && rm -f public/index.html | ||
chmod -f a+r public/* || : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose run web bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
mkdir -p data/potsgres | ||
docker-compose run web bundle exec rake db:create db:migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout nginx/ssl/yacs.key -out nginx/ssl/yacs.cer -subj "/C=US/ST=New York/L=Troy/O=RPI/OU=RCOS/CN=yacs.cs.rpi.edu" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose run web $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
docker-compose stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
RAILS_ENV=test docker-compose run web bundle exec rake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
git pull origin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
cd $(dirname `readlink -f "$0"`)/../ | ||
|
||
bin/yacs-update | ||
bin/yacs-build | ||
bin/yacs-dbsetup | ||
bin/yacs-stop | ||
bin/yacs-assets | ||
bin/yacs-startd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,5 @@ | |
|
||
# Raises error for missing translations | ||
# config.action_view.raise_on_missing_translations = true | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
# https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server | ||
|
||
workers Integer(ENV['WEB_CONCURRENCY'] || 2) | ||
workers Integer(ENV['WEB_CONCURRENCY'] || 4) | ||
threads_count = Integer(ENV['MAX_THREADS'] || 5) | ||
threads threads_count, threads_count | ||
|
||
preload_app! | ||
|
||
rackup DefaultRackup | ||
port ENV['PORT'] || 3000 | ||
environment ENV['RACK_ENV'] || 'development' | ||
environment ENV['RAILS_ENV'] || 'development' | ||
|
||
if ENV['DSTATEDIR'] | ||
pidfile "#{ENV['DSTATEDIR']}puma.pid" | ||
state_path "#{ENV['DSTATEDIR']}puma.state" | ||
daemonize true | ||
end | ||
ssl_bind '0.0.0.0', '3000', { | ||
key: "/etc/puma/ssl/yacs.key", | ||
cert: "/etc/puma/ssl/yacs.cer" | ||
} | ||
|
||
pidfile "/var/run/puma/puma.pid" | ||
state_path "/var/run/puma/puma.state" | ||
|
||
on_worker_boot do | ||
# Worker specific setup for Rails 4.1+ | ||
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot | ||
ActiveRecord::Base.establish_connection | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
mkdir -p ./data/postgres | ||
mkdir -p ./data/redis | ||
mkdir -p ./tmp/pids/puma | ||
|
||
docker-compose down | ||
docker-compose build | ||
docker-compose run web rm public/index.html | ||
docker-compose run web bundle exec rake db:create db:migrate | ||
docker-compose run web bundle exec rake assets:precompile | ||
docker-compose up -d |
Oops, something went wrong.