egads 0.0.1 → 0.0.2

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTY5Zjg1MjIxZjgxYmMxN2QwZTBmYjdkYjUwMjBlMjAwNzRlN2EzMg==
4
+ NDFlMTY3OGRkMWMxNzAyYjI3ZWRmYWVlYzA1NTk5NDNhZjFmMWIzYQ==
5
5
  data.tar.gz: !binary |-
6
- MDYyMmIzODJjMzNjY2FiMWRjNzA2OTk0MjA2ZWVmYmJlY2Q5ZjQxMw==
6
+ YmZmNTIyNDkxYzBkYWQ1YjBmNzIyNmYxZGNhMjcxYTJlOGIxMjllYg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NjZjYWJlN2I2M2QyYzIyYzc5MjI4OTY2MWNjZjBkOTJlMDJmODAxYmQ5NTAw
10
- YmYxYmE0OTFjZDcwZDgxYTY2YmM3ZjRkZDk4ZWJjZjBhNTM2ODY1MDhkOTcx
11
- MTNmNTdhYmE3ZDExNGQ3MDdhYTk1MGYxODZkMWE3OTcwYTliZjk=
9
+ YzNhOTAxMTNlOTVjODlmZjkxMGUxZjNiMDViYTIwZTU1ZTBmM2MzMDI4OTZm
10
+ YmI0OTJkMTRmNWQxMTE0YjU5NWE0M2MzNDNlYjRkYWMzYjcyODg1OWU2ZDlk
11
+ ZTYxNTExMjhiMjE4MTRiYjYzN2YxOGMwOThjZTk4ODgyZmQxMTE=
12
12
  data.tar.gz: !binary |-
13
- Mzg5ZDM3MjUxMzk5ZGZhYzc5ZGVjOWM1OWIxNWFkZGUzZTdkZmYxZDZjYmQz
14
- NDU2YjhlMDkwYmEyODdhN2EzMTNmYmVhZTRmMjI5YWYxOGU3OWFiM2VkZjEz
15
- Mjg5ZTlmZjVhZDdkZjU1MjlhODFjMzI3ODE0YzI5Mjc0YzE1ZWI=
13
+ MTdlNjhjYzBlOWI3Mzc5MTJiZGVmYmNhYzdjZGJiNzBmZDY4N2ZkY2EwMDVh
14
+ ZWM4ODM4YmQwOGIwOWNkNjUwMDQ5NGQ2NWZlY2UyOTgzNmUyMDIzNDI4ZDA1
15
+ MTAwYzFiNjk4YTM0ZmQ2MmRmNDdlNWZhMjU4YmVhYjBjOGFjYzM=
data/README.md CHANGED
@@ -5,9 +5,44 @@
5
5
  For local work (building and uploading tarballs), put `egads` in your Gemfile:
6
6
 
7
7
  # In Gemfile
8
- gem 'egads'
8
+ gem 'egads', require: nil
9
9
 
10
10
  On remote machines (to which you deploy), `egads` must be in your PATH.
11
11
  So install `egads` as a system gem:
12
12
 
13
13
  sudo gem install egads
14
+
15
+ ## Commands
16
+
17
+ See `egads -h` for the most robust & up-to-date info. Here's a whirlwind tour.
18
+
19
+ Egads has two types of commands. *Local* commands run on your development machine or continuous integration environment. *Remote* commands run on deployed servers.
20
+
21
+ Commands are either *porcelain* commands that you should call directly as part of a typical workflow; or *plumbing* commands that are invoked by porcelain commands, and rarely invoked directly.
22
+
23
+ ### Local commands
24
+
25
+ * `egads build [SHA]` - makes a deployable tarball of the current commit and upload it to S3 (if missing).
26
+ * `egads upload SHA` - (plumbing, called by `build`) Uploads a pre-built tarball
27
+
28
+ ### Remote commands
29
+
30
+ * `egads stage SHA` - Prepares an extracted tarball for release: runs bundler, copies config files, etc.
31
+ * `egads release SHA` - Symlinks a staged release to current, restarts services
32
+ * `egads extract SHA` - (plumbing, called by `stage`) Downloads and untars a tarball from S3.
33
+ * `egads clean` - (plumbing, called by `release`) Deletes old releases to free space.
34
+
35
+ ## Configuration
36
+
37
+ There are two config files:
38
+
39
+ * `egads.yml` ([example](example/egads.yml)) is in your git repo and tarballs. It has instructions for building, staging, and releasing tarballs.
40
+ * `/etc/egads.yml` ([example](example/egads_remote.yml)) on remote servers has some configuration for downloading and extracting tarballs from S3; and some environment variables that could vary across environments. This file is presumably provisioned by a tool like Chef or Puppet.
41
+
42
+ ## Deploy process
43
+
44
+ The deploy process is:
45
+
46
+ * Run `egads build` from a server with a full git checkout (e.g. your local machine). This ensures there's a tarball for the remote servers to download.
47
+ * Run `egads stage SHA` on all the remote servers to download, extract, and configure the SHA for release.
48
+ * Run `egads release SHA` on all the remote servers to symlink the staged SHA to 'current', and restart services.
@@ -59,6 +59,7 @@ module Egads
59
59
  tarball = S3Tarball.new(sha)
60
60
  if !options[:force] && tarball.exists?
61
61
  say "Tarball for #{sha} already exists. Pass --force to upload again."
62
+ return
62
63
  end
63
64
 
64
65
  path = tarball.local_gzipped_path
@@ -79,7 +80,7 @@ module Egads
79
80
  desc "extract SHA", "[remote, plumbing] Downloads tarball for SHA from S3 and extracts it to the filesystem"
80
81
  method_option :force, type: :boolean, default: false, banner: "Overwrite existing files"
81
82
  def extract(sha)
82
- dir = RemoteConfig.release_dir
83
+ dir = RemoteConfig.release_dir(sha)
83
84
  path = File.join(dir, "#{sha}.tar.gz")
84
85
  tarball = S3Tarball.new(sha, true)
85
86
 
@@ -111,7 +112,7 @@ module Egads
111
112
  method_option :force, type: :boolean, default: false, banner: "Overwrite existing files"
112
113
  def stage(sha)
113
114
  invoke(:extract, [sha], options)
114
- dir = RemoteConfig.release_dir
115
+ dir = RemoteConfig.release_dir(sha)
115
116
  stage_flag_path = File.join(dir, '.egads-stage-success')
116
117
  if options[:force] || !File.exists?(stage_flag_path)
117
118
  inside dir do
@@ -139,7 +140,7 @@ module Egads
139
140
  method_option :force, type: :boolean, default: false, banner: "Overwrite existing files while staging"
140
141
  def release(sha)
141
142
  invoke(:stage, [sha], options)
142
- dir = RemoteConfig.release_dir
143
+ dir = RemoteConfig.release_dir(sha)
143
144
  inside dir do
144
145
  run_hooks_for(:release, :before)
145
146
  end
@@ -1,3 +1,3 @@
1
1
  module Egads
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Suggs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-11 00:00:00.000000000 Z
11
+ date: 2013-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog