capistrano-shared_configs 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2ec62c51cf16354a8ef1a2aa22682289c27a26d2
4
+ data.tar.gz: e917dcfe540ebed1ad684ed43ab3ae8d2cd231ac
5
+ SHA512:
6
+ metadata.gz: 3f80520020362bd822d7bf913d6350f89c40d0f74a320ecbf1ab5cac80c1325e019ba2dba3fdead6acf5e224cce25e4c942f7f3fafe6cb9b825843e08d86b4b1
7
+ data.tar.gz: d0b49e3970d70cc60df929e778b8c99d9a880c1ed84a2cde4d49b42f979a9ae7597e54c282ef83fef608febf4aca3c1e4d2029d008df4b5cecedf79884465450
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-shared_configs.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2016 The Board of Trustees of the Leland Stanford Junior University
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # Capistrano::SharedConfigs
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/capistrano/shared_configs`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'capistrano-shared_configs'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install capistrano-shared_configs
22
+
23
+ ## Usage
24
+
25
+ The tasks can be made available to your capistrano deploy environments by requiring `capistrano/shared_configs` in your `Capfile`.
26
+
27
+ The three tasks made available to you are
28
+
29
+ ```
30
+ cap shared_configs:pull
31
+ cap shared_configs:symlink
32
+ cap shared_configs:update
33
+ ```
34
+
35
+ `shared_configs:update` simply calls `pull` and then `symlink` and is intended to provide a simple single command.
36
+
37
+ This can be added into your deployment workflow to automatically pull and symlink shared configs into your capistrano shared directories, or alternatively just run manually from the command line.
38
+
39
+ ## Development
40
+
41
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
42
+
43
+ To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
44
+
45
+ ## Contributing
46
+
47
+ Bug reports and pull requests are welcome on GitHub at https://github.com/jkeck/capistrano-shared_configs.
48
+
49
+
50
+ ## License
51
+
52
+ The gem is available as open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/apache-2.0).
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "capistrano/shared_configs"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/shared_configs/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capistrano-shared_configs"
8
+ spec.version = Capistrano::SharedConfigs::VERSION
9
+ spec.authors = ["Jessie Keck"]
10
+ spec.email = ["jessie.keck@gmail.com"]
11
+
12
+ spec.summary = %q{A simple capistrano extension that provides tasks to manage DLSS Shared Configs.}
13
+ spec.description = %q{This gem provides capistrano tasks to pull the latest configs from the shared configs branch and update the symlinks in the shared directory.}
14
+ spec.homepage = "https://github.com/jkeck/capistrano-shared_configs"
15
+ spec.license = "APACHE2"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.11"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ end
@@ -0,0 +1,8 @@
1
+ require 'capistrano/shared_configs/version'
2
+
3
+ module Capistrano
4
+ module SharedConfigs
5
+ end
6
+ end
7
+
8
+ load File.expand_path('../tasks/shared_configs.rake', __FILE__)
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module SharedConfigs
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,34 @@
1
+ def within_repo_configs_path(&block)
2
+ repo_config_path = Pathname.new("#{shared_path}/repo_configs")
3
+ on roles(:app) do
4
+ if test("[ -d #{repo_config_path} ]")
5
+ within repo_config_path do
6
+ yield block
7
+ end
8
+ else
9
+ puts "No shared configs located at #{repo_config_path}"
10
+ end
11
+ end
12
+ end
13
+
14
+ namespace :shared_configs do
15
+ desc 'Pull the latest from the shared configs directory and symlink the files'
16
+ task :update do
17
+ invoke 'shared_configs:pull'
18
+ invoke 'shared_configs:symlink'
19
+ end
20
+
21
+ desc 'Pulls the latest from the shared configs directory'
22
+ task :pull do
23
+ within_repo_configs_path do
24
+ execute 'git pull'
25
+ end
26
+ end
27
+
28
+ desc 'Symlinks the shared configs directory into the capistrano shared directory'
29
+ task :symlink do
30
+ within_repo_configs_path do
31
+ execute 'cp -rlf * ../'
32
+ end
33
+ end
34
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-shared_configs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jessie Keck
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-09-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: This gem provides capistrano tasks to pull the latest configs from the
42
+ shared configs branch and update the symlinks in the shared directory.
43
+ email:
44
+ - jessie.keck@gmail.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - bin/console
55
+ - bin/setup
56
+ - capistrano-shared_configs.gemspec
57
+ - lib/capistrano/shared_configs.rb
58
+ - lib/capistrano/shared_configs/version.rb
59
+ - lib/capistrano/tasks/shared_configs.rake
60
+ homepage: https://github.com/jkeck/capistrano-shared_configs
61
+ licenses:
62
+ - APACHE2
63
+ metadata: {}
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 2.5.1
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: A simple capistrano extension that provides tasks to manage DLSS Shared Configs.
84
+ test_files: []