#!/usr/bin/env ruby $:.push 'lib' require 'rubygems' require 'thor' require 'thor/runner' require 'thor/group' require 'opskeleton' if(File.exists?('opks.yml')) error 'opsk.yml found please rename to opsk.yaml' exit 1 end module Opsk class Root < Thor register Opsk::GeneratePuppet, 'generate_puppet', "generate_puppet [name] [box]", 'generates a Puppet based project ' register Opsk::GenerateChef, 'generate_chef', "generate_chef [name] [box]", 'generates a Chef based project ' register Opsk::Module, 'module', 'module [name]', 'generate an rspec ready Puppet module' register Opsk::Package, 'package', 'package', 'packages current module for celestial' register Opsk::Dockerize, 'dockerize', 'dockerize [from] [os_type]', 'Creates a docker image from the current sandbox' register Opsk::Commit, 'commit', 'commit [message]', 'commit each changed puppet module under modules folder' register Opsk::Uncommited, 'uncommited', 'uncommited', 'list uncommited modules changes' register Opsk::Push, 'push', 'push', 'push each changed puppet module under modules folder' register Opsk::Clean, 'clean', 'clean', 'cleans up packaging products' register Opsk::Bump, 'bump', 'bump', 'bumps up version (clearing old version also)' register Opsk::DeployBintray, 'deploy_bintray', 'deploy_bintray [repo]', 'deploy packge into bintray.com' register Opsk::DeployS3, 'deploy_s3', 'deploy_s3 [bucket] [path]', 'deploy packge into s3 bucket under path folder' register Opsk::DeployScp, 'deploy_scp', 'deploy_scp [host]', 'deploy packge using scp to host' desc 'version', 'print opsk version' def version puts Opskeleton::VERSION end end end # not sure that this is the cleanest way Opsk::Root.tasks['generate_puppet'].options = Opsk::GeneratePuppet.class_options Opsk::Root.tasks['generate_chef'].options = Opsk::GenerateChef.class_options Opsk::Root.tasks['push'].options = Opsk::Push.class_options Opsk::Root.tasks['commit'].options = Opsk::Commit.class_options Opsk::Root.start ARGV