Code Monkey home page Code Monkey logo

Comments (5)

brentm5 avatar brentm5 commented on June 12, 2024 1

We currently do not have that feature and have not started on any code to support it. If you wanted to add it you are more then welcome to. Some of the issues with why we did not add it was because it's not very easy to make it idempotent as we most likely do not want this running on every chef-client run after its successful. The easiest pattern people follow would be to check for a file on disk and run if it didn't exist, However this also has limitations such as if a role changes it might need to be rolled out manually. I also do not know how to directly test that in our current test apparatus but I can provide some help with adding it / getting it merged and rolled out if you want to submit a PR. It might make sense to move it into a different resource, I am not sure.

from octopus-deploy-cookbook.

spuder avatar spuder commented on June 12, 2024

Are there any plans to add a ':register' action to the tentacle resource? I'd hate to start a pull request if the work is already started.

Listening

"netsh" advfirewall firewall add rule "name=Octopus Deploy Tentacle" dir=in action=allow protocol=TCP localport=10933
Tentacle.exe register-with --instance "Tentacle" --server "http://YOUR_OCTOPUS" --apiKey="API-YOUR_API_KEY" --role "web-server" --environment "Staging" --comms-style TentaclePassive --console

Polling

Tentacle.exe register-with --instance "Tentacle" --server "http://YOUR_OCTOPUS" --name "YOUR_TENTACLE_NAME" --apiKey "API-YOUR_API_KEY" --comms-style "TentacleActive" --server-comms-port "10943" --force --environment "YOUR_TENTACLE_ENVIRONMENTS" --role "YOUR_TENTACLE_ROLES" --console

from octopus-deploy-cookbook.

spuder avatar spuder commented on June 12, 2024

Thanks, I've started working on this. I've got basic functionality working with polling tentacles.

Idempotency

Leaving a file would work, however I've figured out how to query the octopus server with powershell. I still need to figure out how to convert the script into a chef/ruby library.

http://help.octopusdeploy.com/discussions/questions/8736-programmatically-determine-if-tentacle-is-registered

Roles

I'm not too worried about that feature at first since you can easily change roles in the web interface. The registration does require that atleast 1 role is defined. Its pretty easy to get/add roles from the api using powershell, so maybe it would leverage a similar approach to the idempotency check to add them.

Testing

Testing this is going to be tricky. I'm thinking of using appvoyer to spin up a windows vm. The octopus server and the tentacle would be installed on the same machine. Matt Wrock documented how to do this here.
The major hurdle with this approach is that you need to have an API key to register a tentacle, and I haven't found any documentation yet how to programmatically generate one.

from octopus-deploy-cookbook.

brentm5 avatar brentm5 commented on June 12, 2024

We actually already test in appveyor for the server install / tentacle install. Currently we do not start the server because it doesn't have a database but I believe appveyor already has databases configured when it initializes. For Appveyor there are scripts which can be run before and after installs so in theory something could be worked out. I am not sure of the best way to setup the tests but it definitely can be done. For now I think its safe to just create a resource that we can test the scripts locally and not include it in tests and worry about that as refactors. The resource would be relatively simple.

Organizationally I am not sure whats the best way to call the resource but that can be easily switched / refined later. I am thinking something like one of these

# If this is the way we run it then I think some of the resource validations will need to be refined.
# Because a version is not needed for this to work but it is for install.
octopus_deploy_tentacle "Instance" do
  action :register
  environment ['env']
  roles ['role']
  api_key <api_key>
  endpoint <endpoint>
  guard_file <file to create if set> # Optional value to save a file for 
end

# or there could be a new resource and that would simplify the attributes
octopus_deploy_tentacle_admin "Instance" do
  action :register
  environment ['env']
  roles ['role']
  api_key <api_key>
  endpoint <endpoint>
  guard_file <file to create if set> # Optional value to save a file for 
end

from octopus-deploy-cookbook.

brentm5 avatar brentm5 commented on June 12, 2024

Closing as @spuder added #33

from octopus-deploy-cookbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.