forked from bigbluebutton/bbb-lti-broker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
217 changed files
with
1,234 additions
and
5,368 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 |
---|---|---|
@@ -1,117 +1,44 @@ | ||
version: 2.0 | ||
|
||
--- | ||
version: 2 | ||
jobs: | ||
checkout_code: | ||
build: | ||
working_directory: ~/bbb-lti-broker | ||
docker: | ||
- image: circleci/ruby:2.5.1-node-browsers | ||
working_directory: ~/repo | ||
environment: | ||
PGHOST: localhost | ||
PGUSER: bbb-lti-broker | ||
RAILS_ENV: test | ||
DATABASE_URL: "postgresql://postgres:password@localhost" | ||
- image: postgres:11 | ||
environment: | ||
POSTGRES_PASSWORD: password | ||
steps: | ||
- checkout | ||
- save_cache: | ||
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }} | ||
paths: | ||
- ~/repo | ||
|
||
bundle_dependencies: | ||
docker: | ||
- image: circleci/ruby:2.5.1-node-browsers | ||
working_directory: ~/repo | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- v1-repo-{{ .Environment.CIRCLE_SHA1 }} | ||
- restore_cache: | ||
keys: | ||
- v1-bundle-{{ checksum "Gemfile.lock" }} | ||
- run: bundle install --jobs=4 --retry=3 --path vendor/bundle | ||
- save_cache: | ||
key: v1-bundle-{{ checksum "Gemfile.lock" }} | ||
paths: | ||
- ~/repo/vendor/bundle | ||
# Restore Cached Dependencies | ||
- type: cache-restore | ||
name: Restore bundle cache | ||
key: bbb-lti-broker-{{ checksum "Gemfile.lock" }} | ||
|
||
rake_test: | ||
docker: | ||
- image: circleci/ruby:2.5.1-node-browsers | ||
- image: circleci/postgres:9.5-alpine | ||
working_directory: ~/repo | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- v1-repo-{{ .Environment.CIRCLE_SHA1 }} | ||
- restore_cache: | ||
keys: | ||
- v1-bundle-{{ checksum "Gemfile.lock" }} | ||
- run: bundle install --jobs=4 --retry=3 --path vendor/bundle | ||
- run: | ||
name: Wait for DB | ||
command: dockerize -wait tcp://localhost:5432 -timeout 1m | ||
- run: | ||
name: DB setup | ||
environment: | ||
DATABASE_URL: "postgres://postgres@localhost:5432/bbb_lti_broker_test" | ||
command: bundle exec rake db:setup | ||
- run: | ||
name: Run tests | ||
environment: | ||
DATABASE_URL: "postgres://postgres@localhost:5432/bbb_lti_broker_test" | ||
command: bundle exec rake | ||
# Bundle install dependencies | ||
- run: bundle install --path vendor/bundle | ||
|
||
precompile_assets: | ||
docker: | ||
- image: circleci/ruby:2.5.1-node-browsers | ||
working_directory: ~/repo | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- v1-repo-{{ .Environment.CIRCLE_SHA1 }} | ||
- restore_cache: | ||
keys: | ||
- v1-bundle-{{ checksum "Gemfile.lock" }} | ||
- run: bundle --path vendor/bundle | ||
- run: | ||
name: Precompile assets | ||
command: bundle exec rake assets:precompile | ||
- save_cache: | ||
key: v1-assets-{{ .Environment.CIRCLE_SHA1 }} | ||
paths: | ||
- ~/repo/public/assets | ||
# Cache Dependencies | ||
- type: cache-save | ||
name: Store bundle cache | ||
key: bbb-lti-broker-{{ checksum "Gemfile.lock" }} | ||
paths: | ||
- vendor/bundle | ||
|
||
build_image: | ||
machine: | ||
enabled: true | ||
working_directory: ~/repo | ||
environment: | ||
- HEROKU_APP: still-shelf-38337 | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- v1-repo-{{ .Environment.CIRCLE_SHA1 }} | ||
- restore_cache: | ||
keys: | ||
- v1-bundle-{{ checksum "Gemfile.lock" }} | ||
- restore_cache: | ||
keys: | ||
- v1-assets-{{ .Environment.CIRCLE_SHA1 }} | ||
- checkout | ||
- run: | ||
name: Deploy Master to DockerHub | ||
command: ./scripts/image_build.sh "$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" "$CIRCLE_BRANCH" | ||
# Wait for DB | ||
- run: dockerize -wait tcp://localhost:5432 -timeout 1m | ||
|
||
# Setup the environment | ||
- run: cp dotenv .env | ||
|
||
# Setup the database | ||
- run: bundle exec rake db:setup | ||
|
||
workflows: | ||
version: 2 | ||
build-and-deploy: | ||
jobs: | ||
- checkout_code | ||
- bundle_dependencies: | ||
requires: | ||
- checkout_code | ||
- rake_test: | ||
requires: | ||
- bundle_dependencies | ||
- precompile_assets: | ||
requires: | ||
- bundle_dependencies | ||
- build_image: | ||
requires: | ||
- rake_test | ||
- precompile_assets | ||
# Run the tests | ||
- run: bundle exec rails test:db |
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,28 @@ | ||
# git | ||
.git | ||
.gitignore | ||
README.md | ||
|
||
# Rails | ||
.env | ||
*.rbc | ||
capybara-*.html | ||
.rspec | ||
log | ||
tmp | ||
/db/**/*.sqlite3 | ||
/db/**/*.sqlite3-journal | ||
/db/production | ||
/db/production-postgres | ||
public/assets | ||
public/b | ||
coverage/ | ||
.rvmrc | ||
vendor/bundle | ||
.bundle | ||
Dockerfile | ||
.gitlab-ci.yml | ||
.rubocop.yml | ||
.travis.yml | ||
spec | ||
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,61 @@ | ||
inherit_mode: | ||
merge: | ||
- Exclude | ||
require: | ||
- rubocop-rails | ||
AllCops: | ||
Exclude: | ||
- bin/puma | ||
- bin/pumactl | ||
- bin/setup | ||
- bin/rainbows | ||
- bin/unicorn | ||
- bin/unicorn_rails | ||
- bin/update | ||
- bin/yarn | ||
- vendor/bundle/**/* | ||
TargetRubyVersion: 2.6 | ||
Layout/HashAlignment: | ||
EnforcedHashRocketStyle: [ key, table ] | ||
EnforcedColonStyle: [ key, table ] | ||
Layout/LineLength: | ||
Max: 128 | ||
Metrics: | ||
Enabled: false | ||
Naming/AccessorMethodName: | ||
Exclude: | ||
- app/controllers/bigbluebutton_api_controller.rb | ||
Naming/PredicateName: | ||
Exclude: | ||
- app/controllers/bigbluebutton_api_controller.rb | ||
Rails: | ||
Enabled: true | ||
Rails/DynamicFindBy: | ||
# The models used in this code aren't actually ActiveRecord | ||
Enabled: false | ||
Style/AsciiComments: | ||
AllowedChars: [ © ] | ||
Style/Documentation: | ||
Enabled: false | ||
Style/DoubleNegation: | ||
Enabled: false | ||
Style/MethodCallWithArgsParentheses: | ||
Enabled: true | ||
IgnoredMethods: | ||
- desc | ||
- gem | ||
- include | ||
- require | ||
- require_relative | ||
- ruby | ||
- raise | ||
- source | ||
- throw | ||
Exclude: | ||
- "**/*.xml.builder" | ||
Style/SymbolArray: | ||
MinSize: 6 | ||
Style/TrailingCommaInArrayLiteral: | ||
EnforcedStyleForMultiline: consistent_comma | ||
Style/TrailingCommaInHashLiteral: | ||
EnforcedStyleForMultiline: consistent_comma |
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
Oops, something went wrong.