项目作者: ChrisMcKenzie

项目描述 :
Super simple deployment tool
高级语言: Go
项目地址: git://github.com/ChrisMcKenzie/dropship.git
创建时间: 2015-09-03T23:09:19Z
项目社区:https://github.com/ChrisMcKenzie/dropship

开源协议:Apache License 2.0

下载


Dropship wercker status Download Join the chat at https://gitter.im/ChrisMcKenzie/dropship

Dropship is a simple tool for installing and updating artifacts from a CDN.

Features

  • Automatically performs md5sum checks of artifact that is on server and remote
    and will download automatically
  • Distributed sequential updates
  • Multiple Artifact Repository Support

Installation

To install on ubuntu do the following:

  1. echo "deb http://dl.bintray.com/chrismckenzie/deb trusty main" >> /etc/apt/sources.list
  2. sudo apt-get update
  3. sudo apt-get install dropship

Configuration

To setup dropship you will need to add/update the following files.

First you will need to tell dropship how to connect to your artifact repository
so you will need to uncomment out the desired repo and fill in its options.

/etc/dropship.d/dropship.hcl

  1. # vim: set ft=hcl :
  2. # Location that service config will be read from
  3. service_path = "/etc/dropship.d/services"
  4. # Rackspace Repo Config
  5. # =====================
  6. repo "rackspace" {
  7. user = "<your-rackspace-user>"
  8. key = "<your-rackspace-key>"
  9. region = "<rackspace-region>"
  10. }
  11. repo "s3" {
  12. accessKey = "<your-s3-key>"
  13. secret = "<your-s3-secret>"
  14. name = "us-west-1"
  15. endpoint = "https://s3-us-west-1.amazonaws.com"
  16. }

You will then have to create a file in the services directory of dropship. this
will tell dropship how to check and install you artifact. You can have multiple
service definitions in one file or multiple files.

/etc/dropship.d/services/my-service.hcl

  1. # vim: set ft=hcl :
  2. service "my-service" {
  3. # Use a semaphore to update one machine at a time
  4. sequentialUpdates = true
  5. # Check for updates every 10s
  6. checkInterval = "10s"
  7. # Run this command before update starts
  8. before "script" {
  9. command = "initctl my-service stop"
  10. }
  11. # Artifact defines what repository to use (rackspace) and where
  12. # your artifact live on that repository
  13. artifact "rackspace" {
  14. bucket = "my-container"
  15. path = "my-service.tar.gz"
  16. destination = "./test/dest"
  17. }
  18. # After successful update send an event to graphite
  19. # this allows you to show deploy annotations in tools like grafana
  20. #
  21. # The graphite hook will automatically add this services name into the
  22. # graphite tags. You also have access to all of the services meta data
  23. # like Name, "current hash", hostname.
  24. after "graphite-event" {
  25. host = "http://<my-graphite-server>"
  26. tags = "deployment"
  27. what = "deployed to {{.Name}} on {{.Hostname}}"
  28. data = "{{.Hash}}"
  29. }
  30. # Run this command after the update finishes
  31. after "script" {
  32. command = "initctl my-service start"
  33. }
  34. }

Building

  • install go 1.5.1
  • clone repo
  • run go get ./...
  • run go build -o dropship main.go

Roadmap

  • [X] Hooks
  • [X] Support for Amazon S3
  • Support for different file types docker (currently only tar.gz, and simple files)
  • Reporting system
  • Redis, etcd for semaphore