roper

command module
v0.0.0-...-01c1a50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2016 License: Apache-2.0 Imports: 1 Imported by: 0

README

Roper

A Repo Manager For The Rest Of Us

Circle CI

Current version is 0.1

Roper is a yum repo manager that will automatically watch added local yum repositories. Roper will watch for changes and run createrepo against the repos should any RPMs be added or removed. It will also serve up these repositories on a built in web server.

./roper -h
Roper is a server that can manage your Yum repositories, and serve them
up on a built in web server.  Most notably, it will watch configured
repositories and automatically run the 'createrepo' program
against them (if desired) when changes are detected.

Usage:
  roper [command]

Available Commands:
  repo        Perform an action on a repo
  serve       Run a server

Flags:
      --config string            config file (default is $HOME/.roper.yaml)
      --createrepo_path string   path to the 'createrepo' executable (default "/usr/local/bin/createrepo")
      --dbpath string            path to the roper database (default "/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/roper.db")
  -t, --toggle                   Help message for toggle

Use "roper [command] --help" for more information about a command.

Roper uses Bolt as a database, and needs to persist this file somewhere. By default, it will persist to the directory that the roper executable lives in. This can be overridden with the --dbpath option.

To run Roper, first add a repository using an absolute path and a name:

./roper repo add /Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/ DockerRepo
INFO[0000] created bucket (may have already existed)     bucket=repos
INFO[0000] created bucket (may have already existed)     bucket=packages
INFO[0000] Discovering repo                              name=DockerRepo path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/
INFO[0000] Running createrepo                            repo=DockerRepo
INFO[0000] Successfully discovered repo                  name=DockerRepo path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/
INFO[0000] Closing database                              db=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/roper.db

Then, we can serve this repo up:

./roper serve
INFO[0000] created bucket (may have already existed)     bucket=repos
INFO[0000] created bucket (may have already existed)     bucket=packages
INFO[0000] Starting Server
INFO[0000] Starting web server for repos at prefixes on port 3000  prefixes=[ DockerRepo]
INFO[0000] Creating watcher                              path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/
INFO[0000] Adding path to watcher                        pkg_path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/Packages/docker-engine-selinux-1.9.0-1.el7.centos.src.rpm
INFO[0000] Adding path to watcher                        pkg_path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/Packages/docker-engine-1.8.1-1.el7.centos.x86_64.rpm
INFO[0000] Adding path to watcher                        pkg_path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/Packages/docker-engine-1.8.2-1.el7.centos.x86_64.rpm
INFO[0000] Adding path to watcher                        pkg_path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/Packages/docker-engine-1.9.0-1.el7.centos.x86_64.rpm
INFO[0000] Adding path to watcher                        pkg_path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/Packages/docker-engine-selinux-1.9.0-1.el7.centos.noarch.rpm
INFO[0000] Adding path to watcher                        pkg_path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/Packages/docker-engine-1.9.1-1.el7.centos.x86_64.rpm
INFO[0000] Adding path to watcher                        pkg_path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/Packages/docker-engine-selinux-1.9.1-1.el7.centos.noarch.rpm
INFO[0000] Adding path to watcher                        pkg_path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/Packages/docker-engine-selinux-1.9.1-1.el7.centos.src.rpm
INFO[0000] Adding path to watcher                        pkg_path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/Packages/docker-engine-1.7.0-1.el7.centos.x86_64.rpm
INFO[0000] Adding path to watcher                        pkg_path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/Packages/docker-engine-1.7.1-1.el7.centos.x86_64.rpm
INFO[0000] Adding path to watcher                        pkg_path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/Packages/docker-engine-1.8.0-1.el7.centos.x86_64.rpm
INFO[0000] Adding path to watcher                        pkg_path=/Users/alapidas/goWorkspace/src/github.com/alapidas/roper/hack/test_repos/docker/7/Packages/docker-engine-1.8.3-1.el7.centos.x86_64.rpm

By default, roper will serve your repos on a web server in a subdirectory of the repo name:

http://localhost:3000/DockerRepo/

Limitations

  • The add and rm subcommands of repo require the server to be down, due to an exclusive lock held on the database

Developers

