Skip to content

Commit fb7faf4

Browse files
authored
Merge pull request #12 from cs169/main
Iteration 1-3
2 parents c4005e0 + 601a5c7 commit fb7faf4

File tree

140 files changed

+5526
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+5526
-1
lines changed

.github/pull_request_template.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# General Info
2+
3+
- [Pivotal Tracker Story](https://www.pivotaltracker.com/story/show/########)
4+
- [ ] Breaking?
5+
6+
# Changes
7+
8+
Explain your changes here (in such a way that you would understand why you made them a year from now).
9+
10+
# Testing
11+
12+
Explain how you tested your changes. If testing is not necessary, explain why.
13+
14+
# Documentation
15+
16+
Does this PR require documentation. If so, explain where it can be found.
17+
18+
# Checklist
19+
20+
- [ ] Name of branch corresponds to story

.github/workflows/main.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
services:
8+
postgres:
9+
image: postgres:16
10+
env:
11+
POSTGRES_PASSWORD: password
12+
ports:
13+
- 5432:5432
14+
runs-on: ubuntu-latest
15+
env:
16+
DB_USER: postgres
17+
DB_PASSWORD: password
18+
RAILS_ENV: test
19+
RUBY_ENV: test
20+
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
21+
CANVAS_URL: http://bcourses.test.instructure.com/
22+
steps:
23+
- uses: actions/checkout@v1
24+
- name: Install Ruby
25+
uses: ruby/setup-ruby@v1
26+
with:
27+
ruby-version: 3.3.0
28+
- name: Build and test with RSpec
29+
run: |
30+
gem install bundler
31+
bundle install --jobs 4 --retry 3
32+
rails db:create
33+
rails db:migrate
34+
bundle exec rspec
35+
- name: Download and install Code Climate test reporter
36+
run: |
37+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
38+
chmod +x ./cc-test-reporter
39+
env:
40+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
41+
- name: Run before-build command
42+
run: ./cc-test-reporter before-build
43+
- name: Run after-build command
44+
run: |
45+
./cc-test-reporter after-build --exit-code $?
46+
env:
47+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Swagger
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
pull_request: {}
9+
10+
jobs:
11+
swagger:
12+
runs-on: ubuntu-latest
13+
name: Validate Spec
14+
services:
15+
swagger-editor:
16+
image: swaggerapi/swagger-editor:next-v5
17+
ports:
18+
- 80:8080
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Validate Swagger Spec
22+
uses: char0n/swagger-editor-validate@v1
23+
with:
24+
definition-file: app/assets/swagger/swagger.json
25+
ignore-error: app/assets/swagger/shouldIgnoreError.js

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,9 @@ yarn-debug.log*
6767
/storage/*
6868
!/storage/.keep
6969
/public/uploads
70+
71+
/config/master.key
72+
73+
/config/credentials/production.key
74+
75+
.DS_Store

Dockerfile

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# syntax = docker/dockerfile:1
2+
3+
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
4+
ARG RUBY_VERSION=3.3.0
5+
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
6+
7+
# Rails app lives here
8+
WORKDIR /rails
9+
10+
# Set production environment
11+
ENV RAILS_ENV="production" \
12+
BUNDLE_DEPLOYMENT="1" \
13+
BUNDLE_PATH="/usr/local/bundle" \
14+
BUNDLE_WITHOUT="development"
15+
16+
17+
# Throw-away build stage to reduce size of final image
18+
FROM base as build
19+
20+
# Install packages needed to build gems
21+
RUN apt-get update -qq && \
22+
apt-get install --no-install-recommends -y build-essential git libvips pkg-config
23+
24+
# Install application gems
25+
COPY Gemfile Gemfile.lock ./
26+
RUN bundle install && \
27+
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
28+
bundle exec bootsnap precompile --gemfile
29+
30+
# Copy application code
31+
COPY . .
32+
33+
# Precompile bootsnap code for faster boot times
34+
RUN bundle exec bootsnap precompile app/ lib/
35+
36+
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
37+
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
38+
39+
40+
# Final stage for app image
41+
FROM base
42+
43+
# Install packages needed for deployment
44+
RUN apt-get update -qq && \
45+
apt-get install --no-install-recommends -y curl libsqlite3-0 libvips && \
46+
rm -rf /var/lib/apt/lists /var/cache/apt/archives
47+
48+
# Copy built artifacts: gems, application
49+
COPY --from=build /usr/local/bundle /usr/local/bundle
50+
COPY --from=build /rails /rails
51+
52+
# Run and own only the runtime files as a non-root user for security
53+
RUN useradd rails --create-home --shell /bin/bash && \
54+
chown -R rails:rails db log storage tmp
55+
USER rails:rails
56+
57+
# Entrypoint prepares the database.
58+
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
59+
60+
# Start the server by default, this can be overwritten at runtime
61+
EXPOSE 3000
62+
CMD ["./bin/rails", "server"]

Gemfile

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
source "https://rubygems.org"
2+
3+
ruby "3.3.0"
4+
5+
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
6+
gem "rails", "~> 7.1.3"
7+
8+
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
9+
gem "sprockets-rails"
10+
11+
# Use postgres for all env dbs
12+
gem "pg"
13+
14+
# Use the Puma web server [https://github.com/puma/puma]
15+
gem "puma", ">= 5.0"
16+
17+
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
18+
gem "importmap-rails"
19+
20+
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
21+
gem "turbo-rails"
22+
23+
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
24+
gem "stimulus-rails"
25+
26+
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
27+
gem "jbuilder"
28+
29+
# Use Redis adapter to run Action Cable in production
30+
# gem "redis", ">= 4.0.1"
31+
32+
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
33+
# gem "kredis"
34+
35+
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
36+
# gem "bcrypt", "~> 3.1.7"
37+
38+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
39+
gem "tzinfo-data", platforms: %i[ windows jruby ]
40+
41+
# Reduces boot times through caching; required in config/boot.rb
42+
gem "bootsnap", require: false
43+
44+
gem "lms-api"
45+
46+
47+
48+
# Use Active Storage for file uploads [https://guides.rubyonrails.org/active_storage_overview.html]
49+
# gem "activestorage", "~> 7.0.0"
50+
51+
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible [
52+
53+
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
54+
# gem "image_processing", "~> 1.2"
55+
56+
gem 'bootstrap', '~> 5.3.2'
57+
gem 'jquery-rails'
58+
gem 'sassc-rails', '~> 2.1' #dependency for bootstrap
59+
gem 'json'
60+
61+
# Used to make http requests.
62+
gem 'faraday'
63+
64+
# Used to allow dot notation of hashes.
65+
gem 'ostruct'
66+
67+
group :development, :test do
68+
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
69+
gem "debug", platforms: %i[ mri windows ]
70+
gem 'dotenv-rails'
71+
end
72+
73+
group :test do
74+
gem 'rspec-rails'
75+
gem 'guard-rspec'
76+
gem 'simplecov', '~> 0.17.1' , :require => false
77+
gem 'codeclimate-test-reporter'
78+
gem 'cucumber-rails', :require => false
79+
gem 'cucumber-rails-training-wheels'
80+
gem 'database_cleaner'
81+
gem 'timecop'
82+
gem 'webmock'
83+
end
84+
85+
group :development do
86+
# Use console on exceptions pages [https://github.com/rails/web-console]
87+
gem "web-console"
88+
89+
#for debug
90+
gem 'byebug'
91+
92+
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
93+
# gem "rack-mini-profiler"
94+
95+
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
96+
# gem "spring"
97+
end

0 commit comments

Comments
 (0)