[PDK-748] pdk build CLI Created: 2018/01/02  Updated: 2018/02/28  Resolved: 2018/02/28

Status: Closed
Project: Puppet Development Kit
Component/s: None
Affects Version/s: None
Fix Version/s: PDK 1.4.1

Type: Task Priority: Normal
Reporter: Lindsey Smith Assignee: Tim Sharpe
Resolution: Fixed Votes: 0
Labels: resolved-issue-added
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File pdk-build-workflow.png    
Issue Links:
Relates
relates to PDK-778 Research: open a browser window from ... Open
Template:
Acceptance Criteria:

pdk build -h should show the help section with supporting flags.

Epic Link: pdk build
Team: Puppet Developer Experience
Release Notes: New Feature
Release Notes Summary: This is a new feature that provides the 'pdk build' command. This feature builds the module project into a package that can be uploaded to the Forge.
QA Risk Assessment: Needs Assessment

 Description   

Flags to support:
--debug Will output extra information
--format Will allow output in text or junit and also take in a file path to write to a file. Default: text.
--target-dir Save tar.gz package to a specified file path. Default: <module_root>/pkg/.

Add CLI subcommand for pdk build.

This work should also include a compatibility command of pdk module build, similar to the what we did with pdk new module and pdk module generate.

The subcommand should be hidden for now, until the feature is set to be released.

Mock up of help:

$ pdk build --help
NAME
    build - Builds a package from the module that can be published to the Puppet Forge.
 
USAGE
    pdk build [options]
 
OPTIONS
       --target-dir                  Input the target directory where you want PDK 
                                          to write the package. Default is pkg/ within your module.
 
OPTIONS FOR PDK
    -d --debug                     Enable debug output.
    -f --format=<value>            Specify desired output format. Valid
                                   formats are 'junit', 'text'. You may also
                                   specify a file to which the formatted
                                   output is sent, for example:
                                   '--format=junit:report.xml'. This option
                                   may be specified multiple times if each
                                   option specifies a distinct target file.
    -h --help                      Show help for this command.
       --version                   Show version of pdk.

Mock-up of the shell session:

$ cd my-module
$ pdk build
pdk (INFO): Building my-module version 1.0.0.
Build of my-module has completed successfully. Built package can be found here: pkg/my-module-1.0.0.tar.gz.

Document for inputs on console dialogue: https://docs.google.com/document/d/10HAJVpzkjfE80Mib-hBXpVdGbxtnuSOKPxN03J1fUWc/edit?usp=sharing



 Comments   
Comment by Bryan Jen [ 2018/01/11 ]

cc Rick Monro Added help text and basic mockup of command line interaction.

Comment by Rick Monro [ 2018/01/12 ]

Great, reads as painless from that mockup Quick initial thought - is it worth a nudge at the conclusion of the process to take the user to Forge upload page:

Would you like to upload this to the Forge now? (Y/n)

^ opens https://forge.puppet.com/upload in browser..?

Comment by Rick Monro [ 2018/01/18 ]

This v1 build workflow has been drawn up predominantly for discussion and planning around CL dialogue. Please leave comments/feedback on this doc: https://docs.google.com/presentation/d/17896vyCrMgfkNRqQGvjzjIux_s4NbY1zWcJJCbwtXMI/edit?usp=sharing

Comment by Rick Monro [ 2018/01/26 ]

Document for inputs on console dialogue: https://docs.google.com/document/d/10HAJVpzkjfE80Mib-hBXpVdGbxtnuSOKPxN03J1fUWc/edit?usp=sharing

Revised workflow diagram: https://docs.google.com/presentation/d/17896vyCrMgfkNRqQGvjzjIux_s4NbY1zWcJJCbwtXMI/edit?usp=sharing

Generated at Tue Nov 19 14:45:59 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.