lsst-git-lfs-s3 0.3.10 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.mdl_style.rb +9 -0
- data/.mdlrc +5 -0
- data/.travis.yml +49 -2
- data/README.md +40 -15
- data/git-lfs-s3.gemspec +13 -5
- data/lib/git-lfs-s3/version.rb +1 -1
- data/tests/mdl.sh +26 -0
- data/tests/shellcheck.sh +26 -0
- data/tests/yamllint.sh +38 -0
- metadata +15 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e310d25fb1eaa68c8eba1a8e694edffa6a7ac43e65b56b1e758776601c5bac3
|
4
|
+
data.tar.gz: a993e45c1e4b1d7a30c5cbe0162a18f51f71620e72d13934c6b8793f3eaf1d93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 986b158467fe3f436cc916f02bc3dbe56088839e1d63fb0ebc5ddac4304a19a0d56cc1c9d9462a6c0c00f8ffdcae36a521d5fd78643e3c6ce4267dd84a3f620e
|
7
|
+
data.tar.gz: 9a7d0c2ea1eb5286e51d359c31b42b1facec326fce5aaf7371e2003f4413fd5679a2a322f3860924b7748f45acfb2d0536a50ac86c2bca6fae4b745777a6eede
|
data/.mdl_style.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# https://github.com/markdownlint/markdownlint/blob/master/docs/creating_styles.md
|
4
|
+
# https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md
|
5
|
+
all
|
6
|
+
rule 'MD013', code_blocks: false
|
7
|
+
exclude_rule 'MD003'
|
8
|
+
exclude_rule 'MD036'
|
9
|
+
exclude_rule 'MD034'
|
data/.mdlrc
ADDED
data/.travis.yml
CHANGED
@@ -1,5 +1,52 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
|
2
|
+
sudo: false
|
3
|
+
language: c
|
4
|
+
matrix:
|
5
|
+
include:
|
6
|
+
- env: TEST=rubocop
|
7
|
+
language: ruby
|
8
|
+
rvm:
|
9
|
+
- 2.5
|
10
|
+
script: bundle install && bundle exec rubocop
|
11
|
+
|
12
|
+
- env: TEST=markdownlint
|
13
|
+
services:
|
14
|
+
- docker
|
15
|
+
script: ./tests/mdl.sh
|
16
|
+
|
17
|
+
- env: TEST=yamllint
|
18
|
+
services:
|
19
|
+
- docker
|
20
|
+
script: ./tests/yamllint.sh
|
21
|
+
|
22
|
+
- env: TEST=shellcheck
|
23
|
+
services:
|
24
|
+
- docker
|
25
|
+
script: ./tests/shellcheck.sh
|
26
|
+
|
27
|
+
- stage: rubygems release
|
28
|
+
if: "(NOT type IN (pull_request)) AND (tag IS present)"
|
29
|
+
language: ruby
|
30
|
+
rvm:
|
31
|
+
- 2.5
|
32
|
+
script: bundle install
|
33
|
+
deploy:
|
34
|
+
provider: rubygems
|
35
|
+
skip_cleanup: true
|
36
|
+
api_key:
|
37
|
+
# yamllint disable-line rule:line-length
|
38
|
+
secure: "NH8Kvt9WhvO7MYcksMZ22gxSbEEJJXSIRfZVxI4LVYabbbtFiNjfcXlUmfxJX2wT7uQLCq4mXqBECssL96l8t3Bvx3fqM35I3OjKOFf/4wGg4NxnMctyhomCj3WWdWRsCsfCEUZBgiv37LeTvI+gyKxuatDZH3JEoDXfIqZJmKLAwUR7sYMTffqi5llboU6Q6UPpDXCnTW/tHUkjjzMajdMa5/5PtnniPB1RsBPMUGbOmcUAIYwtA+FHuWBfDoRgzB2iOIkDorvz7lU64NfmRttw7fhWqT4RvMZWzg5Yvi+7av4naQ1a49nZQYy7dsgSInDfOr30SoUM8EQ5L6hsztumVrZQdoJ4MqDlZpy8Keb0pSvu8/dGV2Vf1io2cczDSSfV/QZWOnV2QfNksUzFuG8RNKOjHG0YX6VVvXlkuMkuK49sKiK8TkzcxMFrlwFK5JUAxrEVZEr4rLyXPlQUGGnxBbyCfhhI4cydneFrKVET2k2L80m7MnlRQNQFTFtlJUil/CSn2fhjy32sIpwsIydRwYmXVWrZ+bpYvVhJA1tW5Y9Y0kiiOGNg7HKFN7QQGtv/OHoMsejDnp82/+A4dMiE/hVW8Ui3WZsuLivcjPutRsaYmMSJR6gGsNmm+nyB1ZhKd4vmC7eWA4zroaXZ92YdQowagK3XaRvXWJPcniU="
|
39
|
+
gem: git-lfs-s3
|
40
|
+
# yamllint disable-line rule:truthy
|
41
|
+
on:
|
42
|
+
tags: true
|
43
|
+
branch: master
|
44
|
+
repo: lsst-sqre/git-lfs-s3
|
45
|
+
branches:
|
46
|
+
only:
|
47
|
+
- master
|
48
|
+
# also matched against tag pushes
|
49
|
+
- /^\d+\.\d+\.\d+$/
|
50
|
+
- /^v\d+\.\d+\.\d+$/
|
4
51
|
notifications:
|
5
52
|
email: false
|
data/README.md
CHANGED
@@ -2,10 +2,12 @@
|
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/lsst-sqre/git-lfs-s3.svg?branch=master)](https://travis-ci.org/lsst-sqre/git-lfs-s3)
|
4
4
|
|
5
|
+
A [Git LFS](https://git-lfs.github.com/) server that stores your large Git
|
6
|
+
files on S3.
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
8
|
+
It works by generating a presigned URL that the Git LFS client can use to
|
9
|
+
upload directly to S3. It also provides download URLs that allow Git clients to
|
10
|
+
download directly from S3. No data is proxied through the Git LFS server.
|
9
11
|
|
10
12
|
## Installation
|
11
13
|
|
@@ -15,7 +17,8 @@ Git LFS S3 is available on RubyGems.
|
|
15
17
|
gem install lsst-git-lfs-s3
|
16
18
|
```
|
17
19
|
|
18
|
-
Or add it to your Gemfile if you wish to bundle it as a part of another
|
20
|
+
Or add it to your Gemfile if you wish to bundle it as a part of another
|
21
|
+
application.
|
19
22
|
|
20
23
|
``` ruby
|
21
24
|
gem 'git-lfs-s3'
|
@@ -25,24 +28,35 @@ gem 'git-lfs-s3'
|
|
25
28
|
|
26
29
|
### Standalone
|
27
30
|
|
28
|
-
All configuration is done via environment variables. All of these configuration
|
31
|
+
All configuration is done via environment variables. All of these configuration
|
32
|
+
variables must be set.
|
29
33
|
|
30
34
|
* `AWS_REGION` - the region where your S3 bucket is.
|
31
35
|
* `AWS_ACCESS_KEY_ID` - your AWS access key.
|
32
36
|
* `AWS_SECRET_ACCESS_KEY` - your AWS secret key.
|
33
|
-
* `S3_BUCKET` - the bucket you wish to use for LFS storage. While not required,
|
34
|
-
|
37
|
+
* `S3_BUCKET` - the bucket you wish to use for LFS storage. While not required,
|
38
|
+
I recommend using a dedicated bucket for this.
|
39
|
+
* `LFS_SERVER_URL` - the URL where this server can be reached; needed to fetch
|
40
|
+
download URLs.
|
35
41
|
|
36
|
-
You can (and should) also set authentication information. When you push for the
|
42
|
+
You can (and should) also set authentication information. When you push for the
|
43
|
+
first time from git, you will be prompted to enter a username and password when
|
44
|
+
authentication is enabled. You can configure these with environment variables
|
45
|
+
as well.
|
37
46
|
|
38
47
|
* `USERNAME` - the login username.
|
39
48
|
* `PASSWORD` - the login password.
|
40
49
|
|
41
50
|
### Bundled
|
42
51
|
|
43
|
-
If you are bundling the service inside of another application, such as Rails,
|
52
|
+
If you are bundling the service inside of another application, such as Rails,
|
53
|
+
or a different server of your choosing, you can set the configuration directly
|
54
|
+
on `GitLfsS3::Application`. See
|
55
|
+
[bin/git-lfs-s3](https://github.com/meltingice/git-lfs-s3/blob/master/bin/git-lfs-s3)
|
56
|
+
for an example.
|
44
57
|
|
45
|
-
You can also hook the authentication into your own service this way. For
|
58
|
+
You can also hook the authentication into your own service this way. For
|
59
|
+
example:
|
46
60
|
|
47
61
|
``` ruby
|
48
62
|
GitLfsS3::Application.on_authenticate do |username, password, is_safe|
|
@@ -55,7 +69,8 @@ GitLfsS3::Application.on_authenticate do |username, password, is_safe|
|
|
55
69
|
end
|
56
70
|
```
|
57
71
|
|
58
|
-
The logger can be configured as well. This is especially handy if you want to
|
72
|
+
The logger can be configured as well. This is especially handy if you want to
|
73
|
+
hook it into your Rails logger:
|
59
74
|
|
60
75
|
``` ruby
|
61
76
|
GitLfsS3::Application.set :logger, Rails.logger
|
@@ -63,24 +78,34 @@ GitLfsS3::Application.set :logger, Rails.logger
|
|
63
78
|
|
64
79
|
### Git Setup
|
65
80
|
|
66
|
-
If you are new to Git LFS, make sure you read the [Getting
|
81
|
+
If you are new to Git LFS, make sure you read the [Getting
|
82
|
+
Started](https://git-lfs.github.com/) guide first. Once that's done, you can
|
83
|
+
configure your Git client to use this server by creating a `.gitconfig` file in
|
84
|
+
the root of your repository and adding this config, but with your server
|
85
|
+
address:
|
67
86
|
|
68
87
|
``` git
|
69
88
|
[lfs]
|
70
89
|
url = "http://yourserver.com"
|
71
90
|
```
|
72
91
|
|
73
|
-
Once that is done, you can tell Git LFS to track files with `git lfs track
|
92
|
+
Once that is done, you can tell Git LFS to track files with `git lfs track
|
93
|
+
"*.psd"`, for example.
|
74
94
|
|
75
95
|
## Running
|
76
96
|
|
77
|
-
This repository contains an executable that will run a basic WEBrick server.
|
97
|
+
This repository contains an executable that will run a basic WEBrick server.
|
98
|
+
Since this service is so lightweight, that's likely all you'll need. The port
|
99
|
+
will default to 8080, but can be configured with an environment variable.
|
78
100
|
|
79
101
|
``` bash
|
80
102
|
PORT=4000 git-lfs-s3
|
81
103
|
```
|
82
104
|
|
83
|
-
However, because this is a Sinatra application, it can also be mounted within
|
105
|
+
However, because this is a Sinatra application, it can also be mounted within
|
106
|
+
other Rack based projects or other Rack-based servers such as Unicorn or Puma.
|
107
|
+
For example, if you wanted to add this to your Rails project, configure
|
108
|
+
`GitLfsS3` in an initializer, and add this your routes:
|
84
109
|
|
85
110
|
``` ruby
|
86
111
|
mount GitLfsS3::Application => '/lfs'
|
data/git-lfs-s3.gemspec
CHANGED
@@ -7,8 +7,16 @@ require 'git-lfs-s3/version'
|
|
7
7
|
Gem::Specification.new do |gem|
|
8
8
|
gem.name = 'lsst-git-lfs-s3'
|
9
9
|
gem.version = GitLfsS3::VERSION
|
10
|
-
gem.authors = [
|
11
|
-
|
10
|
+
gem.authors = [
|
11
|
+
'Ryan LeFevre',
|
12
|
+
'J. Matt Peterson',
|
13
|
+
'Joshua Hoblitt',
|
14
|
+
]
|
15
|
+
gem.email = [
|
16
|
+
'meltingice8917@gmail.com',
|
17
|
+
'jmatt@lsst.org',
|
18
|
+
'josh@hoblitt.com',
|
19
|
+
]
|
12
20
|
gem.description = "LSST's Git LFS server"
|
13
21
|
gem.summary = "LSST's Git LFS server"
|
14
22
|
gem.homepage = 'https://github.com/lsst-sqre/git-lfs-s3'
|
@@ -19,9 +27,9 @@ Gem::Specification.new do |gem|
|
|
19
27
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
20
28
|
gem.require_paths = ['lib']
|
21
29
|
|
22
|
-
gem.add_dependency 'aws-sdk', '~> 2'
|
23
|
-
gem.add_dependency 'multi_json', '~> 1'
|
24
|
-
gem.add_dependency 'sinatra', '
|
30
|
+
gem.add_dependency 'aws-sdk', '~> 2.11'
|
31
|
+
gem.add_dependency 'multi_json', '~> 1.13'
|
32
|
+
gem.add_dependency 'sinatra', '~> 2.0.2'
|
25
33
|
|
26
34
|
gem.add_development_dependency 'rake', '~> 10'
|
27
35
|
gem.add_development_dependency 'rubocop', '~> 0.61.1'
|
data/lib/git-lfs-s3/version.rb
CHANGED
data/tests/mdl.sh
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
shopt -s globstar nullglob
|
5
|
+
|
6
|
+
CHECK=( **/*.md )
|
7
|
+
IGNORE=()
|
8
|
+
|
9
|
+
for c in "${!CHECK[@]}"; do
|
10
|
+
for i in "${IGNORE[@]}"; do
|
11
|
+
[[ ${CHECK[c]} == "$i" ]] && unset -v 'CHECK[c]'
|
12
|
+
done
|
13
|
+
done
|
14
|
+
[[ ${#CHECK[@]} -eq 0 ]] && { echo 'no files to check'; exit 0; }
|
15
|
+
|
16
|
+
echo '---'
|
17
|
+
echo 'check:'
|
18
|
+
for c in "${CHECK[@]}"; do
|
19
|
+
echo " - ${c}"
|
20
|
+
done
|
21
|
+
echo
|
22
|
+
|
23
|
+
docker run -ti -v "$(pwd):$(pwd)" -w "$(pwd)" \
|
24
|
+
mivok/markdownlint:0.4.0 "${CHECK[@]}"
|
25
|
+
|
26
|
+
# vim: tabstop=2 shiftwidth=2 expandtab
|
data/tests/shellcheck.sh
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
shopt -s globstar nullglob
|
5
|
+
|
6
|
+
CHECK=( **/*.sh )
|
7
|
+
IGNORE=( environments/** .bundle/** .tmp/** )
|
8
|
+
|
9
|
+
for c in "${!CHECK[@]}"; do
|
10
|
+
for i in "${IGNORE[@]}"; do
|
11
|
+
[[ ${CHECK[c]} == "$i" ]] && unset -v 'CHECK[c]'
|
12
|
+
done
|
13
|
+
done
|
14
|
+
[[ ${#CHECK[@]} -eq 0 ]] && { echo 'no files to check'; exit 0; }
|
15
|
+
|
16
|
+
echo '---'
|
17
|
+
echo 'check:'
|
18
|
+
for c in "${CHECK[@]}"; do
|
19
|
+
echo " - ${c}"
|
20
|
+
done
|
21
|
+
echo
|
22
|
+
|
23
|
+
docker run -ti -v "$(pwd):$(pwd)" -w "$(pwd)" \
|
24
|
+
koalaman/shellcheck-alpine:v0.6.0 shellcheck -x "${CHECK[@]}"
|
25
|
+
|
26
|
+
# vim: tabstop=2 shiftwidth=2 expandtab
|
data/tests/yamllint.sh
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
shopt -s globstar nullglob
|
5
|
+
|
6
|
+
CHECK=( **/*.yaml **/*.yaml.tpl **/*.yml **/*.eyaml .travis.yml )
|
7
|
+
EYAML=( **/*.eyaml )
|
8
|
+
IGNORE=()
|
9
|
+
CONF_FILE=".yamllint.yaml"
|
10
|
+
|
11
|
+
# filter out plaintext versions of .eyaml files
|
12
|
+
for e in "${!EYAML[@]}"; do
|
13
|
+
uneyaml=${EYAML[e]/eyaml/yaml}
|
14
|
+
for c in "${!CHECK[@]}"; do
|
15
|
+
[[ ${CHECK[c]} == "$uneyaml" ]] && unset -v 'CHECK[c]'
|
16
|
+
done
|
17
|
+
done
|
18
|
+
|
19
|
+
for c in "${!CHECK[@]}"; do
|
20
|
+
for i in "${IGNORE[@]}"; do
|
21
|
+
[[ ${CHECK[c]} == "$i" ]] && unset -v 'CHECK[c]'
|
22
|
+
done
|
23
|
+
done
|
24
|
+
[[ ${#CHECK[@]} -eq 0 ]] && { echo 'no files to check'; exit 0; }
|
25
|
+
|
26
|
+
echo '---'
|
27
|
+
echo 'check:'
|
28
|
+
for c in "${CHECK[@]}"; do
|
29
|
+
echo " - ${c}"
|
30
|
+
done
|
31
|
+
echo
|
32
|
+
|
33
|
+
ARGS=()
|
34
|
+
[[ -f $CONF_FILE ]] && ARGS+=(-c "$CONF_FILE")
|
35
|
+
ARGS+=("${CHECK[@]}")
|
36
|
+
docker run -ti -v "$(pwd):/workdir" lsstsqre/yamllint:1.13.0 "${ARGS[@]}"
|
37
|
+
|
38
|
+
# vim: tabstop=2 shiftwidth=2 expandtab
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lsst-git-lfs-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan LeFevre
|
8
8
|
- J. Matt Peterson
|
9
|
+
- Joshua Hoblitt
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2019-01-05 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: aws-sdk
|
@@ -17,40 +18,40 @@ dependencies:
|
|
17
18
|
requirements:
|
18
19
|
- - "~>"
|
19
20
|
- !ruby/object:Gem::Version
|
20
|
-
version: '2'
|
21
|
+
version: '2.11'
|
21
22
|
type: :runtime
|
22
23
|
prerelease: false
|
23
24
|
version_requirements: !ruby/object:Gem::Requirement
|
24
25
|
requirements:
|
25
26
|
- - "~>"
|
26
27
|
- !ruby/object:Gem::Version
|
27
|
-
version: '2'
|
28
|
+
version: '2.11'
|
28
29
|
- !ruby/object:Gem::Dependency
|
29
30
|
name: multi_json
|
30
31
|
requirement: !ruby/object:Gem::Requirement
|
31
32
|
requirements:
|
32
33
|
- - "~>"
|
33
34
|
- !ruby/object:Gem::Version
|
34
|
-
version: '1'
|
35
|
+
version: '1.13'
|
35
36
|
type: :runtime
|
36
37
|
prerelease: false
|
37
38
|
version_requirements: !ruby/object:Gem::Requirement
|
38
39
|
requirements:
|
39
40
|
- - "~>"
|
40
41
|
- !ruby/object:Gem::Version
|
41
|
-
version: '1'
|
42
|
+
version: '1.13'
|
42
43
|
- !ruby/object:Gem::Dependency
|
43
44
|
name: sinatra
|
44
45
|
requirement: !ruby/object:Gem::Requirement
|
45
46
|
requirements:
|
46
|
-
- - "
|
47
|
+
- - "~>"
|
47
48
|
- !ruby/object:Gem::Version
|
48
49
|
version: 2.0.2
|
49
50
|
type: :runtime
|
50
51
|
prerelease: false
|
51
52
|
version_requirements: !ruby/object:Gem::Requirement
|
52
53
|
requirements:
|
53
|
-
- - "
|
54
|
+
- - "~>"
|
54
55
|
- !ruby/object:Gem::Version
|
55
56
|
version: 2.0.2
|
56
57
|
- !ruby/object:Gem::Dependency
|
@@ -85,12 +86,15 @@ description: LSST's Git LFS server
|
|
85
86
|
email:
|
86
87
|
- meltingice8917@gmail.com
|
87
88
|
- jmatt@lsst.org
|
89
|
+
- josh@hoblitt.com
|
88
90
|
executables:
|
89
91
|
- git-lfs-s3
|
90
92
|
extensions: []
|
91
93
|
extra_rdoc_files: []
|
92
94
|
files:
|
93
95
|
- ".gitignore"
|
96
|
+
- ".mdl_style.rb"
|
97
|
+
- ".mdlrc"
|
94
98
|
- ".rubocop.yml"
|
95
99
|
- ".travis.yml"
|
96
100
|
- Gemfile
|
@@ -107,6 +111,9 @@ files:
|
|
107
111
|
- lib/git-lfs-s3/services/upload/object_exists.rb
|
108
112
|
- lib/git-lfs-s3/services/upload/upload_required.rb
|
109
113
|
- lib/git-lfs-s3/version.rb
|
114
|
+
- tests/mdl.sh
|
115
|
+
- tests/shellcheck.sh
|
116
|
+
- tests/yamllint.sh
|
110
117
|
homepage: https://github.com/lsst-sqre/git-lfs-s3
|
111
118
|
licenses:
|
112
119
|
- MIT
|