Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Commit

Permalink
auth routes update wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kgilpin committed Dec 17, 2015
1 parent b3275f0 commit b7934cc
Show file tree
Hide file tree
Showing 18 changed files with 385 additions and 206 deletions.
18 changes: 18 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>apidocs</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.aptana.ide.core.unifiedBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.aptana.ruby.core.rubynature</nature>
<nature>com.aptana.projects.webnature</nature>
</natures>
</projectDescription>
5 changes: 5 additions & 0 deletions Dockerfile.cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM ruby:2.0

RUN gem install -N conjur-cli

ADD test/conjur.conf /etc/conjur.conf
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

gem 'apiaryio'

#ruby-gemset=apidocs
32 changes: 32 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
GEM
remote: https://rubygems.org/
specs:
apiaryio (0.3.3)
json (~> 1.8)
rack (~> 1.6.4)
rake (~> 10.4)
rest-client (~> 1.8)
thor (~> 0.19.1)
domain_name (0.5.25)
unf (>= 0.0.5, < 1.0.0)
http-cookie (1.0.2)
domain_name (~> 0.5)
json (1.8.3)
mime-types (2.99)
netrc (0.11.0)
rack (1.6.4)
rake (10.4.2)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
thor (0.19.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.1)

PLATFORMS
ruby

DEPENDENCIES
apiaryio
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.PHONY: nodejs-image cli-image

default: api.md

test: nodejs-image api.md
echo "Running tests against container '$(CONJUR_CONTAINER)'"
summon docker run \
--rm \
--link $(CONJUR_CONTAINER):conjur \
-v $(PWD):/app \
-e "NODE_TLS_REJECT_UNAUTHORIZED=0" \
--env-file @SUMMONENVFILE \
apidocs \
dredd \
./api.md \
conjur \
--reporter junit \
--output report.xml \
--reporter html \
--output report.html \
--reporter apiary \
--hookfiles hooks.js \
--language nodejs

preview: api.md
rvm use --create 2.0.0@apidocs
bundle
apiary preview --server --port=8081 --path api.md

api.md: nodejs-image src/* src/partials/*
docker run \
--rm \
-v $(PWD):/app \
apidocs \
hercule src/api.md -o api.md

nodejs-image:
docker build -t apidocs .

cli-image:
docker build -t apidocs-conjur-cli -f Dockerfile.cli .
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,34 @@ The API page on the devsite has an embedded iframe referencing https://jsapi.api

**Don't edit `./api.md` directly!**

Edit the files in `src/` and then run
Edit the files in `src/`. You can then compile the source files into `./api.md` run a local server that renders the CLI:

```
hercule src/api.md -o api.md
```

to compile them into `./api.md`.

You can then use the Apiary CLI to run a local server that renders the CLI:

```
gem install apiaryio
apiary preview --server --port=8081 --path api.md
$ make preview
```

## Testing

Tests are run with [dredd](http://dredd.readthedocs.org/en/latest/) in a Docker container against a Conjur appliance
also running in Docker.

Run them with:
Locally, first run the Jenkins script in NOKILL mode:

```
./jenkins.sh
$ NOKILL=1 ./jenkins.sh
...
Container id:
a147265fc9d99701f0d3836313f2c607c287a5768ed42c77fd144669dc35bb09
```

For local development, pass the NOKILL flag.
Then you can run the tests without launching a new appliance each time.
Then export the container id:

```
NOKILL=1 ./jenkins.sh
./dredd.sh https://$(docker-machine ip default):61000
```
$ export CONJUR_CONTAINER= a147265fc9d99701f0d3836313f2c607c287a5768ed42c77fd144669dc35bb09
```

Then you can re-run the tests without re-launching Conjur:

```
$ make test
```
Loading

0 comments on commit b7934cc

Please sign in to comment.