From 17d0db6c29430da10f0266532eb433d3a9bd2265 Mon Sep 17 00:00:00 2001 From: Austin Culter Date: Fri, 26 Apr 2019 17:04:16 -0600 Subject: [PATCH 1/7] Initialize repo. --- .gitignore | 0 Dockerfile | 0 README.md | 2 ++ 3 files changed, 2 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 37b0d51..1ec76f4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # gem-jar Gemstash service thrown in a container and wrapped-up with a bow. + +TODO From fe8dc61aae1e5e85cb84626933cf5706844fd984 Mon Sep 17 00:00:00 2001 From: Austin Culter Date: Fri, 26 Apr 2019 17:07:20 -0600 Subject: [PATCH 2/7] Init overcommit --- .overcommit.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .overcommit.yml diff --git a/.overcommit.yml b/.overcommit.yml new file mode 100644 index 0000000..3037a42 --- /dev/null +++ b/.overcommit.yml @@ -0,0 +1,33 @@ +# Use this file to configure the Overcommit hooks you wish to use. This will +# extend the default configuration defined in: +# https://github.com/brigade/overcommit/blob/master/config/default.yml +# +# At the topmost level of this YAML file is a key representing type of hook +# being run (e.g. pre-commit, commit-msg, etc.). Within each type you can +# customize each hook, such as whether to only run it on certain files (via +# `include`), whether to only display output if it fails (via `quiet`), etc. +# +# For a complete list of hooks, see: +# https://github.com/brigade/overcommit/tree/master/lib/overcommit/hook +# +# 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. + +#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 +# +#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 From b65fcece51f4aaf22ca7db926c4ffc419553e92d Mon Sep 17 00:00:00 2001 From: Austin Culter Date: Fri, 26 Apr 2019 17:09:14 -0600 Subject: [PATCH 3/7] Init Gemfile +deps --- Gemfile | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Gemfile diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..2090dba --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +gem 'gemstash', '2.0.0' +gem 'pg' From 09e2806fa8ec49f25575de3eb3180f5f42113a93 Mon Sep 17 00:00:00 2001 From: Austin Culter Date: Fri, 26 Apr 2019 20:10:54 -0600 Subject: [PATCH 4/7] Working with sqlite adapter --- .gitignore | 3 +++ Dockerfile | 13 +++++++++++++ Gemfile | 1 - config.yml | 11 +++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 config.yml diff --git a/.gitignore b/.gitignore index e69de29..c2f2420 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,3 @@ +# gem-jar/.gitignore +*.DS_Store +/db/ diff --git a/Dockerfile b/Dockerfile index e69de29..02d898b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM ruby:2.6.2 +LABEL maintainer="austinculter@gmail.com" + +RUN mkdir -p /root/.gemstash + +WORKDIR /root/.gemstash +COPY Gemfile /root/.gemstash +RUN bundle install --gemfile /root/.gemstash/Gemfile + +COPY config.yml /root/.gemstash + +EXPOSE 9292 +CMD ["bundle", "exec", "gemstash", "start", "--no-daemonize"] diff --git a/Gemfile b/Gemfile index 2090dba..dece2d4 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,3 @@ source 'https://rubygems.org' gem 'gemstash', '2.0.0' -gem 'pg' diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..34c2b7d --- /dev/null +++ b/config.yml @@ -0,0 +1,11 @@ +# /root/.gemstash/config.yml +--- +:base_path: "/root/.gemstash" +:cache_type: memory +:db_adapter: sqlite3 +:rubygems_url: https://rubygems.org +:puma_threads: 16 +:bind: tcp://0.0.0.0:9292 +:protected_fetch: false +:fetch_timeout: 20 +:log_file: gemstash_server.log From 086d91d49f3166ded9d372d5615460742b058071 Mon Sep 17 00:00:00 2001 From: Austin Culter Date: Fri, 26 Apr 2019 22:36:08 -0600 Subject: [PATCH 5/7] Simply Dockerfile; add more to .gitignore --- .gitignore | 2 +- Dockerfile | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index c2f2420..f6cf769 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ # gem-jar/.gitignore *.DS_Store -/db/ +/db/* diff --git a/Dockerfile b/Dockerfile index 02d898b..4d394e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,10 @@ FROM ruby:2.6.2 LABEL maintainer="austinculter@gmail.com" -RUN mkdir -p /root/.gemstash +COPY Gemfile / +RUN bundle install --gemfile /Gemfile -WORKDIR /root/.gemstash -COPY Gemfile /root/.gemstash -RUN bundle install --gemfile /root/.gemstash/Gemfile - -COPY config.yml /root/.gemstash +COPY config.yml / EXPOSE 9292 -CMD ["bundle", "exec", "gemstash", "start", "--no-daemonize"] +CMD ["bundle", "exec", "gemstash", "start", "--no-daemonize", "--config-file", "/config.yml"] From 397b87ae5fc56c82e9db0072c05fc953cf1e60cd Mon Sep 17 00:00:00 2001 From: Austin Culter Date: Fri, 26 Apr 2019 22:39:11 -0600 Subject: [PATCH 6/7] Add dive.log to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f6cf769..ffd1636 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ # gem-jar/.gitignore *.DS_Store /db/* +dive.log From 0e56d078f4d19ace93a3a8da13307600fdcf0b45 Mon Sep 17 00:00:00 2001 From: Austin Culter Date: Fri, 26 Apr 2019 22:43:06 -0600 Subject: [PATCH 7/7] Basic usage readme --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1ec76f4..4870f36 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # gem-jar -Gemstash service thrown in a container and wrapped-up with a bow. +No nonsense Gemstash instance thrown in a container, backed by sqlite3 and wrapped-up with a bow. Non-configurable by design; for those that just want a no frills, quickly deployable Gem caching service. -TODO +## 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