GithubHelp home page GithubHelp logo

esoterick / kitchen-digitalocean Goto Github PK

View Code? Open in Web Editor NEW

This project forked from test-kitchen/kitchen-digitalocean

0.0 2.0 0.0 188 KB

A Test Kitchen driver for DigitalOcean

License: Other

Ruby 100.00%

kitchen-digitalocean's Introduction

Gem Version Build Status Code Climate Coverage Status

Kitchen::Digitalocean

A Test Kitchen Driver for DigitalOcean

Shamelessly copied from RoboticCheese's awesome work on an Rackspace driver.

Upgrading

From this version forward the driver uses API V2 only. Use of image_id, flavor_id, and region_id have been replaced with image, size, and region. You can now use slugs instead of relying on the old data.json to translate IDs. Please refer to the examples below, and the API documentation for more information.

Requirements

There are no external system requirements for this driver. However you will need access to an DigitalOcean account.

Installation and Setup

You'll need to install the gem on your development machine.

gem install kitchen-digitalocean

or add it to your Gemfile if you are using Bundler

source 'https://rubygems.org'

gem 'test-kitchen'
gem 'kitchen-digitalocean'

At minimum, you'll need to tell test-kitchen to use the digitalocean driver.

---
driver:
  name: digitalocean
platforms:
  - name: ubuntu-17

You also have the option of providing your credentials from environment variables.

export DIGITALOCEAN_ACCESS_TOKEN="1234"
export DIGITALOCEAN_SSH_KEY_IDS="1234, 5678"

Note that your SSH_KEY_ID must be the numeric id of your ssh key, not the symbolic name. To get the numeric ID of your keys, use something like to following command to get them from the digital ocean API:

curl -X GET https://api.digitalocean.com/v2/account/keys -H "Authorization: Bearer $DIGITALOCEAN_ACCESS_TOKEN"

Please refer to the Getting Started Guide for any further documentation.

Default Configuration

The driver now uses api v2 which provides slugs for image names, sizes, and regions.

Example configuration:

---
platforms:
- name: debian-7-0-x64
  driver_config:
    region: ams1
- name: centos-6-4-x64
  driver_config:
    size: 2gb
# ...

Private Networking

Private networking is enabled by default, but will only work in certain regions. You can disable private networking by changing private_networking to false. Example below.

---
driver:
  - private_networking: false

IPv6

IPv6 is disabled by default, you can enable this if needed. IPv6 is only available in limited regions.

---
driver:
  - ipv6: true

Image abbrevations we use

This is a list of abbreviate image names we provide

centos-6
centos-7
coreos-stable
oreos-beta
coreos-alpha
debian-7
debian-8
debian-9
fedora-27
fedora-28
reebsd-11.1
freebsd-11.0
freebsd-10.3
ubuntu-14
ubuntu-16
ubuntu-17
ubuntu-18

Regions

nyc1    New York 1
sfo1    San Francisco 1
ams2    Amsterdam 2
sgp1    Singapore 1
lon1    London 1
nyc3    New York 3
ams3    Amsterdam 3
fra1    Frankfurt 1
tor1    Toronto 1
sfo2    San Francisco 2
blr1    Bangalore 1

Tags

To add tags to the droplet, provide the tags attribute.

driver:
  tags:
    - test-kitchen
    - this-is-a-tag

Monitoring

DigitalOcean provides a monitoring agent that you can optionally install to your droplet. To enable this feature, set the monitoring attribute to true.

---
driver:
  - monitoring: true

Firewall

To create the droplet with firewalls, provide a pre-existing firewall ID as a string or list of strings.

driver:
  firewalls:
    - 7a489167-a3d5-4d93-9f4a-371bd02ea8a3
    - 624c1408-f101-4b59-af64-99c7f7560f7a

or

driver:
  firewalls: 624c1408-f101-4b59-af64-99c7f7560f7a

Note that your firewalls must be the numeric ids of your firewall. To get the numeric ID, use something like to following command to get them from the digital ocean API:

curl -X GET https://api.digitalocean.com/v2/firewalls -H "Authorization: Bearer $DIGITALOCEAN_ACCESS_TOKEN"

Development

Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Authors

Created and maintained by Greg Fitzgerald ([email protected])

Special Thanks:

Will Farrington, His fork was a help during the creation of my api v2 driver.

License

Apache 2.0 (see LICENSE)

kitchen-digitalocean's People

Contributors

gregf avatar tas50 avatar tolland avatar hartmantis avatar mwrock avatar sarkis avatar coderanger avatar randsina avatar dpetzel avatar zhann avatar olivielpeau avatar ijin avatar mattwhite avatar lamont-granquist avatar bdausses avatar alaa avatar martinisoft avatar

Watchers

James Cloos avatar  avatar

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.