qb 0.1.48 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/qb/version.rb +1 -1
- data/plugins/filter_plugins/version.py +18 -0
- data/roles/qb.git_repo/meta/main.yml +4 -0
- data/roles/qb.package_json_info/defaults/main.yml +5 -0
- data/roles/qb.package_json_info/meta/main.yml +9 -0
- data/roles/qb.package_json_info/meta/qb.yml +60 -0
- data/roles/qb.package_json_info/tasks/main.yml +18 -0
- data/roles/qb.read_json/defaults/main.yml +5 -0
- data/roles/qb.read_json/meta/main.yml +6 -0
- data/roles/qb.read_json/meta/qb.yml +70 -0
- data/roles/qb.read_json/tasks/main.yml +23 -0
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed96cc13dcc121fa80f3b32515c33e3e2f93cef3
|
4
|
+
data.tar.gz: a96f9605215fea222673ca113e22d4922c98447b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20159e67d810fb30d67c1280cfb7c4a2eca725257929b533953d029131f9aa8f1788247e7bba35cf2a2ba6498c24544209cb2a220c10210f7fb02c1caea3eed4
|
7
|
+
data.tar.gz: 9f06c0a965378d78b27e80a55e775e1300de7c4cbba704f27c158311355db0fe7b64211f22091ebaf6f4068e35a44bf833a02ada7a381f66b7ba3ab4f77bab37
|
data/lib/qb/version.rb
CHANGED
@@ -3,6 +3,7 @@ __metaclass__ = type
|
|
3
3
|
|
4
4
|
import subprocess
|
5
5
|
import os
|
6
|
+
import json
|
6
7
|
|
7
8
|
from ansible.errors import AnsibleError
|
8
9
|
|
@@ -47,12 +48,29 @@ def semver_inc(version, level = None, preid = None):
|
|
47
48
|
return out.rstrip()
|
48
49
|
|
49
50
|
|
51
|
+
def semver_parse(version):
|
52
|
+
'''parse semver.
|
53
|
+
'''
|
54
|
+
|
55
|
+
stmt = (
|
56
|
+
'''console.log(JSON.stringify(require('semver')(%s), null, 2))''' %
|
57
|
+
json.dumps(version)
|
58
|
+
)
|
59
|
+
|
60
|
+
cmd = ['node', '--eval', stmt]
|
61
|
+
|
62
|
+
out = subprocess.check_output(cmd)
|
63
|
+
|
64
|
+
return out.rstrip()
|
65
|
+
|
66
|
+
|
50
67
|
class FilterModule(object):
|
51
68
|
''' version manipulation filters '''
|
52
69
|
|
53
70
|
def filters(self):
|
54
71
|
return {
|
55
72
|
'semver_inc': semver_inc,
|
73
|
+
'semver_parse': semver_parse,
|
56
74
|
}
|
57
75
|
|
58
76
|
|
@@ -0,0 +1,60 @@
|
|
1
|
+
---
|
2
|
+
# meta/qb.yml file for qb.package_json_info
|
3
|
+
#
|
4
|
+
# qb settings for this role. see README.md for more info.
|
5
|
+
#
|
6
|
+
|
7
|
+
# description of the role to show in it's help output.
|
8
|
+
description: load package.json into a variable.
|
9
|
+
|
10
|
+
# prefix for role variables
|
11
|
+
var_prefix: null
|
12
|
+
|
13
|
+
# how to get a default for `dir` if it's not provided as the only
|
14
|
+
# positional argument. if a positional argument is provided it will
|
15
|
+
# override the method defined here.
|
16
|
+
#
|
17
|
+
# options:
|
18
|
+
#
|
19
|
+
# - null
|
20
|
+
# - require the value on the command line.
|
21
|
+
# - false
|
22
|
+
# - don't provide qb_dir (means doesn't load or save options either).
|
23
|
+
# - git_root
|
24
|
+
# - use the git root fof the directory that the `qb` command is invoked
|
25
|
+
# from. useful for 'project-centric' commands so they can be invoked
|
26
|
+
# from anywhere in the repo.
|
27
|
+
# - cwd
|
28
|
+
# - use the directory the `qb` command is invoked form.
|
29
|
+
# - {exe: PATH}
|
30
|
+
# - invoke an execuable, passing a JSON serialization of the options
|
31
|
+
# mapping their CLI names to values. path can be relative to role
|
32
|
+
# directory.
|
33
|
+
# - {find_up: FILENAME}
|
34
|
+
# - starting at the current direcotry and climbing up to parent
|
35
|
+
# directories, use the first one that contains FILENAME. error
|
36
|
+
# if none is found.
|
37
|
+
default_dir: null
|
38
|
+
|
39
|
+
# default user to become for play
|
40
|
+
default_user: null
|
41
|
+
|
42
|
+
# set to false to not save options in .qb-options.yml files
|
43
|
+
save_options: false
|
44
|
+
|
45
|
+
options: # []
|
46
|
+
# - name: example
|
47
|
+
# description: an example of a variable.
|
48
|
+
# required: false
|
49
|
+
# type: boolean # boolean (default) | string
|
50
|
+
# short: e
|
51
|
+
- name: dir
|
52
|
+
description: direcotry containing package.json
|
53
|
+
type: string
|
54
|
+
short: p
|
55
|
+
|
56
|
+
- name: dump
|
57
|
+
description: dump value via debug task.
|
58
|
+
type: boolean
|
59
|
+
short: d
|
60
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
# tasks file for qb.package_json_info
|
3
|
+
|
4
|
+
- name: parse version value
|
5
|
+
set_fact:
|
6
|
+
package_json_info_value:
|
7
|
+
value: "{{ read_json_value }}"
|
8
|
+
version: "{{ read_json_value.version | semver_parse }}"
|
9
|
+
|
10
|
+
- name: set var
|
11
|
+
when: package_json_info_var != None
|
12
|
+
set_fact:
|
13
|
+
"{{ package_json_info_var }}": "{{ package_json_info_value }}"
|
14
|
+
|
15
|
+
- name: dump debug output
|
16
|
+
when: package_json_info_dump
|
17
|
+
debug:
|
18
|
+
msg: "{{ package_json_info_value }}"
|
@@ -0,0 +1,70 @@
|
|
1
|
+
---
|
2
|
+
# meta/qb.yml file for qb.read_json
|
3
|
+
#
|
4
|
+
# qb settings for this role. see README.md for more info.
|
5
|
+
#
|
6
|
+
|
7
|
+
# description of the role to show in it's help output.
|
8
|
+
description: >
|
9
|
+
read a json file into a variable. yeah. 'cause you need to do it as a role
|
10
|
+
sometimes.
|
11
|
+
|
12
|
+
# prefix for role variables
|
13
|
+
var_prefix: null
|
14
|
+
|
15
|
+
# how to get a default for `dir` if it's not provided as the only
|
16
|
+
# positional argument. if a positional argument is provided it will
|
17
|
+
# override the method defined here.
|
18
|
+
#
|
19
|
+
# options:
|
20
|
+
#
|
21
|
+
# - null
|
22
|
+
# - require the value on the command line.
|
23
|
+
# - false
|
24
|
+
# - don't provide qb_dir (means doesn't load or save options either).
|
25
|
+
# - git_root
|
26
|
+
# - use the git root fof the directory that the `qb` command is invoked
|
27
|
+
# from. useful for 'project-centric' commands so they can be invoked
|
28
|
+
# from anywhere in the repo.
|
29
|
+
# - cwd
|
30
|
+
# - use the directory the `qb` command is invoked form.
|
31
|
+
# - {exe: PATH}
|
32
|
+
# - invoke an execuable, passing a JSON serialization of the options
|
33
|
+
# mapping their CLI names to values. path can be relative to role
|
34
|
+
# directory.
|
35
|
+
# - {find_up: FILENAME}
|
36
|
+
# - starting at the current direcotry and climbing up to parent
|
37
|
+
# directories, use the first one that contains FILENAME. error
|
38
|
+
# if none is found.
|
39
|
+
default_dir: false
|
40
|
+
|
41
|
+
# default user to become for play
|
42
|
+
default_user: null
|
43
|
+
|
44
|
+
# set to false to not save options in .qb-options.yml files
|
45
|
+
save_options: false
|
46
|
+
|
47
|
+
options: # []
|
48
|
+
# - name: example
|
49
|
+
# description: an example of a variable.
|
50
|
+
# required: false
|
51
|
+
# type: boolean # boolean (default) | string
|
52
|
+
# short: e
|
53
|
+
- name: src
|
54
|
+
description: path to source file.
|
55
|
+
required: true
|
56
|
+
type: string
|
57
|
+
short: s
|
58
|
+
|
59
|
+
- name: var
|
60
|
+
description: variable name to write value into.
|
61
|
+
required: false
|
62
|
+
type: string
|
63
|
+
short: v
|
64
|
+
|
65
|
+
- name: dump
|
66
|
+
description: dump the value via debug task.
|
67
|
+
required: false
|
68
|
+
type: boolean
|
69
|
+
short: d
|
70
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
# tasks file for qb.read_json
|
3
|
+
- name: read file
|
4
|
+
slurp:
|
5
|
+
src: "{{ read_json_src }}"
|
6
|
+
register: read_json_slurp
|
7
|
+
|
8
|
+
- name: parse json
|
9
|
+
set_fact:
|
10
|
+
read_json_value: "{{ read_json_slurp.content | b64decode }}"
|
11
|
+
|
12
|
+
- name: set var
|
13
|
+
when: read_json_var != None
|
14
|
+
set_fact:
|
15
|
+
"{{ read_json_var }}": "{{ read_json_value }}"
|
16
|
+
|
17
|
+
- name: print debug output
|
18
|
+
when: read_json_dump
|
19
|
+
debug:
|
20
|
+
msg:
|
21
|
+
name: "{{ read_json_var }}"
|
22
|
+
value: "{{ read_json_value }}"
|
23
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.49
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nrser
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -530,6 +530,10 @@ files:
|
|
530
530
|
- roles/qb.npm_package/meta/main.yml
|
531
531
|
- roles/qb.npm_package/meta/qb.yml
|
532
532
|
- roles/qb.npm_package/tasks/main.yml
|
533
|
+
- roles/qb.package_json_info/defaults/main.yml
|
534
|
+
- roles/qb.package_json_info/meta/main.yml
|
535
|
+
- roles/qb.package_json_info/meta/qb.yml
|
536
|
+
- roles/qb.package_json_info/tasks/main.yml
|
533
537
|
- roles/qb.project/.qb-options.yml
|
534
538
|
- roles/qb.project/defaults/main.yml
|
535
539
|
- roles/qb.project/files/ansible.cfg
|
@@ -553,6 +557,10 @@ files:
|
|
553
557
|
- roles/qb.qb_role/templates/.gitkeep
|
554
558
|
- roles/qb.qb_role/templates/module.rb.j2
|
555
559
|
- roles/qb.qb_role/templates/qb.yml.j2
|
560
|
+
- roles/qb.read_json/defaults/main.yml
|
561
|
+
- roles/qb.read_json/meta/main.yml
|
562
|
+
- roles/qb.read_json/meta/qb.yml
|
563
|
+
- roles/qb.read_json/tasks/main.yml
|
556
564
|
- roles/qb.release_gem/defaults/main.yml
|
557
565
|
- roles/qb.release_gem/meta/main.yml
|
558
566
|
- roles/qb.release_gem/meta/qb.yml
|