pansophy 0.5.6 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/release.yml +59 -0
- data/.github/workflows/ruby.yml +16 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +15 -1
- data/README.md +23 -6
- data/lib/pansophy/config_synchronizer.rb +1 -2
- data/lib/pansophy/connection.rb +15 -0
- data/lib/pansophy/remote/create_file.rb +0 -2
- data/lib/pansophy/version.rb +1 -1
- data/pansophy.gemspec +3 -5
- metadata +16 -37
- data/.travis.yml +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: de34ea76e43128a0992a5c65b1340f7d89d06f7ed18b99f4482e8424f2ae88aa
|
4
|
+
data.tar.gz: 7ea83691dcd7f194a8e83c3053443c9754134c073ca8a216a8632384a0ea269b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23bd0aaa2784bf8874ae0c9f8009d0907c46dce2b8dc2a636c7df7b638e1d691419843a6c8c3ddc6bda0314ccd6e01d95ac60ab070f43f0b3ff87aaada894f3c
|
7
|
+
data.tar.gz: 230869bccd6ef9ad83075f95f6f01126940e11bd021b76a1aed038f74aef57290518adf7f81853589eef93d8982e1ac046182f46f0f8420671a0d598d66d148b
|
@@ -0,0 +1,59 @@
|
|
1
|
+
name: Release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- "v*"
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
build:
|
10
|
+
name: Build
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- name: Checkout
|
14
|
+
uses: actions/checkout@v2
|
15
|
+
- uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
bundler-cache: true
|
18
|
+
- run: bundle exec rake
|
19
|
+
|
20
|
+
release:
|
21
|
+
needs: build
|
22
|
+
name: Release
|
23
|
+
runs-on: ubuntu-latest
|
24
|
+
steps:
|
25
|
+
- name: Checkout
|
26
|
+
uses: actions/checkout@v2
|
27
|
+
|
28
|
+
- name: Generate Changelog
|
29
|
+
run: |
|
30
|
+
# Get version from github ref (remove 'refs/tags/' and prefix 'v')
|
31
|
+
version="${GITHUB_REF#refs/tags/v}"
|
32
|
+
npx changelog-parser CHANGELOG.md | jq -cr ".versions | .[] | select(.version == \"$version\") | .body" > ${{ github.workflow }}-CHANGELOG.txt
|
33
|
+
|
34
|
+
- name: Release
|
35
|
+
uses: softprops/action-gh-release@v1
|
36
|
+
with:
|
37
|
+
body_path: ${{ github.workflow }}-CHANGELOG.txt
|
38
|
+
env:
|
39
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
40
|
+
|
41
|
+
publish:
|
42
|
+
needs: [build, release]
|
43
|
+
name: Publish
|
44
|
+
runs-on: ubuntu-latest
|
45
|
+
|
46
|
+
steps:
|
47
|
+
- uses: actions/checkout@v2
|
48
|
+
- uses: ruby/setup-ruby@v1
|
49
|
+
|
50
|
+
- name: Publish to RubyGems
|
51
|
+
run: |
|
52
|
+
mkdir -p $HOME/.gem
|
53
|
+
touch $HOME/.gem/credentials
|
54
|
+
chmod 0600 $HOME/.gem/credentials
|
55
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
56
|
+
gem build *.gemspec
|
57
|
+
gem push *.gem
|
58
|
+
env:
|
59
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
name: Build and Test
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
ruby: ["2.6", "2.7", "3.0"]
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v2
|
12
|
+
- uses: ruby/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: ${{ matrix.ruby }}
|
15
|
+
bundler-cache: true
|
16
|
+
- run: bundle exec rake
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.0
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,20 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
##
|
3
|
+
## 1.2.0
|
4
|
+
|
5
|
+
- [TT-8614] Update to build with github actions / ruby 3.0 / rails 6.1
|
6
|
+
|
7
|
+
## [1.1.0]
|
8
|
+
### Removed
|
9
|
+
- [TT-7135] Remove the Anima dependency
|
10
|
+
|
11
|
+
## [1.0.0]
|
12
|
+
### Added
|
13
|
+
- [DO-228] Upgrade the AWS Fog dependency
|
14
|
+
|
15
|
+
## [0.6.0]
|
16
|
+
### Added
|
17
|
+
- [DO-90] Support using EC2 profile when fetching configuration files
|
4
18
|
|
5
19
|
## [0.5.6]
|
6
20
|
### Changed
|
data/README.md
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
# Pansophy
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/pansophy.svg)](http://badge.fury.io/rb/pansophy)
|
4
|
-
[![Build Status](https://
|
4
|
+
[![Build Status](https://github.com/sealink/pansophy/workflows/Build%20and%20Test/badge.svg?branch=master)](https://github.com/sealink/pansophy/actions)
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/sealink/pansophy/badge.svg)](https://coveralls.io/r/sealink/pansophy)
|
6
|
-
[![Dependency Status](https://gemnasium.com/sealink/pansophy.svg)](https://gemnasium.com/sealink/pansophy)
|
7
6
|
[![Code Climate](https://codeclimate.com/github/sealink/pansophy/badges/gpa.svg)](https://codeclimate.com/github/sealink/pansophy)
|
8
7
|
|
9
8
|
Pansophy allows different applications to share knowledge via a centralised remote repository
|
10
9
|
|
11
10
|
The current version only works with AWS S3 buckets and allows:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
|
12
|
+
- pulling a remote directory to a local directory
|
13
|
+
- merging a remote directory with a local directory
|
14
|
+
- pushing a local directory to a remote directory
|
15
|
+
- reading the contents of a remote file
|
16
16
|
|
17
17
|
## Installation
|
18
18
|
|
@@ -33,18 +33,21 @@ Or install it yourself as:
|
|
33
33
|
## Usage
|
34
34
|
|
35
35
|
To pull a remote directory to a local directory
|
36
|
+
|
36
37
|
```ruby
|
37
38
|
# Pass overwrite: true to entirely replace the local directory.
|
38
39
|
Pansophy.pull('bucket_name', 'remote_directory', 'local_directory', overwrite: true)
|
39
40
|
```
|
40
41
|
|
41
42
|
To merge a remote directory with a local directory
|
43
|
+
|
42
44
|
```ruby
|
43
45
|
# Pass overwrite: true to entirely replace the remote directory.
|
44
46
|
Pansophy.merge('bucket_name', 'remote_directory', 'local_directory', overwrite: true)
|
45
47
|
```
|
46
48
|
|
47
49
|
To push a local directory to a remote directory
|
50
|
+
|
48
51
|
```ruby
|
49
52
|
# Pass overwrite: true to overwrite local files with remote files.
|
50
53
|
# Local files without a corresponding remote file remain untouched.
|
@@ -52,11 +55,13 @@ Pansophy.push('bucket_name', 'remote_directory', 'local_directory', overwrite: t
|
|
52
55
|
```
|
53
56
|
|
54
57
|
To read the contents of a remote file
|
58
|
+
|
55
59
|
```ruby
|
56
60
|
Pansophy.read('bucket_name', 'remote_file_path')
|
57
61
|
```
|
58
62
|
|
59
63
|
To read the head of a remote file
|
64
|
+
|
60
65
|
```ruby
|
61
66
|
Pansophy.head('bucket_name', 'remote_file_path')
|
62
67
|
```
|
@@ -67,6 +72,18 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
67
72
|
|
68
73
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
69
74
|
|
75
|
+
## Release
|
76
|
+
|
77
|
+
To publish a new version of this gem the following steps must be taken.
|
78
|
+
|
79
|
+
* Update the version in the following files
|
80
|
+
```
|
81
|
+
CHANGELOG.md
|
82
|
+
lib/pansophy/version.rb
|
83
|
+
````
|
84
|
+
* Create a tag using the format v0.1.0
|
85
|
+
* Follow build progress in GitHub actions
|
86
|
+
|
70
87
|
## Contributing
|
71
88
|
|
72
89
|
1. Fork it ( https://github.com/sealink/pansophy/fork )
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'pansophy'
|
2
|
-
require 'facets/kernel/blank'
|
3
2
|
|
4
3
|
module Pansophy
|
5
4
|
class ConfigSynchronizer
|
@@ -37,7 +36,7 @@ module Pansophy
|
|
37
36
|
end
|
38
37
|
|
39
38
|
def verify_config_bucket_name!
|
40
|
-
return unless config_bucket_name.
|
39
|
+
return unless config_bucket_name.nil? || config_bucket_name.empty?
|
41
40
|
fail ConfigSynchronizerError, 'CONFIG_BUCKET_NAME is undefined'
|
42
41
|
end
|
43
42
|
end
|
data/lib/pansophy/connection.rb
CHANGED
@@ -2,6 +2,17 @@ module Pansophy
|
|
2
2
|
module Connection
|
3
3
|
def self.aws
|
4
4
|
Excon.defaults[:ciphers] = 'DEFAULT'
|
5
|
+
return env_fog if use_env_fog?
|
6
|
+
iam_profile_fog
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def self.use_env_fog?
|
12
|
+
ENV.include? 'AWS_ACCESS_KEY_ID'
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.env_fog
|
5
16
|
Fog::Storage.new(
|
6
17
|
provider: 'AWS',
|
7
18
|
aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
|
@@ -9,5 +20,9 @@ module Pansophy
|
|
9
20
|
region: ENV['AWS_REGION']
|
10
21
|
)
|
11
22
|
end
|
23
|
+
|
24
|
+
def self.iam_profile_fog
|
25
|
+
Fog::Storage.new provider: 'AWS', use_iam_profile: true
|
26
|
+
end
|
12
27
|
end
|
13
28
|
end
|
data/lib/pansophy/version.rb
CHANGED
data/pansophy.gemspec
CHANGED
@@ -21,13 +21,11 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.required_ruby_version = '>= 2.
|
24
|
+
spec.required_ruby_version = '>= 2.6'
|
25
25
|
|
26
|
-
spec.add_dependency 'fog-aws'
|
26
|
+
spec.add_dependency 'fog-aws', '>= 2', '< 4'
|
27
27
|
spec.add_dependency 'mime-types'
|
28
|
-
spec.add_dependency 'anima'
|
29
28
|
spec.add_dependency 'adamantium'
|
30
|
-
spec.add_dependency 'facets'
|
31
29
|
|
32
30
|
spec.add_development_dependency 'bundler'
|
33
31
|
spec.add_development_dependency 'rake'
|
@@ -37,5 +35,5 @@ Gem::Specification.new do |spec|
|
|
37
35
|
spec.add_development_dependency 'simplecov-rcov'
|
38
36
|
spec.add_development_dependency 'coveralls'
|
39
37
|
spec.add_development_dependency 'rubocop'
|
40
|
-
spec.add_development_dependency '
|
38
|
+
spec.add_development_dependency 'pry-byebug'
|
41
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pansophy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Berardi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-aws
|
@@ -16,44 +16,22 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
19
|
+
version: '2'
|
20
|
+
- - "<"
|
25
21
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: mime-types
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
22
|
+
version: '4'
|
34
23
|
type: :runtime
|
35
24
|
prerelease: false
|
36
25
|
version_requirements: !ruby/object:Gem::Requirement
|
37
26
|
requirements:
|
38
27
|
- - ">="
|
39
28
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
41
|
-
-
|
42
|
-
name: anima
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
29
|
+
version: '2'
|
30
|
+
- - "<"
|
53
31
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
32
|
+
version: '4'
|
55
33
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
34
|
+
name: mime-types
|
57
35
|
requirement: !ruby/object:Gem::Requirement
|
58
36
|
requirements:
|
59
37
|
- - ">="
|
@@ -67,7 +45,7 @@ dependencies:
|
|
67
45
|
- !ruby/object:Gem::Version
|
68
46
|
version: '0'
|
69
47
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
48
|
+
name: adamantium
|
71
49
|
requirement: !ruby/object:Gem::Requirement
|
72
50
|
requirements:
|
73
51
|
- - ">="
|
@@ -193,7 +171,7 @@ dependencies:
|
|
193
171
|
- !ruby/object:Gem::Version
|
194
172
|
version: '0'
|
195
173
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
174
|
+
name: pry-byebug
|
197
175
|
requirement: !ruby/object:Gem::Requirement
|
198
176
|
requirements:
|
199
177
|
- - ">="
|
@@ -214,11 +192,13 @@ executables: []
|
|
214
192
|
extensions: []
|
215
193
|
extra_rdoc_files: []
|
216
194
|
files:
|
195
|
+
- ".github/dependabot.yml"
|
196
|
+
- ".github/workflows/release.yml"
|
197
|
+
- ".github/workflows/ruby.yml"
|
217
198
|
- ".gitignore"
|
218
199
|
- ".rspec"
|
219
200
|
- ".rubocop.yml"
|
220
201
|
- ".ruby-version"
|
221
|
-
- ".travis.yml"
|
222
202
|
- CHANGELOG.md
|
223
203
|
- CODE_OF_CONDUCT.md
|
224
204
|
- Gemfile
|
@@ -261,15 +241,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
261
241
|
requirements:
|
262
242
|
- - ">="
|
263
243
|
- !ruby/object:Gem::Version
|
264
|
-
version: '2.
|
244
|
+
version: '2.6'
|
265
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
266
246
|
requirements:
|
267
247
|
- - ">="
|
268
248
|
- !ruby/object:Gem::Version
|
269
249
|
version: '0'
|
270
250
|
requirements: []
|
271
|
-
|
272
|
-
rubygems_version: 2.6.12
|
251
|
+
rubygems_version: 3.2.3
|
273
252
|
signing_key:
|
274
253
|
specification_version: 4
|
275
254
|
summary: Information sharing via centralised repository
|
data/.travis.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.1
|
4
|
-
- 2.2
|
5
|
-
- 2.3.0 # The version of RVM installed on Travis doesn't yet recognise 2.3 as an alias of 2.3.0
|
6
|
-
notifications:
|
7
|
-
email:
|
8
|
-
- support@travellink.com.au
|
9
|
-
flowdock:
|
10
|
-
secure: JUt4oMDS2rrSOzfb1VIDBBgl3Vox97PXAVc0mKjy8zvOQmTsfsGF6Eum85inEThjavm+WRmKffX66MjSSZ6wDWpaAmELh7LihQszJNhHejSfkSFJIc1v0AtrEoDpWEkh4bboO8eFMn+7Xw6ESZAzzK7k9791U9cuGShkFSnN76w=
|
11
|
-
sudo: false
|
12
|
-
cache: bundler
|