Building
make build
Testing
make test
Running

It's worth noting that you need the createrepo executbale somewher on your local system. For OSX, I used homebrew and a formula that someone wrote. Docker worked, but was more pain than it was worth. YMMV.

make run

TODO

  • Handle more advanced features of createrepo
  • Implement REST API on top of current model, allowing, at a minimum, CRUD access to repos and RPMs
  • Implement RPC (or REST request/response) between roper client and roper server
  • Make a Docker image for this
  • Write more tests

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/boltdb/bolt
Package bolt implements a low-level key/value store in pure Go.
Package bolt implements a low-level key/value store in pure Go.
_workspace/src/github.com/gorilla/context
Package context stores values shared during a request lifetime.
Package context stores values shared during a request lifetime.
_workspace/src/github.com/gorilla/mux
Package gorilla/mux implements a request router and dispatcher.
Package gorilla/mux implements a request router and dispatcher.
_workspace/src/github.com/hashicorp/hcl
Package hcl decodes HCL into usable Go structures.
Package hcl decodes HCL into usable Go structures.
_workspace/src/github.com/hashicorp/hcl/hcl/ast
Package ast declares the types used to represent syntax trees for HCL (HashiCorp Configuration Language)
Package ast declares the types used to represent syntax trees for HCL (HashiCorp Configuration Language)
_workspace/src/github.com/hashicorp/hcl/hcl/parser
Package parser implements a parser for HCL (HashiCorp Configuration Language)
Package parser implements a parser for HCL (HashiCorp Configuration Language)
_workspace/src/github.com/hashicorp/hcl/hcl/printer
Package printer implements printing of AST nodes to HCL format.
Package printer implements printing of AST nodes to HCL format.
_workspace/src/github.com/hashicorp/hcl/hcl/scanner
Package scanner implements a scanner for HCL (HashiCorp Configuration Language) source text.
Package scanner implements a scanner for HCL (HashiCorp Configuration Language) source text.
_workspace/src/github.com/hashicorp/hcl/hcl/token
Package token defines constants representing the lexical tokens for HCL (HashiCorp Configuration Language)
Package token defines constants representing the lexical tokens for HCL (HashiCorp Configuration Language)
_workspace/src/github.com/kr/pretty
Package pretty provides pretty-printing for Go values.
Package pretty provides pretty-printing for Go values.
_workspace/src/github.com/kr/text
Package text provides rudimentary functions for manipulating text in paragraphs.
Package text provides rudimentary functions for manipulating text in paragraphs.
_workspace/src/github.com/kr/text/colwriter
Package colwriter provides a write filter that formats input lines in multiple columns.
Package colwriter provides a write filter that formats input lines in multiple columns.
_workspace/src/github.com/kr/text/mc
Command mc prints in multiple columns.
Command mc prints in multiple columns.
_workspace/src/github.com/magiconair/properties
Package properties provides functions for reading and writing ISO-8859-1 and UTF-8 encoded .properties files and has support for recursive property expansion.
Package properties provides functions for reading and writing ISO-8859-1 and UTF-8 encoded .properties files and has support for recursive property expansion.
_workspace/src/github.com/mitchellh/mapstructure
The mapstructure package exposes functionality to convert an abitrary map[string]interface{} into a native Go structure.
The mapstructure package exposes functionality to convert an abitrary map[string]interface{} into a native Go structure.
_workspace/src/github.com/spf13/cobra
Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
_workspace/src/github.com/spf13/pflag
Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
_workspace/src/github.com/spf13/viper/remote
Package remote integrates the remote features of Viper.
Package remote integrates the remote features of Viper.
_workspace/src/golang.org/x/sys/unix
Package unix contains an interface to the low-level operating system primitives.
Package unix contains an interface to the low-level operating system primitives.
_workspace/src/gopkg.in/check.v1
Package check is a rich testing extension for Go's testing package.
Package check is a rich testing extension for Go's testing package.
_workspace/src/gopkg.in/fsnotify.v1
Package fsnotify provides a platform-independent interface for file system notifications.
Package fsnotify provides a platform-independent interface for file system notifications.
_workspace/src/gopkg.in/yaml.v2
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL