qb 0.3.13 → 0.3.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/getting_started.md +2 -0
- data/doc/qb_roles.md +4 -109
- data/doc/qb_roles/metadata.md +221 -0
- data/exe/qb +23 -11
- data/lib/qb.rb +1 -3
- data/lib/qb/cli.rb +97 -85
- data/lib/qb/options.rb +6 -6
- data/lib/qb/role/default_dir.rb +28 -28
- data/lib/qb/util.rb +3 -2
- data/lib/qb/version.rb +1 -1
- data/qb.gemspec +22 -9
- data/roles/nrser.rbenv_gem/tasks/main.yml +3 -3
- data/roles/qb/gem/build/defaults/main.yml +12 -0
- data/roles/{qb.build_gem → qb/gem/build}/meta/main.yml +0 -0
- data/roles/qb/gem/build/meta/qb.yml +42 -0
- data/roles/qb/gem/build/tasks/main.yml +61 -0
- data/roles/{qb.install_gem → qb/gem/install}/defaults/main.yml +1 -1
- data/roles/qb/gem/install/meta/main.yml +17 -0
- data/roles/{qb.install_gem → qb/gem/install}/meta/qb.yml +5 -2
- data/roles/{qb.install_gem → qb/gem/install}/tasks/main.yml +0 -0
- data/roles/qb/git/ignore/files/gitignore/Eagle.gitignore +9 -1
- data/roles/qb/git/ignore/files/gitignore/Global/Eclipse.gitignore +3 -0
- data/roles/qb/git/ignore/files/gitignore/Go.gitignore +1 -0
- data/roles/qb/git/ignore/files/gitignore/Node.gitignore +2 -0
- data/roles/qb/git/ignore/files/gitignore/Python.gitignore +7 -19
- data/roles/qb/git/ignore/files/gitignore/Python/Packaging.gitignore +25 -0
- data/roles/qb/git/ignore/files/gitignore/Ruby.gitignore +15 -5
- data/roles/qb/git/ignore/files/gitignore/Umbraco.gitignore +2 -2
- data/roles/qb/git/ignore/files/gitignore/VisualStudio.gitignore +4 -0
- data/roles/qb/role/qb/templates/qb.yml.j2 +19 -39
- data/roles/qb/role/templates/README.md.j2 +1 -1
- data/roles/qb/role/templates/defaults/main.yml.j2 +6 -1
- data/roles/qb/role/templates/filter_plugins/filters.py.j2 +5 -5
- data/roles/qb/role/templates/handlers/main.yml.j2 +3 -1
- data/roles/qb/role/templates/meta/main.yml.j2 +4 -2
- data/roles/qb/role/templates/tasks/main.yml.j2 +3 -1
- data/roles/qb/role/templates/vars/main.yml.j2 +3 -1
- metadata +43 -34
- data/roles/qb.build_gem/defaults/main.yml +0 -2
- data/roles/qb.build_gem/tasks/main.yml +0 -27
- data/roles/qb.install_gem/meta/main.yml +0 -12
@@ -36,11 +36,11 @@
|
|
36
36
|
# msg: "{{ rbenv_gem_rubies_list }}"
|
37
37
|
|
38
38
|
# this will clone the repo, build the .gem and point rbenv_gem_source to it
|
39
|
-
-
|
39
|
+
- include_tasks: clone-repo.yml
|
40
40
|
when: rbenv_gem_repo is defined
|
41
41
|
|
42
|
-
-
|
42
|
+
- include_tasks: manage-source.yml
|
43
43
|
when: rbenv_gem_source is defined
|
44
44
|
|
45
|
-
-
|
45
|
+
- include_tasks: manage-version.yml
|
46
46
|
when: rbenv_gem_source is not defined
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
##############################################################################
|
3
|
+
# Variable defaults for `qb/gem/build` role
|
4
|
+
##############################################################################
|
5
|
+
|
6
|
+
# Default the gem root to the DIRECTORY from QB
|
7
|
+
gem_root: >-
|
8
|
+
{{ qb_dir }}
|
9
|
+
|
10
|
+
# Where to move the built gem to
|
11
|
+
gem_build_dest: >-
|
12
|
+
{{ gem_root }}/pkg
|
File without changes
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
##############################################################################
|
3
|
+
# QB metadata for `qb/gem/build` role
|
4
|
+
#
|
5
|
+
# qb settings for this role. see README.md for more info.
|
6
|
+
#
|
7
|
+
##############################################################################
|
8
|
+
|
9
|
+
# description of the role to show in it's help output.
|
10
|
+
description: Build an installable `.gem` file from a source directory.
|
11
|
+
|
12
|
+
# Gemspec-style requirements. Right now only `gems:qb` is used, but plan to
|
13
|
+
# generalize in the future.
|
14
|
+
requirements:
|
15
|
+
gems:
|
16
|
+
qb: ~> 0.3.0
|
17
|
+
|
18
|
+
# prefix for role variables
|
19
|
+
var_prefix: gem_build
|
20
|
+
|
21
|
+
# Closest gemspec climbing down tree from working dir
|
22
|
+
default_dir:
|
23
|
+
find_up: '*.gemspec'
|
24
|
+
|
25
|
+
# Have QB ensure DIRECTORY exists before starting the play.
|
26
|
+
mkdir: false
|
27
|
+
|
28
|
+
# default user to become for play
|
29
|
+
default_user: null
|
30
|
+
|
31
|
+
# set to false to not save options in .qb-options.yml files
|
32
|
+
save_options: false
|
33
|
+
|
34
|
+
# options to pass to ansible-playbook
|
35
|
+
ansible_options: {}
|
36
|
+
|
37
|
+
options:
|
38
|
+
- name: dest
|
39
|
+
description: Destination directory for the `.gem` file
|
40
|
+
required: false
|
41
|
+
type: path
|
42
|
+
short: d
|
@@ -0,0 +1,61 @@
|
|
1
|
+
---
|
2
|
+
##############################################################################
|
3
|
+
# Main tasks for `qb/gem/build` role
|
4
|
+
##############################################################################
|
5
|
+
|
6
|
+
- when: get_root_facts is not defined
|
7
|
+
name: >-
|
8
|
+
Get the QB path facts for `gem_root={{ gem_root }}`
|
9
|
+
path_facts:
|
10
|
+
path: >-
|
11
|
+
{{ gem_root }}
|
12
|
+
register: gem_root_facts
|
13
|
+
|
14
|
+
|
15
|
+
- name: >-
|
16
|
+
Set `gem_build_filename` to the (presumed) filename of the new `.gem`
|
17
|
+
set_fact:
|
18
|
+
gem_build_filename: >-
|
19
|
+
{{ gem_root_facts.gem.name }}-{{ gem_root_facts.gem.version.raw }}.gem
|
20
|
+
|
21
|
+
|
22
|
+
- name: >
|
23
|
+
Set `gem_build_path` to the absolute path we want
|
24
|
+
`{{ gem_build_filename }}` to end up at
|
25
|
+
set_fact:
|
26
|
+
gem_build_path: >-
|
27
|
+
{{ gem_build_dest | path_resolve( gem_build_filename ) }}
|
28
|
+
|
29
|
+
|
30
|
+
- when: not gem_root_facts.gem.version.is_dev
|
31
|
+
block:
|
32
|
+
- name: >-
|
33
|
+
Stat destination path `{{ gem_build_path }}`
|
34
|
+
stat:
|
35
|
+
path: >-
|
36
|
+
{{ gem_build_path }}
|
37
|
+
register: gem_build_path_stat
|
38
|
+
|
39
|
+
- when: gem_build_path_stat.stat.exists
|
40
|
+
fail:
|
41
|
+
msg: >-
|
42
|
+
Gem build destination `{{ gem_build_path }}` exists
|
43
|
+
(and gem at `{{ gem_root }}` is not at a `dev` version)
|
44
|
+
|
45
|
+
|
46
|
+
- name: >-
|
47
|
+
Build gem from {{ gem_root_facts.gem.gemspec_path }}
|
48
|
+
stream:
|
49
|
+
cmd: gem build {{ gem_root_facts.gem.gemspec_path | basename | quote }}
|
50
|
+
chdir: >-
|
51
|
+
{{ gem_root }}
|
52
|
+
|
53
|
+
|
54
|
+
- when: gem_root != gem_build_dest
|
55
|
+
name: >-
|
56
|
+
Move new `{{ gem_build_filename }}` file to `{{ gem_build_path }}`
|
57
|
+
command: >-
|
58
|
+
mv {{ gem_build_filename | quote }} {{ gem_build_path | quote }}
|
59
|
+
args:
|
60
|
+
chdir: >-
|
61
|
+
{{ gem_root }}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
# meta file for qb.install_gem
|
3
|
+
allow_duplicates: yes
|
4
|
+
|
5
|
+
dependencies:
|
6
|
+
- role: qb/gem/build
|
7
|
+
|
8
|
+
- role: nrser.rbenv_gem
|
9
|
+
rbenv_gem_rubies: >-
|
10
|
+
{{ gem_install_rubies }}
|
11
|
+
rbenv_gem_name: >-
|
12
|
+
{{ gem_root_facts.gem.name }}
|
13
|
+
# Ugh... this is named "source" because that's what it's called in Ansible's
|
14
|
+
# `gem` module, but it's *not* the source directory, it's the `.gem` file
|
15
|
+
rbenv_gem_source: >-
|
16
|
+
{{ gem_build_path }}
|
17
|
+
rbenv_gem_state: present
|
File without changes
|
@@ -4,6 +4,9 @@
|
|
4
4
|
*.s#?
|
5
5
|
*.b#?
|
6
6
|
*.l#?
|
7
|
+
*.b$?
|
8
|
+
*.s$?
|
9
|
+
*.l$?
|
7
10
|
|
8
11
|
# Eagle project file
|
9
12
|
# It contains a serial number and references to the file structure
|
@@ -31,14 +34,19 @@ eagle.epf
|
|
31
34
|
*.drl
|
32
35
|
*.gpi
|
33
36
|
*.pls
|
37
|
+
*.ger
|
38
|
+
*.gpi
|
39
|
+
*.xln
|
34
40
|
|
35
41
|
*.drd
|
36
42
|
*.drd.*
|
37
43
|
|
44
|
+
*.s#*
|
45
|
+
*.b#*
|
46
|
+
|
38
47
|
*.info
|
39
48
|
|
40
49
|
*.eps
|
41
50
|
|
42
51
|
# file locks introduced since 7.x
|
43
52
|
*.lck
|
44
|
-
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# General Git ignore file for Python
|
2
|
+
#
|
3
|
+
# Packaging and distribution patterns have been moved out to
|
4
|
+
#
|
5
|
+
# //Python/Packaging.gitignore
|
6
|
+
#
|
7
|
+
|
1
8
|
# Byte-compiled / optimized / DLL files
|
2
9
|
__pycache__/
|
3
10
|
*.py[cod]
|
@@ -6,25 +13,6 @@ __pycache__/
|
|
6
13
|
# C extensions
|
7
14
|
*.so
|
8
15
|
|
9
|
-
# Distribution / packaging
|
10
|
-
.Python
|
11
|
-
build/
|
12
|
-
develop-eggs/
|
13
|
-
dist/
|
14
|
-
downloads/
|
15
|
-
eggs/
|
16
|
-
.eggs/
|
17
|
-
lib/
|
18
|
-
lib64/
|
19
|
-
parts/
|
20
|
-
sdist/
|
21
|
-
var/
|
22
|
-
wheels/
|
23
|
-
*.egg-info/
|
24
|
-
.installed.cfg
|
25
|
-
*.egg
|
26
|
-
MANIFEST
|
27
|
-
|
28
16
|
# PyInstaller
|
29
17
|
# Usually these files are written by a python script from a template
|
30
18
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Patterns that are only applicable if you are packaging and distributing
|
2
|
+
# your Python source.
|
3
|
+
#
|
4
|
+
# Moved here from `//Python.gitignore` because they include several common
|
5
|
+
# directory names *that are ignored anywhere in the directory tree* and you
|
6
|
+
# probably don't want or need those sweeping effects for the common case of
|
7
|
+
# ignoring `*.pyc` and the like.
|
8
|
+
#
|
9
|
+
|
10
|
+
.Python
|
11
|
+
# env/
|
12
|
+
build/
|
13
|
+
develop-eggs/
|
14
|
+
dist/
|
15
|
+
downloads/
|
16
|
+
eggs/
|
17
|
+
.eggs/
|
18
|
+
lib/
|
19
|
+
lib64/
|
20
|
+
parts/
|
21
|
+
sdist/
|
22
|
+
var/
|
23
|
+
*.egg-info/
|
24
|
+
.installed.cfg
|
25
|
+
*.egg
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# General Git ignore file for Ruby, including support for:
|
2
|
+
#
|
3
|
+
# - Bundler
|
4
|
+
# - RDoc and Yard
|
5
|
+
# - RBEnv and RVM
|
6
|
+
# - DotEnv (optional)
|
7
|
+
#
|
8
|
+
# Additional support is available in separate ignore files:
|
9
|
+
#
|
10
|
+
# - Gem.gitignore (for gem source directories)
|
11
|
+
# - Rails.gitignore
|
12
|
+
# - RubyMotion.gitignore
|
13
|
+
#
|
14
|
+
|
1
15
|
/*.gem
|
2
16
|
*.rbc
|
3
17
|
/.config
|
@@ -24,11 +38,7 @@
|
|
24
38
|
/vendor/bundle
|
25
39
|
/lib/bundler/man/
|
26
40
|
|
27
|
-
# for a library or gem,
|
28
|
-
# intended to run in multiple environments; otherwise, check them in:
|
29
|
-
# Gemfile.lock
|
30
|
-
# .ruby-version
|
31
|
-
# .ruby-gemset
|
41
|
+
# for a library or gem, add `Gem.gitignore`
|
32
42
|
|
33
43
|
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
44
|
.rvmrc
|
@@ -16,8 +16,8 @@
|
|
16
16
|
|
17
17
|
# Don't ignore Umbraco packages (VisualStudio.gitignore mistakes this for a NuGet packages folder)
|
18
18
|
# Make sure to include details from VisualStudio.gitignore BEFORE this
|
19
|
-
!**/App_Data/[Pp]ackages
|
20
|
-
!**/[Uu]mbraco/[Dd]eveloper/[Pp]ackages
|
19
|
+
!**/App_Data/[Pp]ackages/*
|
20
|
+
!**/[Uu]mbraco/[Dd]eveloper/[Pp]ackages/*
|
21
21
|
|
22
22
|
# ImageProcessor DiskCache
|
23
23
|
**/App_Data/cache/
|
@@ -219,6 +219,10 @@ ClientBin/
|
|
219
219
|
*.publishsettings
|
220
220
|
orleans.codegen.cs
|
221
221
|
|
222
|
+
# Including strong name files can present a security risk
|
223
|
+
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
224
|
+
#*.snk
|
225
|
+
|
222
226
|
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
223
227
|
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
224
228
|
#bower_components/
|
@@ -1,64 +1,44 @@
|
|
1
1
|
---
|
2
|
-
|
2
|
+
##############################################################################
|
3
|
+
# QB metadata for `{{ role_role_name }}` role.
|
3
4
|
#
|
4
|
-
#
|
5
|
+
# QB settings for this role.
|
6
|
+
#
|
7
|
+
# @see http://www.rubydoc.info/gems/qb/file/doc/qb_roles/metadata.md
|
5
8
|
#
|
9
|
+
##############################################################################
|
6
10
|
|
7
|
-
#
|
8
|
-
description:
|
11
|
+
# Shown in help output, etc.
|
12
|
+
description: >-
|
13
|
+
TODO describe {{ role_role_name }} role
|
9
14
|
|
10
|
-
# Gemspec-style requirements. Right now only
|
11
|
-
# generalize in the future.
|
15
|
+
# Gemspec-style requirements. Right now only `.gems.qb` is used.
|
12
16
|
requirements:
|
13
17
|
gems:
|
14
18
|
qb: ~> 0.3.0
|
15
19
|
|
16
|
-
#
|
20
|
+
# Prefix for role variables
|
17
21
|
var_prefix: {{ role_namespaceless }}
|
18
22
|
|
19
|
-
#
|
20
|
-
# positional argument. if a positional argument is provided it will
|
21
|
-
# override the method defined here.
|
23
|
+
# How to get a default for `DIRECTORY` arg if not provided by user.
|
22
24
|
#
|
23
|
-
#
|
25
|
+
# @see http://www.rubydoc.info/gems/qb/file/doc/qb_roles/metadata/default_dir.md
|
24
26
|
#
|
25
|
-
#
|
26
|
-
# - require the value on the command line.
|
27
|
-
# - false
|
28
|
-
# - don't provide qb_dir (means doesn't load or save options either).
|
29
|
-
# - git_root
|
30
|
-
# - use the git root of the directory that the `qb` command is invoked
|
31
|
-
# from. useful for 'project-centric' commands so they can be invoked
|
32
|
-
# from anywhere in the repo.
|
33
|
-
# - cwd
|
34
|
-
# - use the directory the `qb` command is invoked form.
|
35
|
-
# - {exe: PATH}
|
36
|
-
# - invoke an executable, passing a JSON serialization of the options
|
37
|
-
# mapping their CLI names to values. path can be relative to role
|
38
|
-
# directory.
|
39
|
-
# - {find_up: FILENAME}
|
40
|
-
# - starting at the current directory and climbing up to parent
|
41
|
-
# directories, use the first one that contains FILENAME. error
|
42
|
-
# if none is found.
|
43
|
-
default_dir: null
|
27
|
+
default_dir: null # means use *must* provide `DIRECTORY` arg
|
44
28
|
|
45
|
-
# If `true`, QB will ensure
|
46
|
-
#
|
47
|
-
# For legacy reasons, this defaults to `true` if not present, but we want to
|
48
|
-
# default declare it as `false` here so new roles can turn it on only if
|
49
|
-
# they need it.
|
50
|
-
#
|
29
|
+
# If `true`, QB will ensure `DIRECTORY` exists before starting the play.
|
51
30
|
mkdir: false
|
52
31
|
|
53
|
-
#
|
32
|
+
# Default user to become for play
|
54
33
|
default_user: null
|
55
34
|
|
56
|
-
#
|
35
|
+
# Save options in `.qb-options.yml` files
|
57
36
|
save_options: true
|
58
37
|
|
59
|
-
#
|
38
|
+
# Options to pass to `ansible-playbook`
|
60
39
|
ansible_options: {}
|
61
40
|
|
41
|
+
# Role CLI options that become Ansible vars
|
62
42
|
options: []
|
63
43
|
# - name: example
|
64
44
|
# description: an example of a variable.
|