salesforce-deploy-tool 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d1af109d666537da0e15589c205d835f605417a
4
- data.tar.gz: 46795a2090f578485e0936efe6c3073df707b7f6
3
+ metadata.gz: 262d3cc878de138736ef7fda3f76a791609bac29
4
+ data.tar.gz: e28bb6c55dd1c956b504079fe68e59757df3f514
5
5
  SHA512:
6
- metadata.gz: 561a905232f77340c2b484b2b58e27bf3c03885f6631722adacfd88c164cc405496d3a99cec31d520567a19033b9659e06d6de116b7c9a2cbfb7924ad0ba65f2
7
- data.tar.gz: a5ec87474a1ed88ea09802993cc4f52f9f7abad0e5224eacdf5dbdcc10ef4e6a5f2ce2255e6c5da7b23e7c84f1dd78a3591627cb1cedcc8d1ae5362b46ae2558
6
+ metadata.gz: e622d1cea87188f8c9694f14f831920a4a266c3abf2feccecf4d8a319b8680ef1af209515fff2cc3d05ef7cd0449594f32bf38d1b39e0178536269c6034a4ee3
7
+ data.tar.gz: b0ddbd4ac59fde005395daba5dd1b4345302bee1379a8e28b661d8c286030cf59d479b20f076880e845500771063635ec16f85a4af4d37f0bfec90c1e8ba4b61
data/bin/{sfd → sf} RENAMED
@@ -27,11 +27,11 @@ end
27
27
  require 'salesforcedeploytool'
28
28
 
29
29
  program :version, SalesforceDeployTool::VERSION
30
- program :description, 'A cli tool to help manage and deploy salesforce environments with git'
30
+ program :description, 'A cli tool to help manage and deploy salesforce sandboxes with git'
31
31
 
32
32
  command :init do |c|
33
33
  c.syntax = 'sf init [options]'
34
- c.summary = 'Initialize salesforce environment from git'
34
+ c.summary = 'Initialize salesforce sandbox from git'
35
35
  c.description = "Clone the #{config[:git_repo]} to #{config[:git_dir]}"
36
36
  c.example 'usage', 'sf init'
37
37
  c.action do |args, options|
@@ -47,21 +47,24 @@ end
47
47
 
48
48
  command :pull do |c|
49
49
  c.syntax = 'sf pull'
50
- c.summary = 'Pull code from the environment'
51
- c.description = "Pull code from environment and update #{config[:git_dir]}"
50
+ c.summary = 'Pull code from the sandbox'
51
+ c.description = "Pull code from sandbox and update #{config[:git_dir]}"
52
52
  c.example 'usage:', 'sf pull'
53
53
  c.example 'usage:', 'sf pull -c -d'
54
- c.option "--no-clean", "Do not clean the currrent source code before pulling"
54
+ c.option "--no-clean", "-c", "Do not clean the currrent source code before pulling"
55
55
  c.option "--debug", "Verbose output"
56
- c.option "--env NAME", "use 'prod' to deploy production or sandbox name"
56
+ c.option "--sandbox NAME", "-s NAME", "use 'prod' to deploy production or sandbox name"
57
57
  c.action do |args, options|
58
58
 
59
+ options.no_clean = true unless options.c
60
+ options.sandbox = options.s if options.s
61
+
59
62
  # Parameter validation:
60
- if options.env.nil? and sandbox.nil?
61
- puts "error: please specify the environment to pull from using --env"
63
+ if options.sandbox.nil? and sandbox.nil?
64
+ puts "error: please specify the sandbox to pull from using --sandbox"
62
65
  exit 1
63
66
  end
64
- config[:env] = options.env || sandbox
67
+ config[:sandbox] = options.sandbox || sandbox
65
68
  config[:debug] = options.debug.nil? ? false : true
66
69
 
67
70
  # Initialize
@@ -71,31 +74,35 @@ command :pull do |c|
71
74
  sfdt.clean_git_dir unless options.no_clean
72
75
 
73
76
  # Pull the changes
74
- sfdt.pull "INFO: Pulling changes from #{config[:env]} "
77
+ sfdt.pull "INFO: Pulling changes from #{config[:sandbox]} "
75
78
 
76
79
  end
77
80
 
78
81
  end
79
82
 
80
-
81
83
  command :push do |c|
82
84
  c.syntax = 'sf push [options]'
83
85
  c.summary = 'Push code into a sandbox'
84
86
  c.description = ''
85
87
  c.example 'description', "Push the code that is located into #{config[:git_dir]} into the active sandbox"
86
- c.option "--env NAME", "use 'prod' to deploy production or sandbox name"
88
+ c.option "--sandbox NAME", "-s NAME", "use 'prod' to deploy production or sandbox name"
87
89
  c.option "--debug", "Verbose output"
