acquia_toolbelt 1.1.0 → 1.2.0

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
- YTIzNDE0ZDYwY2IzODBlMGY5NzcxZmRiYmIwY2YzMGVmZTVjOTdiYg==
4
+ NzkwNGEyMjZlNGVjYTk1M2VlNjI0Y2QxNTY1ZmVhMTRkNGYyMzc0Ng==
5
5
  data.tar.gz: !binary |-
6
- NzhlNjI2ZDE3ODM5MjZkYWU0ZGQwYTJjN2MxMzBiNjdkOTFkNGIyYw==
6
+ ZmVhNzBhMWRhYjVmNDFjZjBiN2VmMWMxOWQyODdlZDQ2NTA0NTcxNg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MjczMDJiZWRmZDE4NDRkNzQyZTBiNzc5MTI2MWI4N2Q0MDlkMDVjY2VhMmNj
10
- Mjc0YzUwZmMyYWM0ZTNlNmMxOTExNzQwZTgyZWM1ZDUwMDBjNzNhMGZiMDI1
11
- OTcxMzZhZGExNzIwYTcyZTU1YjQ5OTYzZDNlNzEwMzBiMmNjMDY=
9
+ YWVlMDdhYjFmOTEyYTJkOTYzNzNlYTQyNGRiYmYzMDczODYzZDMzNWVmMmY5
10
+ NDE0OTg4ZThmMTg1YzZlNTUzMmE0MWVjODVhYzVkNDc1MDk1OGM5ZDNhMjAw
11
+ OGE2MWFlYjRkNGMyOTQ3YzlkMzU5YzM2Nzc4ZmZjYmYxMWQ2OGY=
12
12
  data.tar.gz: !binary |-
13
- Yzc0YTIxNmMwNzlmMTg1MTA0MzY2ODE3NDY1MTBmNTVmNjYyODQ3MjFlMjQ1
14
- OTgwMDk0MjBmNDk2YzhkMTJjY2Y3Mzk0YmRiNmViMzk4MTIyZDFhMTM0OTYz
15
- MjQyNDVjYTI1MGVjNTgxZjg4YzE0ZjY1Zjc5YWRmNGE1MmQ4NDY=
13
+ MjI3NWQ5YTAwNGRjN2U1ZGU3ZjViZTBiZjNiYjQzMzY2ZDU2ZmJjYmUyZWI5
14
+ ODY3NTdjZjc4OTViNzA2ZjA3YTA2Yzg1YzA4MTU4NTJmMDc1MzgyODA5NjQy
15
+ NjU3YTFiZDk4YjQ2NTAwNWYxYTI0YWY3NDFhNDU0ZGZjYjI3NzA=
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_runtime_dependency "highline", "1.6.19"
24
24
  spec.add_runtime_dependency "faraday", "0.8.8"
25
25
  spec.add_runtime_dependency "json", "1.8.0"
26
+ spec.add_runtime_dependency "rainbow", "1.1.4"
26
27
 
27
28
  spec.add_development_dependency "bundler", "~> 1.3"
28
29
  spec.add_development_dependency "rake"
data/bin/acquia CHANGED
@@ -5,6 +5,7 @@ require "netrc"
5
5
  require "highline/import"
6
6
  require "faraday"
7
7
  require "json"
8
+ require "rainbow"
8
9
 
9
10
  class Acquia < Thor
10
11
  # A no_commands block is designed to show the methods that cannot be invoked
@@ -14,21 +15,21 @@ class Acquia < Thor
14
15
  #
15
16
  # Returns the coloured and formatted string.
16
17
  def success(text)
17
- puts "\e[#32m#{text}\e[0m"
18
+ puts "#{text}".foreground(:green)
18
19
  end
19
20
 
20
21
  # Internal: Used for outputting a pretty error message.
21
22
  #
22
23
  # Returns the coloured and formatted string.
23
24
  def fail(text)
24
- puts "\e[#31m#{text}\e[0m"
25
+ puts "#{text}".foreground(:red)
25
26
  end
26
27
 
27
28
  # Internal: Used for outputting a pretty info message.
28
29
  #
29
30
  # Returns the coloured and formatted string.
30
31
  def info(text)
31
- puts "\e[#36m#{text}\e[0m"
32
+ puts "#{text}".foreground(:cyan)
32
33
  end
33
34
 
34
35
  # Internal: Create a request to the Acquia API.
@@ -375,6 +376,24 @@ class Acquia < Thor
375
376
  end
376
377
  end
377
378
 
379
+ # Public: Add a domain to an environment.
380
+ #
381
+ # Returns a status message on successful addition.
382
+ desc "add-domain <subscription> <environment> <domain>", "Add a domain to an environment."
383
+ def add_domain(subscription, environment, domain)
384
+ add_domain = acquia_api_call "/sites/#{subscription}/envs/#{environment}/domains/#{domain}", "POST"
385
+ success "Domain #{domain} has been successfully added to #{environment}." if add_domain["id"]
386
+ end
387
+
388
+ # Public: Remove a domain from an environment.
389
+ #
390
+ # Returns a status message on successful deletion.
391
+ desc "delete-domain <subscription> <environment> <domain>", "Delete a domain from an environment."
392
+ def delete_domain(subscription, environment, domain)
393
+ delete_domain = acquia_api_call "/sites/#{subscription}/envs/#{environment}/domains/#{domain}", "DELETE"
394
+ success "Domain #{domain} has been successfully deleted from #{environment}." if delete_domain["id"]
395
+ end
396
+
378
397
  # Public: Clear a web cache on a domain.
379
398
  #
380
399
  # Send off a DELETE request to clear the web cache for a particular domain or
@@ -1,3 +1,3 @@
1
1
  module AcquiaToolbelt
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
data/readme.md CHANGED
@@ -23,9 +23,11 @@ $ acquia
23
23
 
24
24
  Commands:
25
25
  acquia add-database <subscription> <database> # Create a new database instance.
26
+ acquia add-domain <subscription> <environment> <domain> # Add a domain to an environment.
26
27
  acquia copy-database <subscription> <database> <source> <destination> # Copy a database one from environment to another.
27
28
  acquia copy-files <subscription> <source> <destination> # Copy files from one environment to another.
28
29
  acquia delete-database <subscription> <database> # Remove all instances of a database.
30
+ acquia delete-domain <subscription> <environment> <domain> # Delete a domain from an environment.
29
31
  acquia delete-svn-user <subscription> <userid> # Delete a SVN user.
30
32
  acquia help [COMMAND] # Describe available commands or one specific command
31
33
  acquia list-database-backups <subscription> <environment> <database> # Get all backups for a database instance.
@@ -37,7 +39,7 @@ Commands:
37
39
  acquia list-subscriptions # Find all subscriptions that you have access to.
38
40
  acquia list-svn-users <subscription> # See all the SVN users on a subscription.
39
41
  acquia login # Login to your Acquia account.
40
- acquia purge-domain <subscription> # Clear the web cache of an environment or domain.
42
+ acquia purge-domain <subscription> <environment> # Clear the web cache of an environment or domain.
41
43
  ```
42
44
 
43
45
  ## Getting started
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acquia_toolbelt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Bednarz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-08 00:00:00.000000000 Z
11
+ date: 2013-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.8.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: rainbow
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 1.1.4
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 1.1.4
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: bundler
85
99
  requirement: !ruby/object:Gem::Requirement