gemstash 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gemstash/cache.rb +1 -1
- data/lib/gemstash/man/gemstash-authorize.1 +66 -0
- data/lib/gemstash/man/gemstash-authorize.1.txt +47 -0
- data/lib/gemstash/man/gemstash-configuration.5 +241 -0
- data/lib/gemstash/man/gemstash-configuration.5.txt +211 -0
- data/lib/gemstash/man/gemstash-customize.7 +316 -0
- data/lib/gemstash/man/gemstash-customize.7.txt +187 -0
- data/lib/gemstash/man/gemstash-debugging.7 +49 -0
- data/lib/gemstash/man/gemstash-debugging.7.txt +30 -0
- data/lib/gemstash/man/gemstash-deploy.7 +87 -0
- data/lib/gemstash/man/gemstash-deploy.7.txt +60 -0
- data/lib/gemstash/man/gemstash-mirror.7 +55 -0
- data/lib/gemstash/man/gemstash-mirror.7.txt +34 -0
- data/lib/gemstash/man/gemstash-multiple-sources.7 +103 -0
- data/lib/gemstash/man/gemstash-multiple-sources.7.txt +71 -0
- data/lib/gemstash/man/gemstash-private-gems.7 +242 -0
- data/lib/gemstash/man/gemstash-private-gems.7.txt +157 -0
- data/lib/gemstash/man/gemstash-readme.7 +245 -0
- data/lib/gemstash/man/gemstash-readme.7.txt +181 -0
- data/lib/gemstash/man/gemstash-setup.1 +58 -0
- data/lib/gemstash/man/gemstash-setup.1.txt +41 -0
- data/lib/gemstash/man/gemstash-start.1 +41 -0
- data/lib/gemstash/man/gemstash-start.1.txt +27 -0
- data/lib/gemstash/man/gemstash-status.1 +35 -0
- data/lib/gemstash/man/gemstash-status.1.txt +23 -0
- data/lib/gemstash/man/gemstash-stop.1 +35 -0
- data/lib/gemstash/man/gemstash-stop.1.txt +23 -0
- data/lib/gemstash/man/gemstash-version.1 +37 -0
- data/lib/gemstash/man/gemstash-version.1.txt +22 -0
- data/lib/gemstash/version.rb +1 -1
- metadata +17 -3
@@ -1 +1,158 @@
|
|
1
|
+
gemstash-private-gems(7) gemstash-private-gems(7)
|
1
2
|
|
3
|
+
|
4
|
+
|
5
|
+
<!-- Automatically generated by Pandoc -->
|
6
|
+
|
7
|
+
1mPrivate Gems0m
|
8
|
+
Stashing private gems in your Gemstash server requires a bit of addi-
|
9
|
+
tional setup. If you haven't read through the Quickstart Guide, you
|
10
|
+
should do that first. By the end of this guide, you will be able to
|
11
|
+
interact with your Gemstash server to store and retrieve your private
|
12
|
+
gems.
|
13
|
+
|
14
|
+
1mAuthorizing0m
|
15
|
+
1mIMPORTANT NOTE: 22mDo not use the actual key value in this document, oth-
|
16
|
+
erwise your Gemstash server will be vulnerable to anyone who wants to
|
17
|
+
try to use the key against your server. Instead of the key value here,
|
18
|
+
use whatever key is generated from running the commands.
|
19
|
+
|
20
|
+
In order to push a gem to your Gemstash server, you need to first cre-
|
21
|
+
ate an API key. Utilize the 1mgemstash authorize 22mcommand to create the
|
22
|
+
API key:
|
23
|
+
|
24
|
+
$ gemstash authorize
|
25
|
+
Your new key is: e374e237fdf5fa5718d2a21bd63dc911
|
26
|
+
|
27
|
+
This new key can 1mpush22m, 1myank22m, and 1mfetch 22mgems from your Gemstash server.
|
28
|
+
Run 1mgemstash authorize 22mwith just the permissions you want to limit what
|
29
|
+
the key will be allowed to do. You can similarly update a specific key
|
30
|
+
by providing it via the 1m--key 22moption:
|
31
|
+
|
32
|
+
$ gemstash authorize push yank --key e374e237fdf5fa5718d2a21bd63dc911
|
33
|
+
|
34
|
+
When no permissions are provided (like the first example), the key will
|
35
|
+
be authorized for all permissions. Leave the key authorized with ev-
|
36
|
+
erything if you want to use it to try all private gem interactions:
|
37
|
+
|
38
|
+
$ gemstash authorize --key e374e237fdf5fa5718d2a21bd63dc911
|
39
|
+
|
40
|
+
With the key generated, you'll need to tell Rubygems about your new
|
41
|
+
key. If you've pushed a gem to https://rubygems.org, then you will al-
|
42
|
+
ready have a credentials file to add the key to. If not, run the fol-
|
43
|
+
lowing commands before modifying the credentials file:
|
44
|
+
|
45
|
+
$ mkdir -p ~/.gem
|
46
|
+
$ touch ~/.gem/credentials
|
47
|
+
$ chmod 0600 ~/.gem/credentials
|
48
|
+
|
49
|
+
Add your new key to credentials such that it looks something like this
|
50
|
+
(but make sure not to remove any existing keys):
|
51
|
+
|
52
|
+
# ~/.gem/credentials
|
53
|
+
---
|
54
|
+
:test_key: e374e237fdf5fa5718d2a21bd63dc911
|
55
|
+
|
56
|
+
The name 1mtest_key 22mcan be anything you want, but you will need to remem-
|
57
|
+
ber it and use it again later in this guide for the 1m--key 22moption.
|
58
|
+
|
59
|
+
1mCreating a Test Gem0m
|
60
|
+
You'll need a test gem before you can play with private gems on your
|
61
|
+
Gemstash server. If you have a gem you can use, move along to the next
|
62
|
+
section. You can start by instantiating a test gem via Bundler:
|
63
|
+
|
64
|
+
$ bundle gem private-example
|
65
|
+
|
66
|
+
You'll need to add a summary and description to the new gem's gemspec
|
67
|
+
file in order to successfully build it. Once you've built the gem, you
|
68
|
+
will be ready to push the new gem.
|
69
|
+
|
70
|
+
$ cd private-example
|
71
|
+
$ rake build
|
72
|
+
|
73
|
+
You will now have a gem at 1mprivate-example/pkg/private-exam-0m
|
74
|
+
1mple-0.1.0.gem22m.
|
75
|
+
|
76
|
+
1mPushing0m
|
77
|
+
If your Gemstash server isn't running, go ahead and start it:
|
78
|
+
|
79
|
+
$ gemstash start
|
80
|
+
|
81
|
+
Push your test gem using Rubygems:
|
82
|
+
|
83
|
+
$ gem push --key test_key --host http://localhost:9292/private pkg/private-example-0.1.0.gem
|
84
|
+
|
85
|
+
The 1m/private 22mportion of the 1m--host 22moption tells Gemstash you are inter-
|
86
|
+
acting with the private gems. Gemstash will not let you push, or yank
|
87
|
+
from anything except 1m/private22m.
|
88
|
+
|
89
|
+
1mBundling0m
|
90
|
+
Once your gem is pushed to your Gemstash server, you are ready to bun-
|
91
|
+
dle it. Create a 1mGemfile 22mand specify the gem. You will probably want
|
92
|
+
to wrap the private gem in a source block, and let the rest of Gemstash
|
93
|
+
handle all other gems:
|
94
|
+
|
95
|
+
# ./Gemfile
|
96
|
+
source "http://localhost:9292"
|
97
|
+
gem "rubywarrior"
|
98
|
+
|
99
|
+
source "http://localhost:9292/private" do
|
100
|
+
gem "private-example"
|
101
|
+
end
|
102
|
+
|
103
|
+
Notice that the Gemstash server points to 1m/private 22magain when in-
|
104
|
+
stalling your private gem. Go ahead and bundle to install your new
|
105
|
+
private gem:
|
106
|
+
|
107
|
+
$ bundle
|
108
|
+
|
109
|
+
1mYanking0m
|
110
|
+
If you push a private gem by accident, you can yank the gem with
|
111
|
+
Rubygems:
|
112
|
+
|
113
|
+
$ RUBYGEMS_HOST=http://localhost:9292/private gem yank --key test_key private-example --version 0.1.0
|
114
|
+
|
115
|
+
Like with pushing, the 1m/private 22mportion of the host option tells Gem-
|
116
|
+
stash you are interacting with private gems. Gemstash will only let
|
117
|
+
you yank from 1m/private22m. Unlike pushing, Rubygems doesn't support
|
118
|
+
1m--host 22mfor yank (yet), so you need to specify the host via the
|
119
|
+
1mRUBYGEMS_HOST 22menvironment variable.
|
120
|
+
|
121
|
+
1mProtected Fetching0m
|
122
|
+
By default, private gems and specs can be accessed without authentica-
|
123
|
+
tion.
|
124
|
+
|
125
|
+
Private gems often require protected fetching. For backwards compati-
|
126
|
+
bility this is disabled by default, but can be enabled via 1m$ gemstash0m
|
127
|
+
1msetup 22mcommand.
|
128
|
+
|
129
|
+
When protected fetching is enabled API keys with the permissions 1mall 22mor
|
130
|
+
1mfetch 22mcan be used to download gems and specs.
|
131
|
+
|
132
|
+
On the Bundler side, there are a few ways to configure credentials for
|
133
|
+
a given gem source:
|
134
|
+
|
135
|
+
Add credentials globally:
|
136
|
+
|
137
|
+
$ bundle config my-gemstash.dev api_key
|
138
|
+
|
139
|
+
Add credentials in Gemfile:
|
140
|
+
|
141
|
+
source "https://api_key@my-gemstash.dev"
|
142
|
+
|
143
|
+
However, it's not a good practice to commit credentials to source con-
|
144
|
+
trol. A recommended solution is to use Bundler's configuration keys
|
145
|
+
(http://bundler.io/man/bundle-config.1.html#CONFIGURATION-KEYS), e.g.:
|
146
|
+
|
147
|
+
$ export BUNDLE_MYGEMSTASH__DEV=api_key
|
148
|
+
|
149
|
+
Behind the scene, Bundler will pick up the ENV var according to the
|
150
|
+
host name (e.g. mygemstash.dev) and add to 1mURI.userinfo 22mfor making re-
|
151
|
+
quests.
|
152
|
+
|
153
|
+
The API key is treated as a HTTP Basic Auth username and any HTTP Basic
|
154
|
+
password supplied will be ignored.
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
October 8, 2015 gemstash-private-gems(7)
|
@@ -0,0 +1,245 @@
|
|
1
|
+
<!-- Automatically generated by Pandoc -->
|
2
|
+
.\" Automatically generated by Pandoc 3.0.1
|
3
|
+
.\"
|
4
|
+
.\" Define V font for inline verbatim, using C font in formats
|
5
|
+
.\" that render this, and otherwise B font.
|
6
|
+
.ie "\f[CB]x\f[]"x" \{\
|
7
|
+
. ftr V B
|
8
|
+
. ftr VI BI
|
9
|
+
. ftr VB B
|
10
|
+
. ftr VBI BI
|
11
|
+
.\}
|
12
|
+
.el \{\
|
13
|
+
. ftr V CR
|
14
|
+
. ftr VI CI
|
15
|
+
. ftr VB CB
|
16
|
+
. ftr VBI CBI
|
17
|
+
.\}
|
18
|
+
.TH "gemstash-readme" "7" "November 30, 2015" "" ""
|
19
|
+
.hy
|
20
|
+
.SH Gemstash
|
21
|
+
.SS What is Gemstash?
|
22
|
+
.PP
|
23
|
+
Gemstash is both a cache for remote servers such as
|
24
|
+
https://rubygems.org, and a private gem source.
|
25
|
+
.PP
|
26
|
+
If you are using bundler (http://bundler.io/) across many machines that
|
27
|
+
have access to a server within your control, you might want to use
|
28
|
+
Gemstash.
|
29
|
+
.PP
|
30
|
+
If you produce gems that you don\[cq]t want everyone in the world to
|
31
|
+
have access to, you might want to use Gemstash.
|
32
|
+
.PP
|
33
|
+
If you frequently bundle the same set of gems across multiple projects,
|
34
|
+
you might want to use Gemstash.
|
35
|
+
.PP
|
36
|
+
Are you only using gems from https://rubygems.org, and don\[cq]t bundle
|
37
|
+
the same gems frequently?
|
38
|
+
Well, maybe you don\[cq]t need Gemstash\&...
|
39
|
+
yet.
|
40
|
+
.PP
|
41
|
+
Gemstash is maintained by Ruby Together (https://rubytogether.org/), a
|
42
|
+
grassroots initiative committed to supporting the critical Ruby
|
43
|
+
infrastructure you rely on.
|
44
|
+
Contribute today as an individual (https://rubytogether.org/developers)
|
45
|
+
or even better, as a company (https://rubytogether.org/companies), and
|
46
|
+
ensure that Bundler, RubyGems, Gemstash, and other shared tooling is
|
47
|
+
around for years to come.
|
48
|
+
.SS Quickstart Guide
|
49
|
+
.SS Setup
|
50
|
+
.PP
|
51
|
+
Gemstash is designed to be quick and painless to get set up.
|
52
|
+
By the end of this Quickstart Guide, you will be able to bundle stashed
|
53
|
+
gems from public sources against a Gemstash server running on your
|
54
|
+
machine.
|
55
|
+
.PP
|
56
|
+
Install Gemstash to get started:
|
57
|
+
.IP
|
58
|
+
.nf
|
59
|
+
\f[C]
|
60
|
+
$ gem install gemstash
|
61
|
+
\f[R]
|
62
|
+
.fi
|
63
|
+
.PP
|
64
|
+
After it is installed, starting Gemstash requires no additional steps.
|
65
|
+
Simply start the Gemstash server with the \f[V]gemstash\f[R] command:
|
66
|
+
.IP
|
67
|
+
.nf
|
68
|
+
\f[C]
|
69
|
+
$ gemstash start
|
70
|
+
\f[R]
|
71
|
+
.fi
|
72
|
+
.PP
|
73
|
+
You may have noticed that the command finished quickly.
|
74
|
+
This is because Gemstash will run the server in the background by
|
75
|
+
default.
|
76
|
+
The server runs on port 9292.
|
77
|
+
.SS Bundling
|
78
|
+
.PP
|
79
|
+
With the server running, you can bundle against it.
|
80
|
+
Tell Bundler that you want to use Gemstash to find gems from
|
81
|
+
RubyGems.org:
|
82
|
+
.IP
|
83
|
+
.nf
|
84
|
+
\f[C]
|
85
|
+
$ bundle config mirror.https://rubygems.org http://localhost:9292
|
86
|
+
\f[R]
|
87
|
+
.fi
|
88
|
+
.PP
|
89
|
+
Now you can create a Gemfile and install gems through Gemstash:
|
90
|
+
.IP
|
91
|
+
.nf
|
92
|
+
\f[C]
|
93
|
+
# ./Gemfile
|
94
|
+
source \[dq]https://rubygems.org\[dq]
|
95
|
+
gem \[dq]rubywarrior\[dq]
|
96
|
+
\f[R]
|
97
|
+
.fi
|
98
|
+
.PP
|
99
|
+
The gems you include should be gems you don\[cq]t yet have installed,
|
100
|
+
otherwise Gemstash will have nothing to stash.
|
101
|
+
Now bundle:
|
102
|
+
.IP
|
103
|
+
.nf
|
104
|
+
\f[C]
|
105
|
+
$ bundle install --path .bundle
|
106
|
+
\f[R]
|
107
|
+
.fi
|
108
|
+
.PP
|
109
|
+
Your Gemstash server has fetched the gems from https://rubygems.org and
|
110
|
+
cached them for you!
|
111
|
+
To prove this, you can disable your Internet connection and try again.
|
112
|
+
Gem files (*.gem) are cached indefinitely.
|
113
|
+
Gem dependencies metadata are cached for 30 minutes, so if you bundle
|
114
|
+
again before that, you can successfully bundle without an Internet
|
115
|
+
connection:
|
116
|
+
.IP
|
117
|
+
.nf
|
118
|
+
\f[C]
|
119
|
+
$ # Disable your Internet first!
|
120
|
+
$ rm -rf Gemfile.lock .bundle
|
121
|
+
$ bundle
|
122
|
+
\f[R]
|
123
|
+
.fi
|
124
|
+
.SS Falling back to rubygems.org
|
125
|
+
.PP
|
126
|
+
If you want to make sure that your bundling from https://rubygems.org
|
127
|
+
still works as expected when the Gemstash server is not running, you can
|
128
|
+
easily configure Bundler to fallback to https://rubygems.org.
|
129
|
+
.IP
|
130
|
+
.nf
|
131
|
+
\f[C]
|
132
|
+
$ bundle config mirror.https://rubygems.org.fallback_timeout true
|
133
|
+
\f[R]
|
134
|
+
.fi
|
135
|
+
.PP
|
136
|
+
You can also configure this fallback as a number of seconds in case the
|
137
|
+
Gemstash server is simply unresponsive.
|
138
|
+
This example uses a 3 second timeout:
|
139
|
+
.IP
|
140
|
+
.nf
|
141
|
+
\f[C]
|
142
|
+
$ bundle config mirror.https://rubygems.org.fallback_timeout 3
|
143
|
+
\f[R]
|
144
|
+
.fi
|
145
|
+
.SS Stopping the Server
|
146
|
+
.PP
|
147
|
+
Once you\[cq]ve finish using your Gemstash server, you can stop it just
|
148
|
+
as easily as you started it:
|
149
|
+
.IP
|
150
|
+
.nf
|
151
|
+
\f[C]
|
152
|
+
$ gemstash stop
|
153
|
+
\f[R]
|
154
|
+
.fi
|
155
|
+
.PP
|
156
|
+
You\[cq]ll also want to tell Bundler that it can go back to getting gems
|
157
|
+
from RubyGems.org directly, instead of going through Gemstash:
|
158
|
+
.IP
|
159
|
+
.nf
|
160
|
+
\f[C]
|
161
|
+
$ bundle config --delete mirror.https://rubygems.org
|
162
|
+
\f[R]
|
163
|
+
.fi
|
164
|
+
.SS Under the Hood
|
165
|
+
.PP
|
166
|
+
You might wonder where the gems are stored.
|
167
|
+
After running the commands above, you will find a new directory at
|
168
|
+
\f[V]\[ti]/.gemstash\f[R].
|
169
|
+
This directory holds all the cached and private gems.
|
170
|
+
It also has a server log, the database, and configuration for Gemstash.
|
171
|
+
If you prefer, you can point to a different directory.
|
172
|
+
.PP
|
173
|
+
Gemstash uses SQLite (https://www.sqlite.org/) to store details about
|
174
|
+
private gems.
|
175
|
+
The database will be located in \f[V]\[ti]/.gemstash\f[R], however you
|
176
|
+
won\[cq]t see the database appear until you start using private gems.
|
177
|
+
If you prefer, you can use a different database.
|
178
|
+
.PP
|
179
|
+
Gemstash temporarily caches things like gem dependencies in memory.
|
180
|
+
Anything cached in memory will last for 30 minutes before being
|
181
|
+
retrieved again.
|
182
|
+
You can use memcached instead of caching in memory.
|
183
|
+
Gem files are always cached permanently, so bundling with a
|
184
|
+
\f[V]Gemfile.lock\f[R] with all gems cached will never call out to
|
185
|
+
https://rubygems.org.
|
186
|
+
.PP
|
187
|
+
The server you ran is provided via Puma (http://puma.io/) and
|
188
|
+
Rack (http://rack.github.io/), however they are not customizable at this
|
189
|
+
point.
|
190
|
+
.SS Deep Dive
|
191
|
+
.PP
|
192
|
+
Deep dive into more subjects:
|
193
|
+
.IP \[bu] 2
|
194
|
+
Private gems
|
195
|
+
.IP \[bu] 2
|
196
|
+
Multiple gem sources
|
197
|
+
.IP \[bu] 2
|
198
|
+
Using Gemstash as a mirror
|
199
|
+
.IP \[bu] 2
|
200
|
+
Customizing the server (database, storage, caching, and more)
|
201
|
+
.IP \[bu] 2
|
202
|
+
Deploying Gemstash
|
203
|
+
.IP \[bu] 2
|
204
|
+
Debugging Gemstash
|
205
|
+
.SS Reference
|
206
|
+
.PP
|
207
|
+
An anatomy of various configuration and commands:
|
208
|
+
.IP \[bu] 2
|
209
|
+
Configuration
|
210
|
+
.IP \[bu] 2
|
211
|
+
Authorize
|
212
|
+
.IP \[bu] 2
|
213
|
+
Start
|
214
|
+
.IP \[bu] 2
|
215
|
+
Stop
|
216
|
+
.IP \[bu] 2
|
217
|
+
Status
|
218
|
+
.IP \[bu] 2
|
219
|
+
Setup
|
220
|
+
.IP \[bu] 2
|
221
|
+
Version
|
222
|
+
.PP
|
223
|
+
To see what has changed in recent versions of Gemstash, see the
|
224
|
+
CHANGELOG (https://github.com/rubygems/gemstash/blob/master/CHANGELOG.md).
|
225
|
+
.SS Development
|
226
|
+
.PP
|
227
|
+
After checking out the repo, run \f[V]bin/setup\f[R] to install
|
228
|
+
dependencies.
|
229
|
+
Then, run \f[V]rake\f[R] to run RuboCop and the tests.
|
230
|
+
While developing, you can run \f[V]bin/gemstash\f[R] to run Gemstash.
|
231
|
+
You can also run \f[V]bin/console\f[R] for an interactive prompt that
|
232
|
+
will allow you to experiment.
|
233
|
+
.SS Contributing
|
234
|
+
.PP
|
235
|
+
Bug reports and pull requests are welcome on GitHub at
|
236
|
+
https://github.com/rubygems/gemstash.
|
237
|
+
This project is intended to be a safe, welcoming space for
|
238
|
+
collaboration, and contributors are expected to adhere to the
|
239
|
+
Contributor
|
240
|
+
Covenant (https://github.com/rubygems/gemstash/blob/master/CODE_OF_CONDUCT.md)
|
241
|
+
code of conduct.
|
242
|
+
.SS License
|
243
|
+
.PP
|
244
|
+
The gem is available as open source under the terms of the MIT
|
245
|
+
License (http://opensource.org/licenses/MIT).
|
@@ -1 +1,182 @@
|
|
1
|
+
gemstash-readme(7) gemstash-readme(7)
|
1
2
|
|
3
|
+
|
4
|
+
|
5
|
+
<!-- Automatically generated by Pandoc -->
|
6
|
+
|
7
|
+
1mGemstash0m
|
8
|
+
1mWhat is Gemstash?0m
|
9
|
+
Gemstash is both a cache for remote servers such as
|
10
|
+
https://rubygems.org, and a private gem source.
|
11
|
+
|
12
|
+
If you are using bundler (http://bundler.io/) across many machines that
|
13
|
+
have access to a server within your control, you might want to use Gem-
|
14
|
+
stash.
|
15
|
+
|
16
|
+
If you produce gems that you don't want everyone in the world to have
|
17
|
+
access to, you might want to use Gemstash.
|
18
|
+
|
19
|
+
If you frequently bundle the same set of gems across multiple projects,
|
20
|
+
you might want to use Gemstash.
|
21
|
+
|
22
|
+
Are you only using gems from https://rubygems.org, and don't bundle the
|
23
|
+
same gems frequently? Well, maybe you don't need Gemstash... yet.
|
24
|
+
|
25
|
+
Gemstash is maintained by Ruby Together (https://rubytogether.org/), a
|
26
|
+
grassroots initiative committed to supporting the critical Ruby infra-
|
27
|
+
structure you rely on. Contribute today as an individual
|
28
|
+
(https://rubytogether.org/developers) or even better, as a company
|
29
|
+
(https://rubytogether.org/companies), and ensure that Bundler,
|
30
|
+
RubyGems, Gemstash, and other shared tooling is around for years to
|
31
|
+
come.
|
32
|
+
|
33
|
+
1mQuickstart Guide0m
|
34
|
+
1mSetup0m
|
35
|
+
Gemstash is designed to be quick and painless to get set up. By the
|
36
|
+
end of this Quickstart Guide, you will be able to bundle stashed gems
|
37
|
+
from public sources against a Gemstash server running on your machine.
|
38
|
+
|
39
|
+
Install Gemstash to get started:
|
40
|
+
|
41
|
+
$ gem install gemstash
|
42
|
+
|
43
|
+
After it is installed, starting Gemstash requires no additional steps.
|
44
|
+
Simply start the Gemstash server with the 1mgemstash 22mcommand:
|
45
|
+
|
46
|
+
$ gemstash start
|
47
|
+
|
48
|
+
You may have noticed that the command finished quickly. This is be-
|
49
|
+
cause Gemstash will run the server in the background by default. The
|
50
|
+
server runs on port 9292.
|
51
|
+
|
52
|
+
1mBundling0m
|
53
|
+
With the server running, you can bundle against it. Tell Bundler that
|
54
|
+
you want to use Gemstash to find gems from RubyGems.org:
|
55
|
+
|
56
|
+
$ bundle config mirror.https://rubygems.org http://localhost:9292
|
57
|
+
|
58
|
+
Now you can create a Gemfile and install gems through Gemstash:
|
59
|
+
|
60
|
+
# ./Gemfile
|
61
|
+
source "https://rubygems.org"
|
62
|
+
gem "rubywarrior"
|
63
|
+
|
64
|
+
The gems you include should be gems you don't yet have installed, oth-
|
65
|
+
erwise Gemstash will have nothing to stash. Now bundle:
|
66
|
+
|
67
|
+
$ bundle install --path .bundle
|
68
|
+
|
69
|
+
Your Gemstash server has fetched the gems from https://rubygems.org and
|
70
|
+
cached them for you! To prove this, you can disable your Internet con-
|
71
|
+
nection and try again. Gem files (*.gem) are cached indefinitely. Gem
|
72
|
+
dependencies metadata are cached for 30 minutes, so if you bundle again
|
73
|
+
before that, you can successfully bundle without an Internet connec-
|
74
|
+
tion:
|
75
|
+
|
76
|
+
$ # Disable your Internet first!
|
77
|
+
$ rm -rf Gemfile.lock .bundle
|
78
|
+
$ bundle
|
79
|
+
|
80
|
+
1mFalling back to rubygems.org0m
|
81
|
+
If you want to make sure that your bundling from https://rubygems.org
|
82
|
+
still works as expected when the Gemstash server is not running, you
|
83
|
+
can easily configure Bundler to fallback to https://rubygems.org.
|
84
|
+
|
85
|
+
$ bundle config mirror.https://rubygems.org.fallback_timeout true
|
86
|
+
|
87
|
+
You can also configure this fallback as a number of seconds in case the
|
88
|
+
Gemstash server is simply unresponsive. This example uses a 3 second
|
89
|
+
timeout:
|
90
|
+
|
91
|
+
$ bundle config mirror.https://rubygems.org.fallback_timeout 3
|
92
|
+
|
93
|
+
1mStopping the Server0m
|
94
|
+
Once you've finish using your Gemstash server, you can stop it just as
|
95
|
+
easily as you started it:
|
96
|
+
|
97
|
+
$ gemstash stop
|
98
|
+
|
99
|
+
You'll also want to tell Bundler that it can go back to getting gems
|
100
|
+
from RubyGems.org directly, instead of going through Gemstash:
|
101
|
+
|
102
|
+
$ bundle config --delete mirror.https://rubygems.org
|
103
|
+
|
104
|
+
1mUnder the Hood0m
|
105
|
+
You might wonder where the gems are stored. After running the commands
|
106
|
+
above, you will find a new directory at 1m~/.gemstash22m. This directory
|
107
|
+
holds all the cached and private gems. It also has a server log, the
|
108
|
+
database, and configuration for Gemstash. If you prefer, you can point
|
109
|
+
to a different directory.
|
110
|
+
|
111
|
+
Gemstash uses SQLite (https://www.sqlite.org/) to store details about
|
112
|
+
private gems. The database will be located in 1m~/.gemstash22m, however you
|
113
|
+
won't see the database appear until you start using private gems. If
|
114
|
+
you prefer, you can use a different database.
|
115
|
+
|
116
|
+
Gemstash temporarily caches things like gem dependencies in memory.
|
117
|
+
Anything cached in memory will last for 30 minutes before being re-
|
118
|
+
trieved again. You can use memcached instead of caching in memory.
|
119
|
+
Gem files are always cached permanently, so bundling with a 1mGem-0m
|
120
|
+
1mfile.lock 22mwith all gems cached will never call out to
|
121
|
+
https://rubygems.org.
|
122
|
+
|
123
|
+
The server you ran is provided via Puma (http://puma.io/) and Rack
|
124
|
+
(http://rack.github.io/), however they are not customizable at this
|
125
|
+
point.
|
126
|
+
|
127
|
+
1mDeep Dive0m
|
128
|
+
Deep dive into more subjects:
|
129
|
+
|
130
|
+
o Private gems
|
131
|
+
|
132
|
+
o Multiple gem sources
|
133
|
+
|
134
|
+
o Using Gemstash as a mirror
|
135
|
+
|
136
|
+
o Customizing the server (database, storage, caching, and more)
|
137
|
+
|
138
|
+
o Deploying Gemstash
|
139
|
+
|
140
|
+
o Debugging Gemstash
|
141
|
+
|
142
|
+
1mReference0m
|
143
|
+
An anatomy of various configuration and commands:
|
144
|
+
|
145
|
+
o Configuration
|
146
|
+
|
147
|
+
o Authorize
|
148
|
+
|
149
|
+
o Start
|
150
|
+
|
151
|
+
o Stop
|
152
|
+
|
153
|
+
o Status
|
154
|
+
|
155
|
+
o Setup
|
156
|
+
|
157
|
+
o Version
|
158
|
+
|
159
|
+
To see what has changed in recent versions of Gemstash, see the
|
160
|
+
CHANGELOG (https://github.com/rubygems/gemstash/blob/master/CHANGEL-
|
161
|
+
OG.md).
|
162
|
+
|
163
|
+
1mDevelopment0m
|
164
|
+
After checking out the repo, run 1mbin/setup 22mto install dependencies.
|
165
|
+
Then, run 1mrake 22mto run RuboCop and the tests. While developing, you can
|
166
|
+
run 1mbin/gemstash 22mto run Gemstash. You can also run 1mbin/console 22mfor an
|
167
|
+
interactive prompt that will allow you to experiment.
|
168
|
+
|
169
|
+
1mContributing0m
|
170
|
+
Bug reports and pull requests are welcome on GitHub at
|
171
|
+
https://github.com/rubygems/gemstash. This project is intended to be a
|
172
|
+
safe, welcoming space for collaboration, and contributors are expected
|
173
|
+
to adhere to the Contributor Covenant (https://github.com/rubygems/gem-
|
174
|
+
stash/blob/master/CODE_OF_CONDUCT.md) code of conduct.
|
175
|
+
|
176
|
+
1mLicense0m
|
177
|
+
The gem is available as open source under the terms of the MIT License
|
178
|
+
(http://opensource.org/licenses/MIT).
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
November 30, 2015 gemstash-readme(7)
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<!-- Automatically generated by Pandoc -->
|
2
|
+
.\" Automatically generated by Pandoc 3.0.1
|
3
|
+
.\"
|
4
|
+
.\" Define V font for inline verbatim, using C font in formats
|
5
|
+
.\" that render this, and otherwise B font.
|
6
|
+
.ie "\f[CB]x\f[]"x" \{\
|
7
|
+
. ftr V B
|
8
|
+
. ftr VI BI
|
9
|
+
. ftr VB B
|
10
|
+
. ftr VBI BI
|
11
|
+
.\}
|
12
|
+
.el \{\
|
13
|
+
. ftr V CR
|
14
|
+
. ftr VI CI
|
15
|
+
. ftr VB CB
|
16
|
+
. ftr VBI CBI
|
17
|
+
.\}
|
18
|
+
.TH "gemstash-setup" "1" "October 9, 2015" "" ""
|
19
|
+
.hy
|
20
|
+
.SH Name
|
21
|
+
.PP
|
22
|
+
gemstash-setup - Customize your Gemstash configuration interactively
|
23
|
+
.SH Synopsis
|
24
|
+
.PP
|
25
|
+
\f[V]gemstash setup [--redo] [--debug] [--config-file FILE]\f[R]
|
26
|
+
.SH Description
|
27
|
+
.PP
|
28
|
+
Customize your Gemstash configuration interactively.
|
29
|
+
This will save your config file, but only if a few checks pass after
|
30
|
+
you\[cq]ve provided your answers.
|
31
|
+
.SS Usage
|
32
|
+
.IP
|
33
|
+
.nf
|
34
|
+
\f[C]
|
35
|
+
gemstash setup
|
36
|
+
gemstash setup --redo
|
37
|
+
gemstash setup --config-file <file>
|
38
|
+
\f[R]
|
39
|
+
.fi
|
40
|
+
.SH Options
|
41
|
+
.IP \[bu] 2
|
42
|
+
\f[V]--redo\f[R]: Redo the configuration.
|
43
|
+
This does nothing the first time \f[V]gemstash setup\f[R] is run.
|
44
|
+
If you want to change your configuration using \f[V]gemstash setup\f[R]
|
45
|
+
after you\[cq]ve run it before, you must provide this option, otherwise
|
46
|
+
Gemstash will simply indicate your setup is complete.
|
47
|
+
.IP \[bu] 2
|
48
|
+
\f[V]--debug\f[R]: Output additional information if one of the checks at
|
49
|
+
the end of setup fails.
|
50
|
+
This will do nothing if all checks pass.
|
51
|
+
.IP \[bu] 2
|
52
|
+
\f[V]--config-file FILE\f[R]: Specify the config file to write to.
|
53
|
+
Without this option, your configuration will be written to
|
54
|
+
\f[V]\[ti]/.gemstash/config.yml\f[R].
|
55
|
+
If you write to a custom location, you will need to pass the
|
56
|
+
\f[V]--config-file\f[R] option to all Gemstash commands.
|
57
|
+
If you plan to use ERB in your config file, you might want to use
|
58
|
+
\f[V]\[ti]/.gemstash/config.yml.erb\f[R].
|
@@ -1 +1,42 @@
|
|
1
|
+
gemstash-setup(1) gemstash-setup(1)
|
1
2
|
|
3
|
+
|
4
|
+
|
5
|
+
<!-- Automatically generated by Pandoc -->
|
6
|
+
|
7
|
+
1mName0m
|
8
|
+
gemstash-setup - Customize your Gemstash configuration interactively
|
9
|
+
|
10
|
+
1mSynopsis0m
|
11
|
+
1mgemstash setup [--redo] [--debug] [--config-file FILE]0m
|
12
|
+
|
13
|
+
1mDescription0m
|
14
|
+
Customize your Gemstash configuration interactively. This will save
|
15
|
+
your config file, but only if a few checks pass after you've provided
|
16
|
+
your answers.
|
17
|
+
|
18
|
+
1mUsage0m
|
19
|
+
gemstash setup
|
20
|
+
gemstash setup --redo
|
21
|
+
gemstash setup --config-file <file>
|
22
|
+
|
23
|
+
1mOptions0m
|
24
|
+
o 1m--redo22m: Redo the configuration. This does nothing the first time
|
25
|
+
1mgemstash setup 22mis run. If you want to change your configuration us-
|
26
|
+
ing 1mgemstash setup 22mafter you've run it before, you must provide this
|
27
|
+
option, otherwise Gemstash will simply indicate your setup is com-
|
28
|
+
plete.
|
29
|
+
|
30
|
+
o 1m--debug22m: Output additional information if one of the checks at the
|
31
|
+
end of setup fails. This will do nothing if all checks pass.
|
32
|
+
|
33
|
+
o 1m--config-file FILE22m: Specify the config file to write to. Without
|
34
|
+
this option, your configuration will be written to 1m~/.gemstash/con-0m
|
35
|
+
1mfig.yml22m. If you write to a custom location, you will need to pass
|
36
|
+
the 1m--config-file 22moption to all Gemstash commands. If you plan to
|
37
|
+
use ERB in your config file, you might want to use 1m~/.gemstash/con-0m
|
38
|
+
1mfig.yml.erb22m.
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
October 9, 2015 gemstash-setup(1)
|