88
- c.option "--test", "Deploy and test"
89
- c.option "--exclude LIST", "a CSV list of metadata to exclude when creating destructiveChange.xml"
90
+ c.option "--test", "-T", "Deploy and test"
91
+ c.option "--exclude LIST", "-x LIST", "a CSV list of metadata to exclude when creating destructiveChange.xml"
90
92
  c.option "--append", "Disable destructive change and do an append deploy"
91
93
  c.action do |args, options|
92
94
 
95
+ # short flag for test, so that not conflicts with trace
96
+ options.test = true if options.T
97
+ options.exclude = options.x if options.x
98
+ options.sandbox = options.s if options.s
99
+
93
100
  # Parameter validation:
94
- if options.env.nil? and sandbox.nil?
95
- puts "error: please specify the environment to pull from using --env"
101
+ if options.sandbox.nil? and sandbox.nil?
102
+ puts "error: please specify the sandbox to pull from using --sandbox"
96
103
  exit 1
97
104
  end
98
- config[:env] = options.env || sandbox
105
+ config[:sandbox] = options.sandbox || sandbox
99
106
  config[:debug] = options.debug.nil? ? false : true
100
107
  config[:test] = options.test.nil? ? false : true
101
108
 
@@ -110,7 +117,7 @@ command :push do |c|
110
117
  sfdt_tmp = SalesforceDeployTool::App.new config_tmp
111
118
  sfdt_tmp.clone
112
119
  sfdt_tmp.clean_git_dir
113
- sfdt_tmp.pull "INFO: Pulling changes from #{config[:env]} to temporary directory #{config[:tmp_dir]} to generate destructiveChanges.xml "
120
+ sfdt_tmp.pull "INFO: Pulling changes from #{config[:sandbox]} to temporary directory #{config[:tmp_dir]} to generate destructiveChanges.xml "
114
121
 
115
122
  # Create destructiveChanges.xml
116
123
  puts "INFO: Creating destructive changes xml"
@@ -136,7 +143,7 @@ end
136
143
 
137
144
  command :sandbox do |c|
138
145
  c.syntax = 'sf sandbox SANDBOX_NAME'
139
- c.summary = 'Set sandbox to work on, this will override --env '
146
+ c.summary = 'Set sandbox to work on, this will override --sandbox '
140
147
  c.description = 'Set the sandbox to work with pull and push. If no parameter defined, it will print the current sandbox selected.'
141
148
  c.action do |args, options|
142
149
 
@@ -6,13 +6,13 @@ module SalesforceDeployTool
6
6
 
7
7
  @git_repo = config[:git_repo]
8
8
  @git_dir = config[:git_dir]
9
- @env = config[:env]
10
- @username = @env == 'prod' ? config[:username] : config[:username] + '.' + @env
9
+ @sandbox = config[:sandbox]
10
+ @username = @sandbox == 'prod' ? config[:username] : config[:username] + '.' + @sandbox
11
11
  @password = config[:password]
12
12
  @debug = config[:debug]
13
13
  @test = config[:test]
14
14
 
15
- @server_url = @env == 'prod' ? 'https://login.salesforce.com' : 'https://test.salesforce.com'
15
+ @server_url = @sandbox == 'prod' ? 'https://login.salesforce.com' : 'https://test.salesforce.com'
16
16
 
17
17
  self.clone if ! Dir.exists? File.join(@git_dir,'.git')
18
18
 
@@ -100,7 +100,7 @@ module SalesforceDeployTool
100
100
  end
101
101
 
102
102
  # Deploy code
103
- exec_options[:message] = @test ? "INFO: Deploying and Testing code to #{@env}: " : "INFO: Deploying code to #{@env}: "
103
+ exec_options[:message] = @test ? "INFO: Deploying and Testing code to #{@sandbox}: " : "INFO: Deploying code to #{@sandbox}: "
104
104
  exec_options[:message] += "\n\n" if @debug
105
105
 
106
106
  cmd = @test ? " ant deployAndTestCode" : " ant deployCode"
@@ -1,3 +1,3 @@
1
1
  module SalesforceDeployTool
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforce-deploy-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Breinlinger
@@ -98,7 +98,7 @@ description: ''
98
98
  email:
99
99
  - "<juan.brein@breins.net>"
100
100
  executables:
101
- - sfd
101
+ - sf
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
@@ -107,7 +107,7 @@ files:
107
107
  - LICENSE.txt
108
108
  - README.md
109
109
  - Rakefile
110
- - bin/sfd
110
+ - bin/sf
111
111
  - lib/salesforcedeploytool.rb
112
112
  - lib/salesforcedeploytool/app.rb
113
113
  - lib/salesforcedeploytool/functions.rb