Skip to content

Commit

Permalink
Merge pull request #60 from omniti-labs/new_release
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
clintoncwolfe committed Mar 14, 2016
2 parents 9f2e152 + 0b9ba47 commit adfaa5f
Show file tree
Hide file tree
Showing 47 changed files with 174 additions and 148 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
**/.DS_Store
*.gem
.bundle
.kitchen/
.kitchen.*.yml
vendor/bundle
pkg/*
.vagrant
bin/*
files/**/cache/
vendor/cookbooks
local/
Gemfile.lock
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.1.0] - 2016-03-14

- Removed ansible-toolkit - https://github.com/omniti-labs/ansible-dk/issues/58
- Moved omnibus project to top level
- Added verify subcommand to ansible-dk cli to verify internal tools

## [1.0.0] - 2016-03-07

### Updated tools (jblancett)
Expand Down
File renamed without changes.
122 changes: 122 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,125 @@ For giving us a clue for how to build and package python modules under omnibus
* Chef, Inc.

For Omnibus, and the many build definitions we are using.


ansible-dk Omnibus project
=========================
This project creates full-stack platform-specific packages for
`ansible-dk`!

Installation
------------
You must have a sane Ruby 1.9+ environment with Bundler installed. Ensure all
the required gems are installed:

```shell
$ bundle install --binstubs
```

Usage
-----
### Build

You create a platform-specific package using the `build project` command:

```shell
$ bin/omnibus build ansible-dk
```

The platform/architecture type of the package created will match the platform
where the `build project` command is invoked. For example, running this command
on a MacBook Pro will generate a Mac OS X package. After the build completes
packages will be available in the `pkg/` folder.

### Clean

You can clean up all temporary files generated during the build process with
the `clean` command:

```shell
$ bin/omnibus clean ansibledk
```

Adding the `--purge` purge option removes __ALL__ files generated during the
build including the project install directory (`/opt/ansibledk`) and
the package cache directory (`/var/cache/omnibus/pkg`):

```shell
$ bin/omnibus clean ansibledk --purge
```

### Publish

Omnibus has a built-in mechanism for releasing to a variety of "backends", such
as Amazon S3. You must set the proper credentials in your `omnibus.rb` config
file or specify them via the command line.

```shell
$ bin/omnibus publish path/to/*.deb --backend s3
```

### Help

Full help for the Omnibus command line interface can be accessed with the
`help` command:

```shell
$ bin/omnibus help
```

Version Manifest
----------------

Git-based software definitions may specify branches as their
default_version. In this case, the exact git revision to use will be
determined at build-time unless a project override (see below) or
external version manifest is used. To generate a version manifest use
the `omnibus manifest` command:

```
omnibus manifest PROJECT -l warn
```

This will output a JSON-formatted manifest containing the resolved
version of every software definition.


Kitchen-based Build Environment
-------------------------------
Every Omnibus project ships will a project-specific
[Berksfile](http://berkshelf.com/) that will allow you to build your omnibus projects on all of the projects listed
in the `.kitchen.yml`. You can add/remove additional platforms as needed by
changing the list found in the `.kitchen.yml` `platforms` YAML stanza.

This build environment is designed to get you up-and-running quickly. However,
there is nothing that restricts you to building on other platforms. Simply use
the [omnibus cookbook](https://github.com/opscode-cookbooks/omnibus) to setup
your desired platform and execute the build steps listed above.

The default build environment requires Test Kitchen and VirtualBox for local
development. Test Kitchen also exposes the ability to provision instances using
various cloud providers like AWS, DigitalOcean, or OpenStack. For more
information, please see the [Test Kitchen documentation](http://kitchen.ci).

Once you have tweaked your `.kitchen.yml` (or `.kitchen.local.yml`) to your
liking, you can bring up an individual build environment using the `kitchen`
command.

```shell
$ bin/kitchen converge ubuntu-1204
```

Then login to the instance and build the project as described in the Usage
section:

```shell
$ bundle exec kitchen login ubuntu-1204
[vagrant@ubuntu...] $ cd ansibledk
[vagrant@ubuntu...] $ bundle install
[vagrant@ubuntu...] $ ...
[vagrant@ubuntu...] $ bin/omnibus build ansibledk
```

For a complete list of all commands and platforms, run `kitchen list` or
`kitchen help`.
42 changes: 31 additions & 11 deletions ansible-dk-cli/ansible-dk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUBY_ABI = "2.1.0"
PYTHON_ABI = "2.7"
HOME = os.getenv("HOME")

# pull version from version-manifest file left by package install
def check_version():
file='/opt/ansible-dk/version-manifest.json'
try:
Expand All @@ -32,18 +33,14 @@ def check_version():
return version

###################################################
# Generic top-level group definitions
# Generic top-level group definition
@click.group()
@click.version_option(version=check_version())
def cli():
pass


@cli.group()
def generate():
pass


###################################################
# shell-init command
@cli.command(name='shell-init')
@click.option('--debug', is_flag=True, help="Enable debug mode")
@click.argument('shell', default='bash')
Expand All @@ -66,7 +63,7 @@ def shell_init(shell, debug=False):
except OSError as e:
if e.errno == 17: # if file exists
if debug:
print("[DEBUG] %s - skipping - %s" % (e.strerror, e.filename))
print("[DEBUG] %s - skipping - %s" % (e.strerror, e.filename))
pass
else:
print("Error creating %s - %s(%d)" % (e.filename, e.strerror, e.errno))
Expand All @@ -82,19 +79,42 @@ def shell_init(shell, debug=False):
print("export PYTHONUSERBASE=\""+HOME+"/.ansible-dk/python\"")
print("export PIP_INSTALL_OPTION=\"--user\"")

# -- generate command
###################################################
# verify command
@cli.command()
def verify():
commands = [
'ansible-dk --version',
'aws --version 2>&1 | tr " " "\n" | tr "/" " "',
'ansible --version',
'ansible-lint --version',
'ruby --version',
'kitchen --version',
'gem list ^kitchen-* serverspec | tail -n+0',
'jq --version'
]
for command in commands:
if os.system(command) != 0:
print "Verification of %s failed." % command.split()[0]
sys.exit(-1)
print "Verification succeeded."

###################################################
# generate command
@cli.group()
def generate():
pass

@generate.command(name='playbook')
@click.option('--name', required=True, help='Name of playbook to generate')
def generate_playbook(name):
print("Generating playbook: ", name)


@generate.command(name='role')
@click.option('--name', required=True, help='Name of role to generate')
def generate_role(name):
print("Generating role: ", name)


###################################################
# Call main CLI
if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
override :paramiko, version: "1.16.0"
override :pycrypto, version: "2.6.1"
override :'ansible-lint', version: "2.3.3"
override :'ansible-toolkit', version: "1.3.2"
override :appbundler, version: "v0.7.0"
override :serverspec, version: "v2.30.1"
override :molecule, version: "1.3.0"
Expand All @@ -46,7 +45,6 @@
dependency "awscli"
dependency "ansible"
dependency "ansible-lint"
dependency "ansible-toolkit"
dependency "molecule"

# Ruby land
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 0 additions & 12 deletions omnibus-ansible-dk/.gitignore

This file was deleted.

120 changes: 0 additions & 120 deletions omnibus-ansible-dk/README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit adfaa5f

Please sign in to comment.