gemstash 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +34 -0
- data/lib/gemstash.rb +0 -1
- data/lib/gemstash/authorization.rb +1 -5
- data/lib/gemstash/cli.rb +4 -4
- data/lib/gemstash/cli/authorize.rb +4 -2
- data/lib/gemstash/cli/base.rb +5 -4
- data/lib/gemstash/cli/setup.rb +2 -2
- data/lib/gemstash/cli/status.rb +1 -1
- data/lib/gemstash/cli/stop.rb +1 -1
- data/lib/gemstash/configuration.rb +3 -2
- data/lib/gemstash/gem_pusher.rb +7 -0
- data/lib/gemstash/gem_source/private_source.rb +0 -4
- data/lib/gemstash/gem_source/upstream_source.rb +0 -4
- data/lib/gemstash/health.rb +3 -3
- data/lib/gemstash/logging.rb +2 -4
- data/lib/gemstash/man/gemstash-authorize.1.txt +53 -33
- data/lib/gemstash/man/gemstash-configuration.5.txt +10 -141
- data/lib/gemstash/man/gemstash-customize.7.txt +66 -175
- data/lib/gemstash/man/gemstash-debugging.7.txt +54 -17
- data/lib/gemstash/man/gemstash-deploy.7.txt +51 -44
- data/lib/gemstash/man/gemstash-mirror.7.txt +53 -20
- data/lib/gemstash/man/gemstash-multiple-sources.7.txt +48 -53
- data/lib/gemstash/man/gemstash-private-gems.7.txt +15 -117
- data/lib/gemstash/man/gemstash-readme.7.txt +10 -126
- data/lib/gemstash/man/gemstash-setup.1.txt +54 -28
- data/lib/gemstash/man/gemstash-start.1.txt +56 -16
- data/lib/gemstash/man/gemstash-status.1.txt +57 -13
- data/lib/gemstash/man/gemstash-stop.1.txt +57 -13
- data/lib/gemstash/man/gemstash-version.1.txt +57 -12
- data/lib/gemstash/migrations/01_gem_dependencies.rb +2 -2
- data/lib/gemstash/migrations/03_cached_gems.rb +1 -1
- data/lib/gemstash/migrations/04_health_tests.rb +8 -0
- data/lib/gemstash/puma.rb +1 -1
- data/lib/gemstash/storage.rb +1 -0
- data/lib/gemstash/upstream.rb +2 -2
- data/lib/gemstash/version.rb +1 -1
- data/lib/gemstash/web.rb +5 -4
- metadata +20 -28
- data/lib/gemstash/gem_unyanker.rb +0 -67
- data/lib/gemstash/man/gemstash-authorize.1 +0 -51
- data/lib/gemstash/man/gemstash-configuration.5 +0 -215
- data/lib/gemstash/man/gemstash-customize.7 +0 -280
- data/lib/gemstash/man/gemstash-debugging.7 +0 -34
- data/lib/gemstash/man/gemstash-deploy.7 +0 -72
- data/lib/gemstash/man/gemstash-mirror.7 +0 -40
- data/lib/gemstash/man/gemstash-multiple-sources.7 +0 -89
- data/lib/gemstash/man/gemstash-private-gems.7 +0 -244
- data/lib/gemstash/man/gemstash-readme.7 +0 -234
- data/lib/gemstash/man/gemstash-setup.1 +0 -43
- data/lib/gemstash/man/gemstash-start.1 +0 -26
- data/lib/gemstash/man/gemstash-status.1 +0 -20
- data/lib/gemstash/man/gemstash-stop.1 +0 -20
- data/lib/gemstash/man/gemstash-version.1 +0 -22
@@ -1,175 +1,66 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
vans.net/rdoc/files/doc/opening_databases_rdoc.html#label-mysql2) for
|
68
|
-
your :db_adapter. When using any of these options, you need to specify
|
69
|
-
the :db_url to point to an existing database. Here is an example con-
|
70
|
-
figuration to use the postgres adapter:
|
71
|
-
|
72
|
-
# ~/.gemstash/config.yml
|
73
|
-
---
|
74
|
-
:db_adapter: postgres
|
75
|
-
:db_url: postgres:///gemstash
|
76
|
-
:db_connection_options: # Sequel.connect options
|
77
|
-
:connect_timeout: 10
|
78
|
-
:read_timeout: 5
|
79
|
-
:timeout: 30
|
80
|
-
|
81
|
-
Regardless of the adapter you choose, the database will automatically
|
82
|
-
migrate to your version of Gemstash whenever the database is needed.
|
83
|
-
You only need to ensure the database exists and Gemstash will do the
|
84
|
-
rest, except for sqlite3 (for which Gemstash will also create the data-
|
85
|
-
base for you).
|
86
|
-
|
87
|
-
CACHE
|
88
|
-
Certain things (like dependencies) are cached in memory. This avoids
|
89
|
-
web calls to the gem source, and database calls for private gems. The
|
90
|
-
memory cache can optionally be swapped out with a Memcached
|
91
|
-
(http://memcached.org/) server (or cluster of servers). To use Mem-
|
92
|
-
cached, you must update the :cache_type configuration key to be mem-
|
93
|
-
cached, and provide the servers via the :memcached_servers configura-
|
94
|
-
tion key:
|
95
|
-
|
96
|
-
# ~/.gemstash/config.yml
|
97
|
-
---
|
98
|
-
:cache_type: memcached
|
99
|
-
:memcached_servers: memcached1.local:11211,memcached2.local:11211
|
100
|
-
|
101
|
-
Note that the :memcached_servers requires a comma separated list of
|
102
|
-
servers. All caching lasts for 30 minutes.
|
103
|
-
|
104
|
-
SERVER
|
105
|
-
Gemstash uses Puma (http://puma.io/) and Rack (http://rack.github.io/)
|
106
|
-
as the server. Alternate server configurations are not currently sup-
|
107
|
-
ported, but you can take a look at the Puma configuration
|
108
|
-
(https://github.com/bundler/gemstash/blob/master/lib/gemstash/puma.rb)
|
109
|
-
and the rackup file (https://github.com/bundler/gemstash/blob/mas-
|
110
|
-
ter/lib/gemstash/config.ru) for inspiration.
|
111
|
-
|
112
|
-
While the server is not customizable, the way Gemstash binds the port
|
113
|
-
can be changed. To change the binding, update the :bind configuration
|
114
|
-
key:
|
115
|
-
|
116
|
-
# ~/.gemstash/config.yml
|
117
|
-
---
|
118
|
-
:bind: tcp://0.0.0.0:4242
|
119
|
-
|
120
|
-
This maps directly to the Puma bind flag
|
121
|
-
(https://github.com/puma/puma#binding-tcp--sockets), and will support
|
122
|
-
anything valid for that flag.
|
123
|
-
|
124
|
-
The number of threads Puma uses is also customizable via the
|
125
|
-
:puma_threads configuration key. The default is 16.
|
126
|
-
|
127
|
-
PROTECTED FETCH
|
128
|
-
Gemstash by default allows unauthenticated access for private gems.
|
129
|
-
Authenticated access is available via the :protected_fetch configura-
|
130
|
-
tion key.
|
131
|
-
|
132
|
-
# ~/.gemstash/config.yml
|
133
|
-
---
|
134
|
-
:protected_fetch: true
|
135
|
-
|
136
|
-
More details on protected_fetch are here (gemstash help private-
|
137
|
-
gems.7).
|
138
|
-
|
139
|
-
FETCH TIMEOUT
|
140
|
-
The default fetch timeout is 20 seconds. Use the :fetch_timeout con-
|
141
|
-
figuration key to change it.
|
142
|
-
|
143
|
-
---
|
144
|
-
:fetch_timeout: 20
|
145
|
-
|
146
|
-
CONFIG FILE LOCATION
|
147
|
-
By default, configuration for Gemstash will be at ~/.gemstash/con-
|
148
|
-
fig.yml. This can be changed by providing the --config-file option to
|
149
|
-
the various Gemstash commands:
|
150
|
-
|
151
|
-
$ gemstash setup --config-file ./gemstash-config.yml
|
152
|
-
$ gemstash authorize --config-file ./gemstash-config.yml
|
153
|
-
$ gemstash start --config-file ./gemstash-config.yml
|
154
|
-
$ gemstash stop --config-file ./gemstash-config.yml
|
155
|
-
$ gemstash status --config-file ./gemstash-config.yml
|
156
|
-
|
157
|
-
When providing --config-file to gemstash setup, the provided file will
|
158
|
-
be output to with the provided configuration. This will overwrite any
|
159
|
-
existing configuration. If the file doesn't exist when providing
|
160
|
-
--config-file to gemstash start, gemstash stop, gemstash status, and
|
161
|
-
gemstash authorize, the default configuration will be used.
|
162
|
-
|
163
|
-
ERB PARSED CONFIG
|
164
|
-
You may also create a ~/.gemstash/config.yml.erb file. If present,
|
165
|
-
this will be used instead of ~/.gemstash/config.yml. For example, with
|
166
|
-
this you can use environment variables in the config:
|
167
|
-
|
168
|
-
# ~/.gemstash/config.yml.erb
|
169
|
-
---
|
170
|
-
:db_adapter: postgres
|
171
|
-
:db_url: <%= ENV["DATABASE_URL"] %>
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
October 28, 2015 gemstash-customize(7)
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
@@ -1,29 +1,66 @@
|
|
1
|
-
gemstash-debugging(7) gemstash-debugging(7)
|
2
1
|
|
3
2
|
|
4
3
|
|
5
|
-
DEBUGGING GEMSTASH
|
6
|
-
If you are finding Gemstash isn't behaving as you would expect, you
|
7
|
-
might want to start by looking at the server log. You can find the log
|
8
|
-
at server.log within your base directory. By default, this will be at
|
9
|
-
~/.gemstash/server.log.
|
10
4
|
|
11
|
-
You might find it easier to view the log directly in your terminal. If
|
12
|
-
you run Gemstash in non-daemonized form (gemstash help start.1), the
|
13
|
-
log will be output directly to standard out:
|
14
5
|
|
15
|
-
$ gemstash start --no-daemonize
|
16
6
|
|
17
|
-
You can also check the status (gemstash help status.1) of the server:
|
18
7
|
|
19
|
-
$ gemstash status
|
20
8
|
|
21
|
-
The server status is checked by passing through to pumactl
|
22
|
-
(https://github.com/puma/puma#pumactl).
|
23
9
|
|
24
|
-
If you find a bug, please don't hesitate to open a bug report
|
25
|
-
(https://github.com/bundler/gemstash#contributing)!
|
26
10
|
|
27
11
|
|
28
12
|
|
29
|
-
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
@@ -1,59 +1,66 @@
|
|
1
|
-
gemstash-deploy(7) gemstash-deploy(7)
|
2
1
|
|
3
2
|
|
4
3
|
|
5
|
-
DEPLOYING GEMSTASH
|
6
|
-
Bundler is here for the rescue to keep Gemstash up to date! Create a
|
7
|
-
Gemfile pointing to Gemstash:
|
8
4
|
|
9
|
-
# ./Gemfile
|
10
|
-
source "https://rubygems.org"
|
11
|
-
gem "gemstash"
|
12
5
|
|
13
|
-
Then bundle to create your Gemfile.lock. When you are ready to up-
|
14
|
-
grade, simply bundle update. You may need to run gemstash via bun-
|
15
|
-
dle exec. Alternatively, you can gem uninstall gemstash and gem in-
|
16
|
-
stall gemstash when you want to upgrade.
|
17
6
|
|
18
|
-
Gemstash will automatically run any necessary migrations, so updating
|
19
|
-
the gem is all that needs to be done.
|
20
7
|
|
21
|
-
It is probably wise to stop Gemstash before upgrading, then starting
|
22
|
-
again once you are done:
|
23
8
|
|
24
|
-
$ bundle exec gemstash stop
|
25
|
-
$ bundle update
|
26
|
-
$ bundle exec gemstash start
|
27
9
|
|
28
|
-
MONITORING
|
29
|
-
Health monitoring is built in to Gemstash using the serv-
|
30
|
-
er_health_check-rack (https://github.com/on-site/server_health_check-
|
31
|
-
rack) gem. If you request /health from your Gemstash instance, you
|
32
|
-
will get a JSON response along with an HTTP status code indicating suc-
|
33
|
-
cess or failure. The JSON response will look something like this for a
|
34
|
-
success case:
|
35
10
|
|
36
|
-
{
|
37
|
-
"status": {
|
38
|
-
"heartbeat": "OK",
|
39
|
-
"storage_read": "OK",
|
40
|
-
"storage_write": "OK",
|
41
|
-
"db_read": "OK",
|
42
|
-
"db_write": "OK"
|
43
|
-
}
|
44
|
-
}
|
45
11
|
|
46
|
-
This request will test storage and database access and report on the
|
47
|
-
result. Each key in the status can be requested alone to just report
|
48
|
-
on that status. For example, if you would like a health check that
|
49
|
-
doesn't interact with storage or the database, you can use
|
50
|
-
/health/heartbeat which will always respond with a success while your
|
51
|
-
Gemstash server is running.
|
52
12
|
|
53
|
-
DOWNGRADING
|
54
|
-
It is not recommended to go backwards in Gemstash versions. Migrations
|
55
|
-
may have run that could leave the database in a bad state.
|
56
13
|
|
57
14
|
|
58
15
|
|
59
|
-
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
@@ -1,33 +1,66 @@
|
|
1
|
-
gemstash-mirror(7) gemstash-mirror(7)
|
2
1
|
|
3
2
|
|
4
3
|
|
5
|
-
USING GEMSTASH AS A MIRROR
|
6
|
-
If you don't have control over your Gemfile, or you don't want to force
|
7
|
-
everyone on your team to go through the Gemstash server, you can use
|
8
|
-
Bundler mirroring to bundle against your Gemstash server.
|
9
4
|
|
10
|
-
For each source in your Gemfile, add a mirror pointing to your Gemstash
|
11
|
-
server:
|
12
5
|
|
13
|
-
$ bundle config mirror.http://rubygems.org http://localhost:9292
|
14
|
-
$ bundle config mirror.https://my.gem-source.local http://localhost:9292/upstream/$(ruby -rcgi -e 'puts CGI.escape("https://my.gem-source.local")')
|
15
6
|
|
16
|
-
From now on, bundler will fetch gems from those sources via your Gem-
|
17
|
-
stash server.
|
18
7
|
|
19
|
-
SIMPLER GEMSTASH MIRRORS
|
20
|
-
This feature requires Bundler to be at least version 1.11.0.
|
21
8
|
|
22
|
-
If you are using Bundler version 1.11.0 or greater, the mirroring be-
|
23
|
-
comes a bit easier:
|
24
9
|
|
25
|
-
$ bundle config mirror.http://rubygems.org http://localhost:9292
|
26
|
-
$ bundle config mirror.https://my.gem-source.local http://localhost:9292
|
27
10
|
|
28
|
-
Bundler will then send headers to Gemstash to indicate the correct up-
|
29
|
-
stream.
|
30
11
|
|
31
12
|
|
32
13
|
|
33
|
-
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|