ansible / mazer

Experimental Ansible Galaxy Content Manager
GNU General Public License v3.0
114 stars 18 forks source link

Release artifact `build` command #116

Closed chouseknecht closed 6 years ago

chouseknecht commented 6 years ago

We've been given the green light to move forward with Artifact Build and Import Proposal

In support of that, Mazer needs to have a build command that does the following, as taken directly from the proposal:

From within the root of the project (the Collection or repository directory), the user runs the mazer build command to create a build artifact, which does the following:

alikins commented 6 years ago

for https://github.com/ansible/mazer/issues/116, for the stuff in the tarball (releases/v1.0.0.tar.gz), what should the name of the top level dir be if there is one?

ie, when v1.0.0.tar.gz is extracted, what would 'some_dir' be below (if there is a top level dir)?

some_dir/
some_dir/MANIFEST.json
some_dir/galaxy.yml
some_dir/README.md
some_dir/roles/
some_dir/roles/some_role/
some_dir/roles/some_role/meta/
some_dir/roles/some_role/meta/main.yml
some_dir/callback_plugins/
some_dir/callback_plugins/some_callback.py
alikins commented 6 years ago

existing traditional role content archives as created by github end up with names like "ansible-role-nginx-2.5.0/"

github download url: https://github.com/geerlingguy/ansible-role-nginx/archive/2.5.0.tar.gz in tmp as /tmp/tmp-ansible-galaxy-content-archive-q6zy2uwj.tar.gz

galaxy-py27) [newswoop:F27:tmp]$ tar tvfl tmp-ansible-galaxy-content-archive-q6zy2uwj.tar.gz
drwxrwxr-x root/root         0 2017-08-08 14:06 ansible-role-nginx-2.5.0/
-rw-rw-r-- root/root        22 2017-08-08 14:06 ansible-role-nginx-2.5.0/.gitignore
-rw-rw-r-- root/root       866 2017-08-08 14:06 ansible-role-nginx-2.5.0/.travis.yml
-rw-rw-r-- root/root      1080 2017-08-08 14:06 ansible-role-nginx-2.5.0/LICENSE
-rw-rw-r-- root/root     11062 2017-08-08 14:06 ansible-role-nginx-2.5.0/README.md
drwxrwxr-x root/root         0 2017-08-08 14:06 ansible-role-nginx-2.5.0/defaults/
-rw-rw-r-- root/root      2719 2017-08-08 14:06 ansible-role-nginx-2.5.0/defaults/main.yml
drwxrwxr-x root/root         0 2017-08-08 14:06 ansible-role-nginx-2.5.0/handlers/
-rw-rw-r-- root/root       228 2017-08-08 14:06 ansible-role-nginx-2.5.0/handlers/main.yml
drwxrwxr-x root/root         0 2017-08-08 14:06 ansible-role-nginx-2.5.0/meta/
-rw-rw-r-- root/root       644 2017-08-08 14:06 ansible-role-nginx-2.5.0/meta/main.yml
drwxrwxr-x root/root         0 2017-08-08 14:06 ansible-role-nginx-2.5.0/tasks/
-rw-rw-r-- root/root      1050 2017-08-08 14:06 ansible-role-nginx-2.5.0/tasks/main.yml
-rw-rw-r-- root/root       107 2017-08-08 14:06 ansible-role-nginx-2.5.0/tasks/setup-Archlinux.yml
-rw-rw-r-- root/root       251 2017-08-08 14:06 ansible-role-nginx-2.5.0/tasks/setup-Debian.yml
-rw-rw-r-- root/root       240 2017-08-08 14:06 ansible-role-nginx-2.5.0/tasks/setup-FreeBSD.yml
-rw-rw-r-- root/root       196 2017-08-08 14:06 ansible-role-nginx-2.5.0/tasks/setup-OpenBSD.yml
-rw-rw-r-- root/root       283 2017-08-08 14:06 ansible-role-nginx-2.5.0/tasks/setup-RedHat.yml
-rw-rw-r-- root/root       323 2017-08-08 14:06 ansible-role-nginx-2.5.0/tasks/setup-Ubuntu.yml
-rw-rw-r-- root/root      1133 2017-08-08 14:06 ansible-role-nginx-2.5.0/tasks/vhosts.yml
drwxrwxr-x root/root         0 2017-08-08 14:06 ansible-role-nginx-2.5.0/templates/
-rw-rw-r-- root/root      1959 2017-08-08 14:06 ansible-role-nginx-2.5.0/templates/nginx.conf.j2
-rw-rw-r-- root/root       138 2017-08-08 14:06 ansible-role-nginx-2.5.0/templates/nginx.repo.j2
-rw-rw-r-- root/root      1144 2017-08-08 14:06 ansible-role-nginx-2.5.0/templates/vhost.j2
drwxrwxr-x root/root         0 2017-08-08 14:06 ansible-role-nginx-2.5.0/tests/
-rw-rw-r-- root/root       632 2017-08-08 14:06 ansible-role-nginx-2.5.0/tests/README.md
-rw-rw-r-- root/root       434 2017-08-08 14:06 ansible-role-nginx-2.5.0/tests/test.yml
drwxrwxr-x root/root         0 2017-08-08 14:06 ansible-role-nginx-2.5.0/vars/
-rw-rw-r-- root/root       297 2017-08-08 14:06 ansible-role-nginx-2.5.0/vars/Archlinux.yml
-rw-rw-r-- root/root       301 2017-08-08 14:06 ansible-role-nginx-2.5.0/vars/Debian.yml
-rw-rw-r-- root/root       351 2017-08-08 14:06 ansible-role-nginx-2.5.0/vars/FreeBSD.yml
-rw-rw-r-- root/root       331 2017-08-08 14:06 ansible-role-nginx-2.5.0/vars/OpenBSD.yml
-rw-rw-r-- root/root       293 2017-08-08 14:06 ansible-role-nginx-2.5.0/vars/RedHat.yml
alikins commented 6 years ago

