{"id":22325532,"url":"https://github.com/jamf/rendr-sdk-groovy","last_synced_at":"2025-06-12T19:37:35.824Z","repository":{"id":145080129,"uuid":"291154092","full_name":"jamf/rendr-sdk-groovy","owner":"jamf","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-30T22:10:39.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-31T07:29:42.524Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-28T22:01:38.000Z","updated_at":"2021-12-30T17:40:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"bab2af25-0276-46a8-8449-327483e1daf0","html_url":"https://github.com/jamf/rendr-sdk-groovy","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamf%2Frendr-sdk-groovy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamf%2Frendr-sdk-groovy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamf%2Frendr-sdk-groovy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamf%2Frendr-sdk-groovy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamf","download_url":"https://codeload.github.com/jamf/rendr-sdk-groovy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245598310,"owners_count":20641884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T02:12:28.836Z","updated_at":"2025-03-26T05:44:41.711Z","avatar_url":"https://github.com/jamf.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rendr SDK for Groovy\n\n_Library to enable scripting in Rendr blueprints_\n\n## Usage\n\n### Running a script\n\nCheck out the help text for details on usage:\n\n    ❯ rendr-sdk-groovy --help\n\n    Usage: rendr-sdk-groovy [-hsV] [-v=\u003ckey=value\u003e]... \u003cscript\u003e\n    A Groovy script runner for rendr\n          \u003cscript\u003e              The script file to run.\n      -h, --help                Show this help message and exit.\n      -s, --stacktrace          Print stacktrace on error.\n      -v, --value=\u003ckey=value\u003e   Value used in script (flag may be repeated).\n      -V, --version             Print version information and exit.\n\nRunning a script looks like this:\n\n    rendr-sdk-groovy upgrade-v3.groovy --value name=foo --value version=42\n\n### Writing a script\n\nBlueprint authors can use this library to simplify creating scripts, especially\nfor blueprint upgrades from one version to the next. The library provides a\nnumber of DSL commands:\n\n* `create` files or directories\n* `move` files or directories\n* `write` text to file\n* `append` text to file\n* `prepend` text to file\n* `insert` text in file\n* `replace` text in file\n* `git` commands\n* `script` for generic Groovy code\n\nHere is a sample script using these DSL commands:\n\n```groovy\ninsert 'echo \"hi!\"' into 'hello.sh' after '#!sh\\n'\nreplace 'hello, world!' with \"hello, $name!\" inside 'hello.sh'  // references 'name' variable from values flag\ngit \"mv hello.sh ${values.name}.sh\"  // this also references 'name', but this time from the 'values' map\n\ncreate 'hello.log'\ngit 'add hello.log'\n\nscript {\n    files = []\n    dir('src').eachFileRecurse(FileType.FILES) { file -\u003e\n        files \u003c\u003c file\n    }\n    println \"All files in src:\"\n    files.sort().each { println it.path }\n}\n```\n\n### Available functions\n\nFunction                                                      | Example\n-------                                                       | -------\n`file(String path)`                                           | `file('hello.sh')`\n`dir(String path)`                                            | `dir('foo')`\n`create(String file)`                                         | `create 'hello.sh'`\n`create(File file)`                                           | `create file('hello.sh')`\n`create(Dir dir)`                                             | `create dir('app')`\n`create(String file).write(String text)`                      | `create 'hello.sh' write 'echo hi'`\n`move(String file).to(String path)`                           | `move 'hello.sh' to 'foo/hello.sh'`\n`append(String text).to(String file)`                         | `append 'echo \"hi $1\"' to 'hello.sh'`\n`prepend(String text).to(String file)`                        | `prepend 'echo \"hi $1\"' to 'hello.sh'`\n`insert(String text).into(String file).after(String pattern)` | `insert 'echo \"hi!\"' into 'hello.sh' after '#!sh\\n'`\n`replace(String text).with(String text).inside(String file)`  | `replace 'hello, world!' with 'hi, world!' inside 'hello.sh'`\n`git(String command)`                                         | `git 'add hello.sh'`\n`script(Closure block)`                                       | `script { println \"System properties: ${args.split().findAll { it.startsWith('-D') }}\"}`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamf%2Frendr-sdk-groovy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamf%2Frendr-sdk-groovy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamf%2Frendr-sdk-groovy/lists"}