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 #439 from testmycode/tmcapiteamsetup
Setting up tmc-api-team environment
- Loading branch information
Showing
10 changed files
with
131 additions
and
7 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
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,3 @@ | ||
module Api::V8 | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
class Api::V7::ApidocsController < ActionController::Base | ||
include Swagger::Blocks | ||
|
||
swagger_root do | ||
key :swagger, "2.0" | ||
info do | ||
key :version, "1.0.0" | ||
key :title, "TMC API documentation" | ||
key :description, "TMC API documentation" | ||
contact do | ||
key :name, "TestMyCode" | ||
key :url, "https://cs.helsinki.fi" | ||
end | ||
license do | ||
key :name, "MIT" | ||
end | ||
end | ||
tag do | ||
key :name, "api" | ||
key :description, "API operations" | ||
end | ||
parameter :path_organization_id do | ||
key :name, :organization_id | ||
key :in, :path | ||
key :description, "Organization's id" | ||
key :required, true | ||
key :type, :string | ||
end | ||
parameter :path_course_id do | ||
key :name, :course_id | ||
key :in, :path | ||
key :description, "Course's id" | ||
key :required, true | ||
key :type, :integer | ||
end | ||
parameter :path_exercise_id do | ||
key :name, :exercise_id | ||
key :in, :path | ||
key :description, "Exercise's id" | ||
key :required, true | ||
key :type, :integer | ||
end | ||
response :error do | ||
key :description, "An error occurred" | ||
schema do | ||
key :title, :errors | ||
key :description, "A list of error messages" | ||
key :type, :array | ||
items do | ||
key :type, :string | ||
end | ||
end | ||
end | ||
key :host, "localhost:3000" | ||
key :consumes, ["application/json"] | ||
key :produces, ["application/json"] | ||
end | ||
|
||
# A list of all classes that have swagger_* declarations. | ||
SWAGGERED_CLASSES = [ | ||
self, | ||
].freeze | ||
|
||
def index | ||
render json: Swagger::Blocks.build_root_json(SWAGGERED_CLASSES) | ||
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
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,19 @@ | ||
version: '2' | ||
services: | ||
db_dev: | ||
image: postgres:9.4 | ||
volumes: | ||
- ./pg-data:/var/lib/postgresql | ||
web_dev: | ||
build: . | ||
entrypoint: ./dev-entry.sh | ||
volumes: | ||
- .:/app | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- DB_HOST=db_dev | ||
- HOST=$HOST | ||
- SANDBOX_URL=$SANDBOX_URL | ||
depends_on: | ||
- db_dev |
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,27 @@ | ||
version: '2' | ||
services: | ||
db_test: | ||
image: postgres:9.4 | ||
web_test: | ||
build: . | ||
entrypoint: ./entry.sh | ||
ports: | ||
- "3030-3050:3030-3050" | ||
expose: | ||
- 3030-3050 | ||
environment: | ||
- RSPEC_PATTERN="spec/integration/utf8_exercise_spec.rb" | ||
- DB_HOST=db_test | ||
- HOST=$HOST | ||
- SANDBOX_URL=$SANDBOX_URL | ||
- SANDBOX_HOST=http://10.8.0.100 | ||
- SANDBOX_PORT=57001 | ||
- REPORT_URL=$REPORT_URL | ||
- REPORT_PORT=4567 | ||
- RAILS_ENV=test | ||
- RACK_ENV=test | ||
- MULTI_HOST_SETUP=1 | ||
depends_on: | ||
- db_test | ||
volumes: | ||
- .:/app |
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