New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate a machine level certificate file that could be used later #6

Merged
merged 2 commits into from Nov 9, 2015

Conversation

Projects
None yet
4 participants
@brentm5
Member

brentm5 commented Nov 6, 2015

This change to use the machine level cert will be a breaking change for
any existing tentacles

@jonathanmorley

View changes

libraries/shared.rb Outdated
def actions_updated?(actions)
actions.each do |action|
return true if action.updated_by_last_action?

This comment has been minimized.

@jonathanmorley

jonathanmorley Nov 9, 2015

def actions_updated?(actions)
  actions.any? do |action|
    action.updated_by_last_action?
  end
end

This comment has been minimized.

@brentm5

brentm5 Nov 9, 2015

Member

thanks to @drapergeek going with this

actions.any?(&:updated_by_last_action?)
@drapergeek

View changes

providers/tentacle.rb Outdated
@@ -71,16 +72,30 @@
version version
end
configure = batch "configure-tentacle-#{instance}" do
generate_cert = powershell_script 'generate-tentacle-cert' do
cwd 'C:\Program Files\Octopus Deploy\Tentacle'

This comment has been minimized.

@drapergeek

drapergeek Nov 9, 2015

What do you think about using a constant here or making this configureable?

This comment has been minimized.

@brentm5

brentm5 Nov 9, 2015

Member

Done.

Generate a machine level certificate file that could be used later
This change to use the machine level cert will be a breaking change for
any existing tentacles, bump version as well.
end
instance = tentacle['instance']
config_path = tentacle['config_path']

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

source 'cert.txt'
end
instance = tentacle['instance']

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

cert_file = 'C:\tentacle_cert.txt'
cookbook_file cert_file do
action :create
source 'cert.txt'

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

octopus_deploy_tentacle 'Tentacle' do
action :install
version tentacle['version']
checksum tentacle['checksum']

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

# Install it here
octopus_deploy_tentacle 'Tentacle' do
action :install
version tentacle['version']

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

end
# Install it here
octopus_deploy_tentacle 'Tentacle' do

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

# Just make sure its not installed already
octopus_deploy_tentacle 'Tentacle' do
action :remove
version node['verify-octo']['tentacle']['version']
version tentacle['version']

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -18,10 +18,39 @@
# limitations under the License.
#
tentacle = node['verify-octo']['tentacle']

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

cwd 'C:\Program Files\Octopus Deploy\Tentacle'
code <<-EOH
.\\Tentacle.exe create-instance --instance="#{instance}" --config="#{config_path}" --console
.\\Tentacle.exe import-certificate --instance="#{instance}" -f #{cert_file} --console

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Line is too long. [89/80]

powershell_script "mock-configure-tentacle-#{instance}" do
cwd 'C:\Program Files\Octopus Deploy\Tentacle'
code <<-EOH
.\\Tentacle.exe create-instance --instance="#{instance}" --config="#{config_path}" --console

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Line is too long. [96/80]

@@ -25,3 +25,5 @@
# Tentacle test configuration
default['verify-octo']['tentacle']['version'] = '3.1.3'
default['verify-octo']['tentacle']['checksum'] = 'c5b4cd6ceec977137d93711ca0ede1dde79ae30da277d70e8d70e6d148860bec'
default['verify-octo']['tentacle']['instance'] = 'Tentacle'

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -25,3 +25,5 @@
# Tentacle test configuration
default['verify-octo']['tentacle']['version'] = '3.1.3'
default['verify-octo']['tentacle']['checksum'] = 'c5b4cd6ceec977137d93711ca0ede1dde79ae30da277d70e8d70e6d148860bec'
default['verify-octo']['tentacle']['instance'] = 'Tentacle'
default['verify-octo']['tentacle']['config_path'] = 'C:\\Octopus\\Tentacle.config'

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Line is too long. [82/80]
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -71,16 +72,30 @@
version version
end
configure = batch "configure-tentacle-#{instance}" do
generate_cert = powershell_script 'generate-tentacle-cert' do

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -91,7 +106,7 @@
subscribes :restart, "batch[configure-tentacle-#{instance}]", :delayed
end
new_resource.updated_by_last_action(install.updated_by_last_action? || configure.updated_by_last_action? || service.updated_by_last_action?)
new_resource.updated_by_last_action(actions_updated?([install, generate_cert, configure, service]))

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Line is too long. [101/80]

@@ -6,7 +6,7 @@
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
source_url 'https://github.com/cvent/octopus-deploy-cookbook'
issues_url 'https://github.com/cvent/octopus-deploy-cookbook/issues'
version '0.4.1'
version '0.4.2'

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

end
def catch_powershell_error(error_text)
"if ( ! $? ) { throw \"ERROR: Command returned $LastExitCode #{error_text}\" }"

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Line is too long. [85/80]

@@ -71,16 +72,30 @@
version version
end
configure = batch "configure-tentacle-#{instance}" do
cwd 'C:\Program Files\Octopus Deploy\Tentacle'
generate_cert = powershell_script 'generate-tentacle-cert' do

This comment has been minimized.

@houndci-bot

houndci-bot Nov 9, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@brentm5 brentm5 merged commit 4882ccc into master Nov 9, 2015

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
hound 17 violations found.

@brentm5 brentm5 deleted the bmontague-make-tentacle-installs-better branch Nov 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment