Jira (BOLT-1158) Publish bash helper library

0 views
Skip to first unread message

Cas Donoghue (JIRA)

unread,
Mar 5, 2019, 1:33:02 PM3/5/19
to puppe...@googlegroups.com
Cas Donoghue created an issue
 
Puppet Task Runner / Bug BOLT-1158
Publish bash helper library
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2019/03/05 10:32 AM
Priority: Normal Normal
Reporter: Cas Donoghue

Build up some bash helpers similar to the ruby,python_task_helper s. Given the limitations of bash the helpers will not be as fully featured. One idea that has come up is to build a solution for handling the `null` string value when the JSON representation of nil/null is coerced to a string in the process of "envifying" parameters. 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Adrian Parreiras Horta (JIRA)

unread,
Apr 5, 2019, 4:23:01 PM4/5/19
to puppe...@googlegroups.com

Adrian Parreiras Horta (JIRA)

unread,
Apr 5, 2019, 4:29:02 PM4/5/19
to puppe...@googlegroups.com

Adrian Parreiras Horta (JIRA)

unread,
Apr 5, 2019, 4:34:03 PM4/5/19
to puppe...@googlegroups.com

Adrian Parreiras Horta (JIRA)

unread,
Apr 5, 2019, 4:35:02 PM4/5/19
to puppe...@googlegroups.com
Adrian Parreiras Horta commented on Bug BOLT-1158
 
Re: Publish bash helper library

Here's the `common.sh` I find myself using in tasks at the moment.  Attaching since Jira likes to ruin formatting.

The `fail` function is a bit different from the one going into puppetlabs-service.  It makes $1 the key of the object, the idea being the step that failed can be identified.  Something like

 

fail "install_foo" "it no work" 1 

Produces:

 

 

"install_foo": {
  "status": "error",
  "message": "it no work"
}

With an exit code of 1.

I really like the indirection since you don't have to keep doing things like name=$PT_name, it just makes them available to you by sourcing the script.

The trap and cleanup function would be nice, but I don't think it works as is.

 

 

 

Alex Dreyer (JIRA)

unread,
Apr 16, 2019, 11:55:04 AM4/16/19
to puppe...@googlegroups.com
Alex Dreyer updated an issue
 
Puppet Task Runner / New Feature BOLT-1158
Publish bash helper library
Change By: Alex Dreyer
Issue Type: Bug New Feature

Cas Donoghue (JIRA)

unread,
May 29, 2019, 6:54:33 PM5/29/19
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages