Skip to content

Commit

Permalink
Initial commit for public repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
veb3 committed Oct 2, 2019
0 parents commit 09c07a5
Show file tree
Hide file tree
Showing 47 changed files with 3,380 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config/config.yml
config/config.txt
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform.tfvars
config.yml
config.txt
/vendor/bundle
.idea/
coverage/
rspec.xml
.ruby-gemset
4 changes: 4 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--color
--format progress
--format RspecJunitFormatter
--out rspec.xml
23 changes: 23 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
LineLength:
Max: 130
Enabled: true
MethodLength:
Max: 30
BlockLength:
Enabled: false
ClassLength:
Enabled: false
ClassVars:
Enabled: false
EmptyLinesAroundClassBody:
Enabled: false
EmptyLinesAroundBlockBody:
Enabled: false
EmptyLinesAroundModuleBody:
Enabled: false
Metrics/AbcSize:
Max: 23
Style/FrozenStringLiteralComment:
Enabled: false
Style/NumericLiterals:
Enabled: false
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.6.3
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# DNSApi Changelog

# 0.1.0
* implement read actions

# 0.2.0
* Implement record creation actions
* Cleanup schema validation logic

# 0.3.0
* Implement record deletion

# 0.4.0
* Implement IP assignment/deletion
* Add get/delete elements by [proteus] :id

# 0.4.1
* Dockerfile updates

# 0.4.2
* Move import config script to $APPDIR

# 0.4.3
* limit canary ip testing to 10 tries (so we don't hammer proteus)

# 0.4.4
* Add support for user-defined properties when assigning an IP

# 0.5.0
* Changed to Puma

# 0.5.1
* Return JSON object representation of the Proteus ApiEntity instead of strings
29 changes: 29 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
source 'https://rubygems.org'

gem 'json'
gem 'json-schema'
gem 'logger'
gem 'netaddr', '~> 1.5', '>= 1.5.1'
gem 'proteus', git: 'https://github.com/YaleUniversity/proteus_client.git'
gem 'rake'
gem 'require_all'
gem 'sinatra'
gem 'sinatra-contrib', require: 'sinatra/contrib/all'
gem 'sinatra-cross_origin', require: 'sinatra/cross_origin'

group :development do
gem 'rubocop'
gem 'shotgun'
end

group :test do
gem 'rack-test', require: 'rack/test'
gem 'rspec'
gem 'rspec_junit_formatter'
gem 'simplecov'
gem 'simplecov-rcov'
end

group :production do
gem 'puma'
end
143 changes: 143 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
GIT
remote: https://github.com/YaleUniversity/proteus_client.git
revision: 6d769e702335da960e65ffa8cdc3f2e60c845981
specs:
proteus (0.5.0)
awesome_print (~> 0)
cri (~> 2.7, >= 2.7.1)
mini_portile2 (~> 2.0)
netaddr (~> 1.5, >= 1.5.1)
savon (~> 2.0)

GEM
remote: https://rubygems.org/
specs:
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
akami (1.3.1)
gyoku (>= 0.4.0)
nokogiri
ast (2.4.0)
awesome_print (0.4.0)
backports (3.15.0)
builder (3.2.3)
cri (2.15.9)
diff-lcs (1.3)
docile (1.3.2)
gyoku (1.3.1)
builder (>= 2.1.2)
httpi (2.4.4)
rack
socksify
jaro_winkler (1.5.3)
json (2.2.0)
json-schema (2.8.1)
addressable (>= 2.4)
logger (1.3.0)
mini_portile2 (2.4.0)
multi_json (1.13.1)
mustermann (1.0.3)
netaddr (1.5.1)
nio4r (2.4.0)
nokogiri (1.10.3)
mini_portile2 (~> 2.4.0)
nori (2.6.0)
parallel (1.17.0)
parser (2.6.3.0)
ast (~> 2.4.0)
public_suffix (3.1.1)
puma (4.0.1)
nio4r (~> 2.0)
rack (2.0.7)
rack-protection (2.0.5)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rainbow (3.0.0)
rake (12.3.3)
require_all (2.0.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.2)
rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (0.73.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.1)
savon (2.12.0)
akami (~> 1.2)
builder (>= 2.1.2)
gyoku (~> 1.2)
httpi (~> 2.3)
nokogiri (>= 1.8.1)
nori (~> 2.4)
wasabi (~> 3.4)
shotgun (0.9.2)
rack (>= 1.0)
simplecov (0.17.0)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
simplecov-rcov (0.2.3)
simplecov (>= 0.4.1)
sinatra (2.0.5)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.5)
tilt (~> 2.0)
sinatra-contrib (2.0.5)
backports (>= 2.8.2)
multi_json
mustermann (~> 1.0)
rack-protection (= 2.0.5)
sinatra (= 2.0.5)
tilt (>= 1.3, < 3)
sinatra-cross_origin (0.4.0)
socksify (1.7.1)
tilt (2.0.9)
unicode-display_width (1.6.0)
wasabi (3.5.0)
httpi (~> 2.0)
nokogiri (>= 1.4.2)

PLATFORMS
ruby

DEPENDENCIES
json
json-schema
logger
netaddr (~> 1.5, >= 1.5.1)
proteus!
puma
rack-test
rake
require_all
rspec
rspec_junit_formatter
rubocop
shotgun
simplecov
simplecov-rcov
sinatra
sinatra-contrib
sinatra-cross_origin

BUNDLED WITH
1.17.2
26 changes: 26 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pipeline {
agent none
stages {
stage('Lint') {
agent { dockerfile true }
steps {
sh 'bundle exec rubocop'
}
}
stage('Test'){
agent { dockerfile true }
steps {
sh 'bundle exec rspec spec/**/*_spec.rb'
}
}
stage('Docker Build') {
agent any
/*when { branch 'master' }*/
steps {
echo 'I would do a docker build.'
sh 'docker build -f docker/Dockerfile -t dtr-tst.internal.yale.edu:latest .'
sh 'docker push dtr-tst.internal.yale.edu:latest'
}
}
}
}
Loading

0 comments on commit 09c07a5

Please sign in to comment.