Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

CLI extensions - playbooks #468

Merged
merged 2 commits into from
Apr 7, 2017
Merged

CLI extensions - playbooks #468

merged 2 commits into from
Apr 7, 2017

Conversation

chungers
Copy link
Contributor

@chungers chungers commented Apr 7, 2017

New CLI extensions called 'Playbooks' allow user to package and define sets of templates and scripts and make the package available in the CLI as new subcommands and flags. This complements the existing local extension mechanism of files/ directories by allowing 'playbooks' to be remote URL resources. Currently the resource URL understand https/http/file resources but in the future we will add other protocols such as git or docker images.

A new command has been added: infrakit playbook add | rm | ls
This command is used to add new playbooks. For example:

infrakit playbook add testdata file://$(pwd)/pkg/cli/remote/testdata/index.ikm

Adds the playbook called testdata:

infrakit -h

Available Commands:
.... # other entries 
 group         Access group plugin
  info          print plugin info
  instance      Access instance plugin
  manager       Access the manager
  metadata      Access metadata exposed by infrakit plugins
  playbook      Manage playbooks
  plugin        Manage plugins
  resource      Access resource plugin
  template      Render an infrakit template at given url.  If url is '-', read from stdin
  testdata      testdata  <=== added here
  util          Utilties
  version       Print build version information

Now remove the playbook:

infrakit playbook rm testdata

Signed-off-by: David Chung [email protected]

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "gcp4" [email protected]:chungers/infrakit.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842353657192
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

@codecov
Copy link

codecov bot commented Apr 7, 2017

Codecov Report

Merging #468 into master will decrease coverage by 0.08%.
The diff coverage is 63.38%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #468      +/-   ##
==========================================
- Coverage   68.33%   68.25%   -0.09%     
==========================================
  Files          68       69       +1     
  Lines        4084     4152      +68     
==========================================
+ Hits         2791     2834      +43     
- Misses       1047     1063      +16     
- Partials      246      255       +9
Impacted Files Coverage Δ
pkg/template/util.go 63.63% <100%> (ø) ⬆️
pkg/template/funcs.go 67.77% <50%> (ø) ⬆️
pkg/cli/remote/remote.go 63.23% <63.23%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c88ca75...d4fd487. Read the comment docs.

@YujiOshima
Copy link
Contributor

@chungers This is cool extension. I will try this!
Since playbook is a new concept, We need Documents.
How about adding at least the description in this PR to cli's README as well?

@chungers chungers merged commit 251ff68 into docker-archive:master Apr 7, 2017
@chungers
Copy link
Contributor Author

chungers commented Apr 8, 2017

@YujiOshima - thanks. I am doing a little bit of code cleanup. Docs and examples coming soon!

chungers pushed a commit to chungers/infrakit that referenced this pull request Sep 30, 2017
chungers pushed a commit to chungers/infrakit that referenced this pull request Oct 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants