{"id":20409109,"url":"https://github.com/tcorral/ukko","last_synced_at":"2025-09-02T11:07:31.835Z","repository":{"id":29893032,"uuid":"33438566","full_name":"tcorral/ukko","owner":"tcorral","description":"Module that manages the download all the needed repos and build them to have your development environment ready to start working in minutes","archived":false,"fork":false,"pushed_at":"2015-05-26T22:48:53.000Z","size":5528,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-22T18:02:55.159Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","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/tcorral.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":"2015-04-05T11:14:18.000Z","updated_at":"2015-05-08T06:51:35.000Z","dependencies_parsed_at":"2022-08-23T05:00:21.747Z","dependency_job_id":null,"html_url":"https://github.com/tcorral/ukko","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tcorral/ukko","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcorral%2Fukko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcorral%2Fukko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcorral%2Fukko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcorral%2Fukko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcorral","download_url":"https://codeload.github.com/tcorral/ukko/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcorral%2Fukko/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273272579,"owners_count":25075991,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-15T05:39:36.944Z","updated_at":"2025-09-02T11:07:31.814Z","avatar_url":"https://github.com/tcorral.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/l/ukko.svg)](https://www.npmjs.org/package/ukko)\n[![npm](https://img.shields.io/npm/v/ukko.svg)](https://www.npmjs.org/package/ukko)\n[![Build Status](https://travis-ci.org/tcorral/ukko.svg?branch=master)](https://travis-ci.org/tcorral/ukko)\n[![Coverage Status](https://coveralls.io/repos/tcorral/ukko/badge.svg)](https://coveralls.io/r/tcorral/ukko)\n[![Code Climate](https://codeclimate.com/github/tcorral/ukko/badges/gpa.svg)](https://codeclimate.com/github/tcorral/ukko)\n[![Dependency Status](https://david-dm.org/tcorral/ukko.svg?theme=shields.io\u0026style=flat)](https://david-dm.org/tcorral/ukko)\n[![devDependency Status](https://david-dm.org/tcorral/ukko/dev-status.svg?theme=shields.io\u0026style=flat)](https://david-dm.org/tcorral/ukko#info=devDependencies)\n\n\n# ukko\n\nUkko was created as a simple tool to install your development environment at once, but it can also be used to:\n\n* create sym links to folders in your computer\n* download a repo from any repo source (Git, SVN, GITHUB, STASH...)\n* download and extract any zip, rar, tar, tar.gz, war...\n\n## Installation\n\n### Node \n\nDependencies:\n\n* node \u003e= 0.10\n* npm \u003e= 2.0.0\n\n```bash\nnpm install ukko --save\n```\n\n## Usage\n\nUkko usage is very simple, it just needs a source to retrieve an object with an ukko-conf key with the information\nabout the endpoints and commands to be executed before and after retrieving the folder/repo/file.\n          \n```js\nvar ukko = require('ukko');\nukko.installOrUpdate({\n    data: {\n        \"dependencies\": {\n            \"target/folder/path/from/the/root\": \"path/or/url/to/repo\"\n        }\n    }\n});\n``` \n \n### API\n\n#### installOrUpdate\n`ukko.installOrUpdate` gets an argument to be executed:\n\n##### Arguments\n* `config {Object}` \n\n##### Returns\n* `void`\n\n### Config Object\nThe expected configuration could be a JSON file or a javascript object passed directly \nto the  `installOrUpdate` method.\n\n#### Examples of basic config objects\n\nJSON objects:\n\n##### Shared dependencies only\n\n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/folder/path/from/the/root\": \"path/or/url/to/repo\"\n        }\n    }\n}\n```\n\n##### Production environment dependencies by default\n\n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/folder/path/from/the/root\": \"path/or/url/to/repo\"\n        },\n        \"production\": {\n            \"target/folder/path/from/the/root2\": \"path/or/url/to/repo2\"\n        }\n    }\n}\n``` \n     \n##### Development environment dependencies by default\n\n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/folder/path/from/the/root\": \"path/or/url/to/repo\"\n        },\n        \"development\": {\n            \"target/folder/path/from/the/root2\": \"path/or/url/to/repo2\"\n        }\n    }\n}\n```     \n     \n##### Custom environment dependencies\n\n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/folder/path/from/the/root\": \"path/or/url/to/repo\"\n        },\n        \"localEnv\": {\n            \"target/folder/path/from/the/root2\": \"path/or/url/to/repo2\"\n        }\n    }\n}\n```\n\n#### Properties of the config object\n\n##### `data`\n\n##### Type\n* `{Object}` \n\n\nIt can be used to pass the configuration directly to the function in\n\n```json\n{\n    \"data\": {\n        \"dependencies\": {\n            \"target/folder/path/from/the/root\": \"path/or/url/to/repo\"\n        }\n    }\n}\n```\n\n##### `configPath`\n\n##### Type\n* `{String}` \n\nIt expects a path to the json config file.\nIt can be a folder path in your computer or an url to access it remotely.\nWhen we pass the config path it can not be used in conjunction with data property.\nThe config path will try to find the config file and if it doesn´t find the\nfile it will fallback to read the config from the package.json.\n\n\n###### local usage\n\n```json\n{\n    \"configPath\": \"path/to/your/ukko-conf.json\"\n}\n``` \n\n###### remote\n\nRemote URL can be an http/https/ftp\n\n```json\n{\n    \"configPath\": \"http://path/to/your/ukko-conf.json\"\n}\n```\n\n##### `repos`\n\n##### Type\n* `{Array\u003c\u003eString}`\n\nUkko install all the repos from the endpoints by default but you can specify \nan array of repos to be downloaded. The repos should be an array of target \nfolders or keys.\n\n\n```json\n{\n    \"configPath\": \"http://path/to/your/ukko-conf.json\",\n    \"repos\": [ \"target/folder/path/from/the/root\" ]\n}\n```\n\n##### `detached-processes`\n\n##### Type\n* `{Array\u003c\u003eString}`\n\nUkko checks if we supply some commands to be executed, this commands could be executed \nbefore or after download the code from the specified endpoint, but there are some commands \nthat need to be executed in some background thread to bypass the parent process, as example \nyou can need to execute some server or watching process.\n  \n\n```json\n{\n    \"configPath\": \"http://path/to/your/ukko-conf.json\",\n    \"detached\": [ \"mvn jetty:run\" ]\n}\n```\n\n##### `save-report`\n\n##### Type\n* `{Boolean}`\n\nAs commented in the previous point some commands will be executed in the background, this property\ntells ukko to save the log of these processes.\n                    \n##### Define an endpoint\n\nThe endpoints should be inside any of the defined environments or inside the \nshared dependencies object.\nThere are some different ways to define and endpoint and I will show you some of them.\n                            \nUkko detects if the repository exist or not, then it decides what is needed to do if a \ncomplete checkout or an update.\n\n###### Simple\n\n###### - FileSystem (basic, git, svn)\n\n```json\n{\n    \"ukko-conf\" : {\n        \"dependencies\": {\n            \"target/path\" : \"path/to/my/source\"\n        }\n    }\n}\n```\n\n###### - Git repository\n\n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/path\" : \"https://example.com/gitproject.git\"\n        }\n    }\n}\n```\n\n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/path\" : \"ssh://user@server/project.git\"\n        }\n    }\n}\n```\n\n###### - SVN repository\n\n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/path\" : \"http://svn.red-bean.com/repos/test\"\n        }\n    }\n}\n```\n\n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/path\" : \"svn://\u003cyour_ip\u003e/\u003crepository_name\u003e\"\n        }\n    }\n}\n```\n\n###### - Github repository\n\n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/path\" : \"https://github.com/user/repo.git\"\n        }\n    }\n}\n```\n\n###### - Compressed file url\n\nCompressed files could be: zip, tar, tar.gz, war\n\n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/path\" : \"http://myserver.com/path/repo.zip\"\n        }\n    }\n}\n```\n\n###### Post-commands simple  \n\n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/path\" : {\n                \"endpoint\": \"https://example.com/gitproject.git\",\n                \"commands\": [ \"mvn clean install -DskipTests\" ]\n            }\n        }\n    }\n}\n```\n\n###### Pre-commands \n\n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/path\" : {\n                \"endpoint\": \"https://example.com/gitproject.git\",\n                \"commands\": {\n                    \"pre\": [ \"mvn clean install -DskipTests\" ]\n                }\n            }\n        }\n    }\n}\n```\n\n###### Pre and post commands\n  \n```json\n{\n    \"ukko-conf\": {\n        \"dependencies\": {\n            \"target/path\" : {\n                \"endpoint\": \"https://example.com/gitproject.git\",\n                \"commands\": {\n                    \"pre\": [ \"ls -la\" ],\n                    \"post\": [ \"mvn clean install -DskipTests\" ]\n                }\n            }\n        }\n    }\n}\n```\n\nTo get more info I recommend to read the use cases in tests.\n\n## Tests\n\nTo run the tests with NodeUnit:\n\n```bash\nnpm install\nnpm test\n```\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Check that it still works: `npm test`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## History\n\n0.0.32 - First fully working commit.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Tomás Corral\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcorral%2Fukko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcorral%2Fukko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcorral%2Fukko/lists"}