dk-abdeploy 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/Gemfile +5 -0
- data/LICENSE +22 -0
- data/README.md +48 -0
- data/dk-abdeploy.gemspec +23 -0
- data/lib/dk-abdeploy.rb +5 -0
- data/lib/dk-abdeploy/version.rb +4 -0
- data/log/.gitkeep +0 -0
- data/test/helper.rb +19 -0
- data/test/support/factory.rb +6 -0
- metadata +75 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA512:
|
3
|
+
data.tar.gz: e68d988dd930229c983f361d1cd75ef9c7addd22029082bdf4c9535e1790b7eb05e4ca9ef6fc72a3b6cace056bd4a2ead6c9ac4319acb02d30e7fe880efb96b2
|
4
|
+
metadata.gz: 4b68931c278d1b5d7cefc95c7ddec5b816237432733e4f4fd712f27439e1e6d7a21b042aa8600db653f69bfc5624211afcbb603e7f5ee6576b5680e0c38ca6af
|
5
|
+
SHA1:
|
6
|
+
data.tar.gz: 95fa2def0135c8e828f944c2a1f796df7fe9eb92
|
7
|
+
metadata.gz: 151800353f028be1d8d7f8a4988248586eed4d0a
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2016-Present Kelly Redding and Collin Redding
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Dk::ABDeploy
|
2
|
+
|
3
|
+
[Dk](https://github.com/redding/dk) tasks that implement the A/B deploy pattern.
|
4
|
+
|
5
|
+
## Deploy scheme design
|
6
|
+
|
7
|
+
Two release dirs, A and B, each have a clone of the app's git repo. On deploy, whichever release dir is not current is fetched and reset to the deploy commit. After the source is updated and ready, the current pointer is updated to the new release dir.
|
8
|
+
|
9
|
+
This allows for the current running processes to remain running against the previous source while the new source is updated, migrated, built, etc. Once the new source is ready, the point is updated and everything can be restarted.
|
10
|
+
|
11
|
+
This has a few advantages over a more tradition Cap deploy (for example):
|
12
|
+
|
13
|
+
* This removes the need to copy the entire source tree after a single common repo has been updated.
|
14
|
+
* There is no need to calculate release dir names with dates/etc and manage them (ie clean out previous old release dirs)
|
15
|
+
* This works will with branch deploys as there is no need for any complex rollback logic - just deploy a previous commit to rollback.
|
16
|
+
* You retain all the benefits of a current pointer that is set to the previous deploy source while the new source is being built/setup.
|
17
|
+
|
18
|
+
## Usage
|
19
|
+
|
20
|
+
TODO: Write code samples and usage instructions here
|
21
|
+
|
22
|
+
## Notes
|
23
|
+
|
24
|
+
The scope of the tasks provided here are fairly limited. This makes no assumptions about your app ie. whether it is Rails or not, whether it is a web app or not, what subdirs it has, etc. This just covers the basics of setting up the pattern, updating the source and resetting the current pointer. That's it.
|
25
|
+
|
26
|
+
Layer these tasks as callbacks in your app's specific deploy scheme and do all app-specific logic in those tasks.
|
27
|
+
|
28
|
+
## Installation
|
29
|
+
|
30
|
+
Add this line to your application's Gemfile:
|
31
|
+
|
32
|
+
gem 'dk-abdeploy'
|
33
|
+
|
34
|
+
And then execute:
|
35
|
+
|
36
|
+
$ bundle
|
37
|
+
|
38
|
+
Or install it yourself as:
|
39
|
+
|
40
|
+
$ gem install dk-abdeploy
|
41
|
+
|
42
|
+
## Contributing
|
43
|
+
|
44
|
+
1. Fork it
|
45
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
46
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
47
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
48
|
+
5. Create new Pull Request
|
data/dk-abdeploy.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "dk-abdeploy/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "dk-abdeploy"
|
8
|
+
gem.version = Dk::ABDeploy::VERSION
|
9
|
+
gem.authors = ["Kelly Redding", "Collin Redding"]
|
10
|
+
gem.email = ["kelly@kellyredding.com", "collin.redding@me.com"]
|
11
|
+
gem.summary = "Dk tasks that implement the A/B deploy pattern"
|
12
|
+
gem.description = "Dk tasks that implement the A/B deploy pattern"
|
13
|
+
gem.homepage = "https://github.com/redding/dk-abdeploy"
|
14
|
+
gem.license = 'MIT'
|
15
|
+
|
16
|
+
gem.files = `git ls-files`.split($/)
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
+
gem.require_paths = ["lib"]
|
20
|
+
|
21
|
+
gem.add_development_dependency("assert", ["~> 2.16.1"])
|
22
|
+
|
23
|
+
end
|
data/lib/dk-abdeploy.rb
ADDED
data/log/.gitkeep
ADDED
File without changes
|
data/test/helper.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# this file is automatically required when you run `assert`
|
2
|
+
# put any test helpers here
|
3
|
+
|
4
|
+
# add the root dir to the load path
|
5
|
+
$LOAD_PATH.unshift(File.expand_path("../..", __FILE__))
|
6
|
+
|
7
|
+
# require pry for debugging (`binding.pry`)
|
8
|
+
require 'pry'
|
9
|
+
|
10
|
+
require 'test/support/factory'
|
11
|
+
|
12
|
+
# 1.8.7 backfills
|
13
|
+
|
14
|
+
# Array#sample
|
15
|
+
if !(a = Array.new).respond_to?(:sample) && a.respond_to?(:choice)
|
16
|
+
class Array
|
17
|
+
alias_method :sample, :choice
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dk-abdeploy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kelly Redding
|
8
|
+
- Collin Redding
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2016-07-12 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: assert
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 2.16.1
|
23
|
+
type: :development
|
24
|
+
version_requirements: *id001
|
25
|
+
description: Dk tasks that implement the A/B deploy pattern
|
26
|
+
email:
|
27
|
+
- kelly@kellyredding.com
|
28
|
+
- collin.redding@me.com
|
29
|
+
executables: []
|
30
|
+
|
31
|
+
extensions: []
|
32
|
+
|
33
|
+
extra_rdoc_files: []
|
34
|
+
|
35
|
+
files:
|
36
|
+
- .gitignore
|
37
|
+
- Gemfile
|
38
|
+
- LICENSE
|
39
|
+
- README.md
|
40
|
+
- dk-abdeploy.gemspec
|
41
|
+
- lib/dk-abdeploy.rb
|
42
|
+
- lib/dk-abdeploy/version.rb
|
43
|
+
- log/.gitkeep
|
44
|
+
- test/helper.rb
|
45
|
+
- test/support/factory.rb
|
46
|
+
- tmp/.gitkeep
|
47
|
+
homepage: https://github.com/redding/dk-abdeploy
|
48
|
+
licenses:
|
49
|
+
- MIT
|
50
|
+
metadata: {}
|
51
|
+
|
52
|
+
post_install_message:
|
53
|
+
rdoc_options: []
|
54
|
+
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- &id002
|
60
|
+
- ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: "0"
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- *id002
|
66
|
+
requirements: []
|
67
|
+
|
68
|
+
rubyforge_project:
|
69
|
+
rubygems_version: 2.6.4
|
70
|
+
signing_key:
|
71
|
+
specification_version: 4
|
72
|
+
summary: Dk tasks that implement the A/B deploy pattern
|
73
|
+
test_files:
|
74
|
+
- test/helper.rb
|
75
|
+
- test/support/factory.rb
|