1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00
Commit graph

35 commits

Author SHA1 Message Date
seenmyfate
7eb7ca0124 Ensure release_path returns the correct value
`release_path` will now return the value of `current_path` by default.

Tasks that create a new release (i.e. `deploy`) now explicitly over-ride this
default with a new release path.  This change allows tasks that run in both
deploy and non-deploy contexts to use `release_path` to target the latest
 release when run in isolation, and the new release (before it is `current`)
when run as part of a deploy.
2013-08-10 19:31:03 +01:00
seenmyfate
4718a0cb16 Implement lock feature
Ensure a Capistrano version by including a `lock` directive in your
Capfile:

  lock '~> 3.0.0'

An error will be raised if the loaded version of Capistrano does not
meet the dependency specified.
2013-08-02 18:04:16 +01:00
seenmyfate
b463deb6d8 Add sudo dsl method
Example usage:

    on roles :all do
      sudo :mkdir, '-pv', shared_path, releases_path
    end
2013-08-02 10:58:48 +01:00
Rafał Lisowski
e49733f3ef user can provide global ssh settings
for example in deploy.rb:

      {
         keys: %w(/home/user/.ssh/id_rsa),
         forward_agent: false,
         auth_methods: %w(publickey password)
      }
2013-07-11 17:38:55 +02:00
Rafał Lisowski
391468e239 ssh_options
allow user set ssh_options per server
2013-07-11 12:33:26 +02:00
Lee Hambley
e0ad948a20 Try and rename the app in the OptParser banner. 2013-06-14 16:47:42 +02:00
seenmyfate
50e27d8906 allow setting of Configuration backend 2013-06-14 14:35:26 +01:00
seenmyfate
5d2fb93ecc Support setting of SSHKit::Host variables
Variables passed to the `server` or `role` syntax are correctly
assigned on the SSHKit::Host instance:

    server 'example1.com', roles: %w{web app}, user: 'tomc', port: 2222
    server 'example2.com', roles: %w{web app}, keys: '~/.ssh/key'

Expect this to close issue #384
2013-06-14 10:31:34 +01:00
Lee Hambley
046115272f --version Prints Both Cap and Rake versions.
Small modification, shows a proof of concept on how we can enable other
top-level command line flags by interacting with Rake (they could make this
easier, to be honest).

Two pending tests for a `--trace` option and a `--format` option, I'm not
fixed on these names, but the notion stands.
2013-06-13 16:12:10 +02:00
seenmyfate
dbbf6d4b03 Add integration tests for DSL
These tests now document how to use the Capistrano DSL to set and fetch
hosts and variables using both `role` and `server` syntax
2013-06-02 12:30:11 +01:00
seenmyfate
cdf3b708de Provide custom Properties object for Server
This resolves an issue with undefined property accessors passing back from
Openstruct to the DSL
2013-06-02 10:29:26 +01:00
seenmyfate
d546c9c1bf correctly scope error message translation 2013-06-02 08:49:55 +01:00
seenmyfate
e9494a9e2f Fixup role implementation with correct API
Support filtering of roles

        # config/deploy/stage.rb
        server 'example1.com', roles: %w{web app db}, active: :true
        server 'example2.com', roles: %w{web app db}

        on :app, filter: :active do
          # do things on just example1.com
        end
2013-06-02 08:44:46 +01:00
seenmyfate
d400b5db68 Support filtering of roles
# config/deploy/stage.rb
    server 'example1.com', roles: %w{web app db}, active: :true
    server 'example2.com', roles: %w{web app db}

    on :app, filter: { active: true } do
      # do things on just example1.com
    end
2013-05-31 17:35:25 +01:00
seenmyfate
9e3cea4d87 refactor property setting, host adding 2013-05-31 13:27:08 +01:00
Lee Hambley
4d82cf5b1a Fix tests for a problem occuring with a specific test order. 2013-05-28 16:23:47 +02:00
Lee Hambley
c344bc40b2 Enable filtering server list when querying.
This patch makes it possible to do something like:

    server 'example.com', some_property: true
    on(:all, filter: :some_property) do |h|
      # ...
    end

This is the shorthand syntax which checks the host properties for anything
truthy matching the key name given. Symbols and strings are supported here.

If a more complex match should be made, then a continuation can be given in
the place of the smybol:

    server 'example.com', some_property: true
    on(:all, filter: lambda { |h| h.properties.some_property }) do |h|
      # ...
    end

The keys `filter` and `select` are aliases of one another. Either may be used
interchangably.

An execption is raised if the filter removes all matching servers.
2013-05-28 12:43:05 +02:00
Lee Hambley
a236b7f8ef Improve selection of primary host for a role.
Prior to this commit the "primary" server in each role was considered to be
the first one defined. This commit extends the behaviour of primary selection
to look to see if any of the hosts have the `primary` property set to a truthy
value.

In case that more than one server has a truthy `primary` property the first
one is taken as previously.

In order to set the primary property the extended `server()` syntax (that is
not `role()`) must be used, see b56206e.
2013-05-28 12:20:35 +02:00
Lee Hambley
8276aeeaac Format for module style 2013-05-28 12:15:18 +02:00
Lee Hambley
b56206e9ce Implement extended server syntax.
This syntax allows servers to be specified long-hand including properties.

The `role(:my_role, %w{example.com, example.org})` is convenient for batch
set-up of servers; but as SSHKit provides arbirtary properties on servers, it
might be handy to set up servers in long hand:

    server('example.com', roles: :my_role, my_property: "my_value")
    server('example.com', roles: [:my_role, :another], my_property: "my_value")
    server('example.com', roles: :my_role, primary: true)

This commit adds the ability to do this.
2013-05-28 12:10:21 +02:00
seenmyfate
a5d80aa3aa Correct matching of servers when adding new roles 2013-05-24 10:51:20 +01:00
seenmyfate
f18c2265a4 cleaing up server changes 2013-04-30 19:04:52 +01:00
seenmyfate
286f94c29b fix failing spec following change from Roles to Servers 2013-04-28 19:06:19 +01:00
seenmyfate
fe10a84418 Allow each server to have a set of roles
This closes issue #429
2013-04-28 19:00:52 +01:00
seenmyfate
033bf8ee49 set defaults in a single place, call as part of setup task 2013-03-22 11:25:26 +00:00
seenmyfate
a3acea451b add uncommitted specs 2013-03-22 10:40:37 +00:00
seenmyfate
fe00aa856a refactor linked file/directories dsl 2013-03-19 09:48:09 +00:00
seenmyfate
e55dbd70e1 clean up, prefer roles :all over all_roles 2013-03-17 18:19:46 +00:00
seenmyfate
21f24f244a allow set to take a proc 2013-03-15 13:51:06 +00:00
seenmyfate
8c1ede50cd Support ask
As an alternative to `set`, `ask` takes a key and a default value. When
the key is called with `fetch` the user will be prompted to set the
value.
2013-03-15 11:35:49 +00:00
seenmyfate
454f46b829 better encapsulate configuration, support current format 2013-03-10 20:44:50 +00:00
seenmyfate
5e4fe624b5 reduce dsl, prefer fetch/set 2013-03-03 16:27:33 +00:00
seenmyfate
725c47d35b reduce dsl, prefer fetch/set 2013-03-03 16:18:48 +00:00
seenmyfate
de6367af4e Add default tasks, handle configuration 2013-02-01 17:19:00 +00:00
seenmyfate
687526930a installation - running cap install capifies app 2013-02-01 14:51:50 +00:00