{"id":23317568,"url":"https://github.com/remedyit/inprovise-fork","last_synced_at":"2025-04-07T04:30:17.876Z","repository":{"id":54743114,"uuid":"68027539","full_name":"RemedyIT/Inprovise-Fork","owner":"RemedyIT","description":"Extension adding support for forking provisioning commands from Inprovise scripts.","archived":false,"fork":false,"pushed_at":"2021-02-01T09:36:14.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T08:52:47.890Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/RemedyIT.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}},"created_at":"2016-09-12T16:37:48.000Z","updated_at":"2021-02-01T09:36:17.000Z","dependencies_parsed_at":"2022-08-14T01:21:01.707Z","dependency_job_id":null,"html_url":"https://github.com/RemedyIT/Inprovise-Fork","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RemedyIT%2FInprovise-Fork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RemedyIT%2FInprovise-Fork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RemedyIT%2FInprovise-Fork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RemedyIT%2FInprovise-Fork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RemedyIT","download_url":"https://codeload.github.com/RemedyIT/Inprovise-Fork/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247593750,"owners_count":20963776,"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-20T16:34:30.582Z","updated_at":"2025-04-07T04:30:17.859Z","avatar_url":"https://github.com/RemedyIT.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nInprovise Fork\n==============\n\nThis project implements an extension for the Inprovise provisioning tool providing a `fork` method to the execution contexts\nof Inprovise scripts allowing scripts to fork off provisioning commands (`apply`, `revert`, `validate` or `trigger`) for\nother nodes.\n\n[![Build Status](https://travis-ci.org/mcorino/Inprovise-Fork.png)](https://travis-ci.org/mcorino/Inprovise-Fork)\n[![Code Climate](https://codeclimate.com/github/RemedyIT/Inprovise-Fork/badges/gpa.png)](https://codeclimate.com/github/RemedyIT/Inprovise-Fork)\n[![Test Coverage](https://codeclimate.com/github/RemedyIT/Inprovise-Fork/badges/coverage.png)](https://codeclimate.com/github/RemedyIT/Inprovise-Fork/coverage)\n[![Gem Version](https://badge.fury.io/rb/inprovise-fork.png)](https://badge.fury.io/rb/inprovise-fork)\n\nInstallation\n------------\n\n    $ gem install inprovise-fork\n\nUsage\n-----\n\nAdd the following to (for example) your Inprovise project's `rigrc` file.\n\n````ruby\nrequire 'inprovise/fork'\n````\n\nSyntax\n------\n\n````ruby\nfork(mode = :sync).apply('script', 'name'[, 'name'[, ...]][, config={}])\nfork(mode = :sync).revert('script', 'name'[, 'name'[, ...]][, config={}])\nfork(mode = :sync).validate('script', 'name'[, 'name'[, ...]][, config={}])\nfork(mode = :sync).trigger('action', 'name'[, 'name'[, ...]][, config={}])\n````\n\nor\n\n````ruby\nfork(mode = :sync) do\n  apply('script', 'name'[, 'name'[, ...]][, config={}])\nend\nfork(mode = :sync) do\n  revert('script', 'name'[, 'name'[, ...]][, config={}])\nend\nfork(mode = :sync) do\n  validate('script', 'name'[, 'name'[, ...]][, config={}])\nend\nfork(mode = :sync) do\n  trigger('action', 'name'[, 'name'[, ...]][, config={}])\nend\n````\n\nThe `mode` argument can be `:sync` (default) or `:async`. With the first the provisioning methods will not return\nuntil the provisioning process they kicked off has finished. With the latter the provisioning methods kick off the\nprovisioning process in parallel and return immediately.\n\nThe provisioning methods return a reference to the forking execution context allowing provisioning methods to be\nchained like:\n\n````ruby\nfork.apply('script', 'node1').trigger('action', 'node1')\n\n````\n\nExample\n-------\n\nBy combining the [Inprovise-VBox](https://github.com/mcorino/Inprovise-VBox) plugin and the [Inprovise-Fork](https://github.com/mcorino/Inprovise-Fork) plugin\nprovisioning scripts could add a virtual machine on a host server, register an Inprovise node and provision that new node with a single\n`rig` command using a scheme like this:\n\n````ruby\n# assumes rigrc has been defined with\n# require 'inprovise/vbox' and\n# require 'inprovise/fork'\n\ninclude 'rubysetup.rb'  # includes a scheme defining scripts to control ruby provisioning dependencies\n\nscript 'vmSetup' do\n\n  validate do\n    # check node setup\n    trigger 'gem:exists', 'rails'\n  end\n\n  apply do\n    trigger 'gem:install', 'rails'\n  end\n\n  revert do\n    trigger 'gem:uninstall', 'rails'\n  end\n\nend\n\n\nvbox 'myVM' do\n    configuration ({\n      :name =\u003e 'MyVM',\n      :image =\u003e '/remote/image/path/MyVM.qcow2',\n      :memory =\u003e 1024,\n      :cpus =\u003e 2\n    })\n\n    apply do\n      fork(:async).apply('vmSetup', 'MyVM')\n    end\n\n    revert do\n      # in real life you may not want to do this to be able to reinstate\n      # the VM faster with all setup already in place\n      fork(:sync).revert('vmSetup', 'MyVM')\n    end\nend\n\nend\n\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremedyit%2Finprovise-fork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremedyit%2Finprovise-fork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremedyit%2Finprovise-fork/lists"}