Images for building and running the Agave Live Docs
1.3K
Based on the Swagger UI responsive theme. The original Swagger UI responsive theme is modified with branding and configuration for the Agave Platform public tenant.
The theme will adapt to screen size and works on tablets and mobile phones.
Give it a try and enter your own swagger definition.
> *NOTE*: If you came here to make changes to the Agave Platform's Swagger definition, you should visit the [Agave Science API](https://bitbucket.org/agaveapi/agave-flat/src/develop/agave-apidocs/apidocs-api/src/main/html/resources/?at=develop) project for the API definition files.
The primary build method for this project is as a Docker image. To build the image, run the following command:
docker build -t live-docs:build -f Dockerfile.build .
If you are running natively, you will need to install nodejs, and npm to build the project.
npm install
grunt build
When working in development mode, it is easiest to use the built in grunt-server with live reload. You can run this directly from a Docker container with the local repository directory volume mounted.
First, use the image we built above to pull down all the dependencies and cache them to the project directory system.
docker run -v $PWD:/build -p 8080:8080 live-docs:build npm install
Next, run the embedded grunt web server.
docker run -v $PWD:/build -p 8080:8080 live-docs:build grunt serve
You can now visit the live site at http://localhost:8080/. As long as the container is running, any time you make a change to a file on disk, the page will automatically refresh with the latest changes.
If you are running on Mac or Windows, you need to replace
localhostwith the actual hostname or ip of the VM running Docker.
If you are doing local development, you will need to first build the site as above. Once the site is built, you can use the built in grunt-server with live reload.
./node_modules/gulp/bin/gulp.js serve
You can now visit the live site at http://localhost:8080/. As long as the container is running, any time you make a change to a file on disk, the page will automatically refresh with the latest changes.
Packing the app for distribution will produce a dist folder with the static assets representing this site.
If you prefer distributing the static assets as a Docker container, you can build a small Docker image with the dist folder included using the included Dockerfile. The resulting image is 39MB with a valid, self-signed SSL installed.
Several configuration options are available to customize the auth mechanism and default Swagger definition location at runtime.
| Variable | Description |
|---|---|
| SWAGGER_DOC_URL | The URL to the swagger doc to load at runtime. Defaults to The Agave Platform's Science API Swagger definition. |
| OAUTH_CALLBACK_URL | The url the Live Docs sends to Agave's OAuth server during the implicit flow. This must match the callbackUrl provided when the client key was created. |
| OAUTH_CLIENT_KEY | The client key used in the implicit auth flow. |
| OAUTH_REALM | The realm presented during basic auth. |
| OAUTH_APP_NAME | The name of the app used during basic auth. |
docker run -v $PWD:/build live-docs:build
docker build -t live-docs:latest .
docker run -p 80:80 -p 443:443 \
-e "LOG_TARGET_STDOUT=1" \
-e "OAUTH_CLIENT_KEY=abcdefg" \
-e "OAUTH_CALLBACK_URL=http://docker.example.com/o2c.html
-e "SWAGGER_DOC_URL=http://developer.agaveapi.co/live-docs/agave.json"
--rm \
-h docker.example.com
--name live-docs live-docs:latest
Copy the static assets to any web server and accessed as any other static website. To use the a lightweight node server, run the following command.
Copyright 2011-2015 Reverb technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
docker pull agaveapi/live-docs:latest