Skip to content

Commit

Permalink
Merge pull request #3 from ChefAustin/development
Browse files Browse the repository at this point in the history
v.0.1.2
  • Loading branch information
ChefAustin authored May 10, 2019
2 parents b9b99bb + 371eb41 commit 69e8df6
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 22 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# gem-jar/.gitignore
*.DS_Store
.DS_Store
.DS_Store?
*.DS_Store*
*.pem
.Spotlight-V100
.Trashes
data/*
db/*
dive.log
._*
46 changes: 30 additions & 16 deletions .overcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,41 @@
# For a complete list of options that you can use to customize hooks, see:
# https://github.com/brigade/overcommit#configuration
#
# Uncomment the following lines to make the configuration take effect.
quiet: false

PreCommit:
# RuboCop:
# enabled: true
# on_warn: fail # Treat all warnings as failures
#
# TrailingWhitespace:
# enabled: true
# exclude:
# - '**/db/structure.sql' # Ignore trailing whitespace in generated files
#
Hadolint:
enabled: true
description: 'Analyze with Hadolint'
required_executable: 'hadolint'
include:
- '**/Dockerfile*'
#PostCheckout:
# ALL: # Special hook name that customizes all hooks of this type
# quiet: true # Change all post-checkout hooks to only display output on failure
#
# IndexTags:
# enabled: true # Generate a tags file with `ctags` each time HEAD changes

PostCheckout:
BundleInstall:
enabled: false
description: 'Install Bundler dependencies'
requires_files: true
required_executable: 'bundle'
install_command: 'gem install bundler'
flags: ['install']
include:
- 'Gemfile'
- 'Gemfile.lock'
- '*.gemspec'

CommitMsg:
CapitalizedSubject:
enabled: false

EmptyMessage:
enabled: true
description: 'Check for empty commit message'

RussianNovel:
enabled: false
description: 'Check length of commit message'

SingleLineSubject:
enabled: true
description: 'Check subject line'
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ services:
before_install:
- wget https://github.com/wagoodman/dive/releases/download/v0.7.2/dive_0.7.2_linux_amd64.deb
- sudo apt install ./dive_0.7.2_linux_amd64.deb
- curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64 && chmod +x container-structure-test-linux-amd64 && sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test
- docker build -t chefaustin/gem-jar:latest .
- docker run -d --name gem-jar -p 9292:9292 -v $(pwd)/db:/root/.gemstash chefaustin/gem-jar:latest

-
script:
- dive chefaustin/gem-jar:latest
- container-structure-test test --image chefaustin/gem-jar:latest --config ./container-structure-config.yaml
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
FROM ruby:2.6.2
LABEL maintainer="[email protected]"
LABEL version="0.1.1"
LABEL version="0.1.2"

COPY Gemfile* config.yml docker_health.rb /
RUN bundle install --gemfile /Gemfile

EXPOSE 9292
CMD ["bundle", "exec", "gemstash", "start", "--no-daemonize", "--config-file", "/config.yml"]

HEALTHCHECK CMD ruby docker_health.rb
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ source 'https://rubygems.org'
gem 'gemstash', '2.0.0'

group :development do
gem 'yaml-lint'
gem 'rubocop'
gem 'rubocop-performance'
gem 'serverspec'
gem 'yaml-lint'
end
37 changes: 37 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ GEM
ast (2.4.0)
concurrent-ruby (1.1.5)
dalli (2.7.10)
diff-lcs (1.3)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.13.1)
Expand All @@ -30,8 +31,13 @@ GEM
jaro_winkler (1.5.2)
lru_redux (1.1.0)
minitest (5.11.3)
multi_json (1.13.1)
multipart-post (2.0.0)
mustermann (1.0.3)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-ssh (5.2.0)
net-telnet (0.1.1)
parallel (1.17.0)
parser (2.6.3.0)
ast (~> 2.4.0)
Expand All @@ -41,6 +47,22 @@ GEM
rack-protection (2.0.5)
rack
rainbow (3.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.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.67.2)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
Expand All @@ -49,16 +71,29 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.6)
rubocop-performance (1.1.0)
rubocop (>= 0.67.0)
ruby-progressbar (1.10.0)
sequel (5.19.0)
server_health_check (1.0.2)
server_health_check-rack (0.1.0)
server_health_check (~> 1.0, >= 1.0.1)
serverspec (2.41.3)
multi_json
rspec (~> 3.0)
rspec-its
specinfra (~> 2.72)
sfl (2.3)
sinatra (2.0.5)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.5)
tilt (~> 2.0)
specinfra (2.77.1)
net-scp
net-ssh (>= 2.7)
net-telnet (= 0.1.1)
sfl
sqlite3 (1.4.0)
thor (0.20.3)
thread_safe (0.3.6)
Expand All @@ -74,6 +109,8 @@ PLATFORMS
DEPENDENCIES
gemstash (= 2.0.0)
rubocop
rubocop-performance
serverspec
yaml-lint

BUNDLED WITH
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ No nonsense Gemstash instance thrown in a container, backed by sqlite3 and wrapp
## Getting started
1. `git clone https://github.com/chefaustin/gem-jar.git` <= Clone this repo
2. `cd gem-jar` <= Navigate into it
3. `docker run --name gem-jar -p 9292:9292 -v $(pwd)/db:/root/.gemstash chefaustin/gem-jar:latest` <= Bring container up
3. `docker run -d --name gem-jar -p 9292:9292 -v ../db:/root/.gemstash chefaustin/gem-jar:latest` <= Bring container up
4. `resp_key=$(docker exec -it gem-jar gemstash authorize | cut -d ' ' -f 5)` <= Generate and grab a new API key
5. `mkdir -p ~/.gem; touch ~/.gem/credentials; echo ":gemstash: $resp_key"; chmod 0600 ~/.gem/credentials` <= Create and append key to `~/.gem/credentials`

## Improvements to come:
- Tests:
- [Container Structure](https://github.com/GoogleContainerTools/container-structure-test)
- [Serverspec](https://github.com/mizzy/serverspec)
- [Dockerspec](https://github.com/zuazo/dockerspec)
- Fine-tune Docker `HEALTHCHECK`
- Other:
- ~~Figure out proper FOSS `LICENSE`~~
- Build out wiki
- Functionality:
- Move to docker-compose with containerized ingress
- SSL/TLS termination (LetsEncrypt?)
11 changes: 11 additions & 0 deletions container-structure-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
schemaVersion: '2.0.0' # Make sure to test the latest schema version

fileExistenceTests:
- name: 'existence-Gemfile'
path: '/Gemfile'
shouldExist: true
- name: 'existence-config.yml'
path: '/config.yml'
shouldExist: true
- name: 'existence-docker_health.rb'
path: '/docker_health.rb'

0 comments on commit 69e8df6

Please sign in to comment.