qb 0.1.45 → 0.1.46
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/role.rb +33 -7
- data/lib/qb/version.rb +1 -1
- data/library/qb_facts.py +6 -0
- data/roles/qb.git_repo/defaults/main.yml +1 -0
- data/roles/qb.git_repo/meta/main.yml +1 -0
- data/roles/qb.git_repo/tasks/main.yml +2 -2
- data/roles/qb.gitignore/defaults/main.yml +1 -0
- data/roles/qb.gitignore/files/gitignore/Global/OSX.gitignore +1 -0
- data/roles/qb.gitignore/tasks/main.yml +7 -2
- data/roles/qb.install/defaults/main.yml +17 -2
- data/roles/qb.install/meta/main.yml +8 -2
- data/roles/qb.install/meta/qb.yml +6 -0
- data/roles/qb.install/tasks/create.yml +4 -0
- data/roles/qb.install/tasks/main.yml +3 -1
- data/roles/qb.project/defaults/main.yml +2 -1
- data/roles/qb.project/meta/main.yml +2 -1
- data/roles/qb.project/meta/qb.yml +4 -0
- data/roles/qb.project/tasks/dev.yml +1 -1
- data/roles/qb.project/tasks/main.yml +6 -6
- data/roles/qb.qb_role/.qb-options.yml +1 -0
- data/roles/qb.qb_role/defaults/main.yml +5 -1
- data/roles/qb.qb_role/tasks/main.yml +2 -2
- data/roles/qb.qb_role/tasks/module.yml +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff68700805b2dbcd27abea8754ef0c5ea66e2151
|
4
|
+
data.tar.gz: 5ca65baf700375df21a47b3b225fc6cf396bcff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbe87af1aa353cc72495d365b90d0491a92dee4d3b9f7dfa69ca398f3efb2dcfe3a7ac475ef73f3aedc966af8af9d6bb8e6ea82215d59c9a6de78ff574f48ea0
|
7
|
+
data.tar.gz: cb7da6e5098071a6c59371e254e04338d516f4cf507e65ea01935885f1d0fab7ba6e9dc5ce8fe9495e8d9269143c2a091a93c62d1680c0f31a88e823693f68a1
|
data/lib/qb/role.rb
CHANGED
@@ -138,17 +138,43 @@ module QB
|
|
138
138
|
|
139
139
|
# get an array of QB::Role that match an input string
|
140
140
|
def self.matches input
|
141
|
+
# keep this here to we don't re-gen every loop
|
141
142
|
available = self.available
|
142
143
|
|
144
|
+
# first off, see if input matches any relative paths exactly
|
143
145
|
available.each {|role|
|
144
|
-
# exact match to relative path
|
145
146
|
return [role] if role.rel_path.to_s == input
|
146
|
-
}
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
147
|
+
}
|
148
|
+
|
149
|
+
# create an array of "separator" variations to try *exact* matching
|
150
|
+
# against. in order of preference:
|
151
|
+
#
|
152
|
+
# 1. exact input
|
153
|
+
# - this means if you ended up with roles that actually *are*
|
154
|
+
# differnetiated by '_/-' differences (which, IMHO, is a
|
155
|
+
# horrible fucking idea), you can get exactly what you ask for
|
156
|
+
# as a first priority
|
157
|
+
# 2. input with '-' changed to '_'
|
158
|
+
# - prioritized because convetion is to underscore-separate
|
159
|
+
# role names.
|
160
|
+
# 3. input with '_' changed to '-'
|
161
|
+
# - really just for convience's sake so you don't really have to
|
162
|
+
# remember what separator is used.
|
163
|
+
#
|
164
|
+
separator_variations = [
|
165
|
+
input,
|
166
|
+
input.gsub('-', '_'),
|
167
|
+
input.gsub('_', '_'),
|
168
|
+
]
|
169
|
+
|
170
|
+
separator_variations.each {|variation|
|
171
|
+
available.each {|role|
|
172
|
+
# exact match to full name
|
173
|
+
return [role] if role.name == variation
|
174
|
+
}.each {|role|
|
175
|
+
# exact match without the namespace prefix ('qb.' or similar)
|
176
|
+
return [role] if role.namespaceless == variation
|
177
|
+
}
|
152
178
|
}
|
153
179
|
|
154
180
|
# see if we prefix match any full names
|
data/lib/qb/version.rb
CHANGED
data/library/qb_facts.py
CHANGED
@@ -18,6 +18,9 @@ def gemspec_path(dir):
|
|
18
18
|
|
19
19
|
|
20
20
|
def is_gem(dir):
|
21
|
+
if dir is None:
|
22
|
+
return False
|
23
|
+
|
21
24
|
return dir and bool(gemspec_path(dir))
|
22
25
|
|
23
26
|
|
@@ -26,6 +29,9 @@ def package_json_path(dir):
|
|
26
29
|
|
27
30
|
|
28
31
|
def has_package_json(dir):
|
32
|
+
if dir is None:
|
33
|
+
return False
|
34
|
+
|
29
35
|
return os.path.isfile(package_json_path(dir))
|
30
36
|
|
31
37
|
|
@@ -0,0 +1 @@
|
|
1
|
+
macOS.gitignore
|
@@ -1,16 +1,21 @@
|
|
1
1
|
---
|
2
2
|
# tasks file for qb.gitignore
|
3
3
|
|
4
|
+
- name: create directory
|
5
|
+
file:
|
6
|
+
path: "{{ gitignore_dest }}"
|
7
|
+
state: directory
|
8
|
+
|
4
9
|
- name: create .gitignore
|
5
10
|
copy:
|
6
11
|
content: ''
|
7
|
-
dest: "{{
|
12
|
+
dest: "{{ gitignore_dest }}/.gitignore"
|
8
13
|
force: "{{ gitignore_force }}"
|
9
14
|
|
10
15
|
- name: modify .gitignore
|
11
16
|
blockinfile:
|
12
17
|
content: "{{ lookup('file', 'gitignore/' + gitignore_name + '.gitignore') }}"
|
13
|
-
dest: "{{
|
18
|
+
dest: "{{ gitignore_dest }}/.gitignore"
|
14
19
|
beginmarker: |
|
15
20
|
{{ '#' * 78 }}
|
16
21
|
# BEGIN {{ gitignore_name }}.gitignore
|
@@ -2,8 +2,23 @@
|
|
2
2
|
# defaults file for qb.install
|
3
3
|
|
4
4
|
install_path: "{{ qb_user_roles_dir }}"
|
5
|
-
|
5
|
+
|
6
|
+
install_src: "{% if install_create -%}
|
7
|
+
{{ ansible_env.GITHUB_HOME }}/{{ install_name.split('.')[0] }}/ansible-{{ install_name }}
|
8
|
+
{%- else -%}
|
9
|
+
{{ install_name.split('.')[0] }}/ansible-{{ install_name }}
|
10
|
+
{%- endif %}"
|
11
|
+
|
6
12
|
install_version: master
|
13
|
+
|
7
14
|
install_force: false
|
15
|
+
|
8
16
|
install_update: false
|
9
|
-
|
17
|
+
|
18
|
+
install_link: "{% if install_create -%}
|
19
|
+
true
|
20
|
+
{%- else -%}
|
21
|
+
false
|
22
|
+
{%- endif %}"
|
23
|
+
|
24
|
+
install_create: false
|
@@ -3,6 +3,12 @@
|
|
3
3
|
|
4
4
|
allow_duplicates: yes
|
5
5
|
|
6
|
-
dependencies: []
|
6
|
+
dependencies: # []
|
7
7
|
# - role: role-name
|
8
|
-
|
8
|
+
- role: qb.qb_role
|
9
|
+
when: "{{ install_create }}"
|
10
|
+
role_dest: "{{ install_src }}"
|
11
|
+
role_role_name: "{{ install_name }}"
|
12
|
+
role_project: true
|
13
|
+
project_hub: true
|
14
|
+
project_dest: "{{ install_src }}"
|
@@ -1,7 +1,8 @@
|
|
1
1
|
---
|
2
2
|
# defaults file for qb.project
|
3
|
+
project_dest: "{{ qb_dir }}"
|
3
4
|
project_owner: "{{ ansible_env.GITHUB_USER }}"
|
4
|
-
project_name: "{{
|
5
|
+
project_name: "{{ project_dest | realpath | basename }}"
|
5
6
|
project_bin: true
|
6
7
|
project_dev: true
|
7
8
|
project_dev_bin: true
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
- name: create /bin directory
|
8
8
|
git_mkdir:
|
9
|
-
path: "{{
|
9
|
+
path: "{{ project_dest }}/bin"
|
10
10
|
when: project_bin
|
11
11
|
|
12
12
|
# dev
|
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
- name: create tmp directory
|
22
22
|
git_mkdir:
|
23
|
-
path: "{{
|
23
|
+
path: "{{ project_dest }}/tmp"
|
24
24
|
# have to explicitly commit it since it's ignored
|
25
25
|
commit: true
|
26
26
|
when: project_tmp
|
@@ -28,7 +28,7 @@
|
|
28
28
|
- name: ignore tmp dir in git
|
29
29
|
lineinfile:
|
30
30
|
line: /tmp
|
31
|
-
dest: "{{
|
31
|
+
dest: "{{ project_dest }}/.gitignore"
|
32
32
|
when: project_tmp
|
33
33
|
|
34
34
|
# readme
|
@@ -37,7 +37,7 @@
|
|
37
37
|
- name: create readme
|
38
38
|
template:
|
39
39
|
src: README.md.j2
|
40
|
-
dest: "{{
|
40
|
+
dest: "{{ project_dest }}/README.md"
|
41
41
|
force: "{{ project_force }}"
|
42
42
|
when: project_readme
|
43
43
|
|
@@ -47,7 +47,7 @@
|
|
47
47
|
- name: run `hub create`
|
48
48
|
command: "hub create{% if project_private %} -p{% endif %} {{ project_owner }}/{{ project_name }}"
|
49
49
|
args:
|
50
|
-
chdir: "{{
|
50
|
+
chdir: "{{ project_dest }}"
|
51
51
|
when: project_hub
|
52
52
|
|
53
53
|
# qb artifacts
|
@@ -56,5 +56,5 @@
|
|
56
56
|
- name: ignore .qb-playbook.yml
|
57
57
|
lineinfile:
|
58
58
|
line: .qb-playbook.yml
|
59
|
-
dest: "{{
|
59
|
+
dest: "{{ project_dest }}/.gitignore"
|
60
60
|
when: project_tmp
|
@@ -3,13 +3,13 @@
|
|
3
3
|
|
4
4
|
- name: create meta directory
|
5
5
|
file:
|
6
|
-
path: "{{
|
6
|
+
path: "{{ role_dest }}/meta"
|
7
7
|
state: directory
|
8
8
|
|
9
9
|
- name: create meta/qb.yml
|
10
10
|
template:
|
11
11
|
src: qb.yml.j2
|
12
|
-
dest: "{{
|
12
|
+
dest: "{{ role_dest }}/meta/qb.yml"
|
13
13
|
force: false
|
14
14
|
|
15
15
|
- include: module.yml
|
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
- set_fact:
|
3
3
|
qb_role_module_class: "{{ qb_role_module | class_case }}"
|
4
|
-
qb_role_module_path: "{{
|
4
|
+
qb_role_module_path: "{{ role_dest }}/library/{{ qb_role_module }}"
|
5
5
|
|
6
6
|
- name: "create {{ qb_role_module }} module"
|
7
7
|
template:
|
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.46
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nrser
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -385,6 +385,7 @@ files:
|
|
385
385
|
- roles/qb.gitignore/files/gitignore/Global/NetBeans.gitignore
|
386
386
|
- roles/qb.gitignore/files/gitignore/Global/Ninja.gitignore
|
387
387
|
- roles/qb.gitignore/files/gitignore/Global/NotepadPP.gitignore
|
388
|
+
- roles/qb.gitignore/files/gitignore/Global/OSX.gitignore
|
388
389
|
- roles/qb.gitignore/files/gitignore/Global/Otto.gitignore
|
389
390
|
- roles/qb.gitignore/files/gitignore/Global/README.md
|
390
391
|
- roles/qb.gitignore/files/gitignore/Global/Redcar.gitignore
|
@@ -502,6 +503,7 @@ files:
|
|
502
503
|
- roles/qb.install/defaults/main.yml
|
503
504
|
- roles/qb.install/meta/main.yml
|
504
505
|
- roles/qb.install/meta/qb.yml
|
506
|
+
- roles/qb.install/tasks/create.yml
|
505
507
|
- roles/qb.install/tasks/git.yml
|
506
508
|
- roles/qb.install/tasks/link.yml
|
507
509
|
- roles/qb.install/tasks/main.yml
|