For existing multi-content repos something like 'testing.ansible_testing_content' ends up "ansible-testing-content-1.3.0"

github url: https://github.com/atestuseraccount/ansible-testing-content/archive/1.3.0.tar.gz saved as /tmp/tmp-ansible-galaxy-content-archive-f_bsnb2a.tar.gz

tar contents:

(galaxy-py27) [newswoop:F27:tmp]$ tar tvfl /tmp/tmp-ansible-galaxy-content-archive-f_bsnb2a.tar.gz
drwxrwxr-x root/root         0 2018-05-03 09:17 ansible-testing-content-1.3.0/
-rw-rw-r-- root/root         9 2018-05-03 09:17 ansible-testing-content-1.3.0/.gitignore
-rw-rw-r-- root/root     35148 2018-05-03 09:17 ansible-testing-content-1.3.0/LICENSE
-rw-rw-r-- root/root       130 2018-05-03 09:17 ansible-testing-content-1.3.0/README.md
drwxrwxr-x root/root         0 2018-05-03 09:17 ansible-testing-content-1.3.0/action_plugins/
-rw-rw-r-- root/root      3394 2018-05-03 09:17 ansible-testing-content-1.3.0/action_plugins/add_host.py
drwxrwxr-x root/root         0 2018-05-03 09:17 ansible-testing-content-1.3.0/filter_plugins/
-rw-rw-r-- root/root      1857 2018-05-03 09:17 ansible-testing-content-1.3.0/filter_plugins/json_query.py
-rw-rw-r-- root/root      6586 2018-05-03 09:17 ansible-testing-content-1.3.0/filter_plugins/mathstuff.py
drwxrwxr-x root/root         0 2018-05-03 09:17 ansible-testing-content-1.3.0/library/
-rw-rw-r-- root/root      8506 2018-05-03 09:17 ansible-testing-content-1.3.0/library/elasticsearch_plugin.py
-rw-rw-r-- root/root      6546 2018-05-03 09:17 ansible-testing-content-1.3.0/library/kibana_plugin.py
-rw-rw-r-- root/root     15018 2018-05-03 09:17 ansible-testing-content-1.3.0/library/mysql_db.py
-rw-rw-r-- root/root     12671 2018-05-03 09:17 ansible-testing-content-1.3.0/library/mysql_replication.py
-rw-rw-r-- root/root     24111 2018-05-03 09:17 ansible-testing-content-1.3.0/library/mysql_user.py
-rw-rw-r-- root/root      5659 2018-05-03 09:17 ansible-testing-content-1.3.0/library/mysql_variables.py
-rw-rw-r-- root/root      9919 2018-05-03 09:17 ansible-testing-content-1.3.0/library/redis.py
-rw-rw-r-- root/root      7467 2018-05-03 09:17 ansible-testing-content-1.3.0/library/riak.py
drwxrwxr-x root/root         0 2018-05-03 09:17 ansible-testing-content-1.3.0/module_utils/
-rw-rw-r-- root/root      8181 2018-05-03 09:17 ansible-testing-content-1.3.0/module_utils/common.py
-rw-rw-r-- root/root     28180 2018-05-03 09:17 ansible-testing-content-1.3.0/module_utils/helper.py
-rw-rw-r-- root/root     16505 2018-05-03 09:17 ansible-testing-content-1.3.0/module_utils/inventory.py
-rw-rw-r-- root/root      7677 2018-05-03 09:17 ansible-testing-content-1.3.0/module_utils/lookup.py
-rw-rw-r-- root/root      8686 2018-05-03 09:17 ansible-testing-content-1.3.0/module_utils/raw.py
-rw-rw-r-- root/root      8921 2018-05-03 09:17 ansible-testing-content-1.3.0/module_utils/scale.py
drwxrwxr-x root/root         0 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/
drwxrwxr-x root/root         0 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/ansible-role-foobar/
-rw-rw-r-- root/root       539 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/ansible-role-foobar/.travis.yml
-rw-rw-r-- root/root      1328 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/ansible-role-foobar/README.md
drwxrwxr-x root/root         0 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/ansible-role-foobar/defaults/
-rw-rw-r-- root/root        43 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/ansible-role-foobar/defaults/main.yml
drwxrwxr-x root/root         0 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/ansible-role-foobar/handlers/
-rw-rw-r-- root/root        43 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/ansible-role-foobar/handlers/main.yml
drwxrwxr-x root/root         0 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/ansible-role-foobar/meta/

<  # lots of roles stuff cut for brevity >

-rw-rw-r-- root/root        11 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/test-role-d/tests/inventory
-rw-rw-r-- root/root        69 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/test-role-d/tests/test.yml
drwxrwxr-x root/root         0 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/test-role-d/vars/
-rw-rw-r-- root/root        31 2018-05-03 09:17 ansible-testing-content-1.3.0/roles/test-role-d/vars/main.yml
drwxrwxr-x root/root         0 2018-05-03 09:17 ansible-testing-content-1.3.0/strategy_plugins/
-rw-rw-r-- root/root      1251 2018-05-03 09:17 ansible-testing-content-1.3.0/strategy_plugins/debug.py
-rw-rw-r-- root/root     12007 2018-05-03 09:17 ansible-testing-content-1.3.0/strategy_plugins/free.py
-rw-rw-r-- root/root     21259 2018-05-03 09:17 ansible-testing-content-1.3.0/strategy_plugins/linear.py
alikins commented 6 years ago

https://github.com/ansible/mazer/pull/130 has a good chunk of this feature.