{"id":15994245,"url":"https://github.com/pixelhandler/ember-cli-deploy-rsync-assets","last_synced_at":"2025-04-05T00:15:46.592Z","repository":{"id":57223207,"uuid":"59920391","full_name":"pixelhandler/ember-cli-deploy-rsync-assets","owner":"pixelhandler","description":"Ember CLI Deploy plugin to publish build via rsync","archived":false,"fork":false,"pushed_at":"2017-05-19T02:19:15.000Z","size":14,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T22:02:36.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pixelhandler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-29T00:49:19.000Z","updated_at":"2016-12-16T13:32:52.000Z","dependencies_parsed_at":"2022-08-24T16:20:49.725Z","dependency_job_id":null,"html_url":"https://github.com/pixelhandler/ember-cli-deploy-rsync-assets","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/pixelhandler%2Fember-cli-deploy-rsync-assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fember-cli-deploy-rsync-assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fember-cli-deploy-rsync-assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fember-cli-deploy-rsync-assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixelhandler","download_url":"https://codeload.github.com/pixelhandler/ember-cli-deploy-rsync-assets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266570,"owners_count":20910837,"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-10-08T07:07:45.340Z","updated_at":"2025-04-05T00:15:46.560Z","avatar_url":"https://github.com/pixelhandler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ember-cli-deploy-rsync-assets\n\nA plugin for [ember-cli-deploy], that provides a configurable `rsync` command\nwhich uses the `upload` pipeline hook to sync assets to a destination\nthat you configure.\n\nIt would be a good idea to review the [writing-a-plugin] and [pipeline-hooks]\npages to learn more about the `upload` hook.\n\nThe [node-rsync] module is used to execute the rsync command.\n\nSee the `index.js` file in this repo; the main script that provides a function\nfor the `createDeployPlugin` method of this ember-cli-deploy addon.\n\n[![](https://ember-cli-deploy.github.io/ember-cli-deploy-version-badges/plugins/ember-cli-deploy-s3.svg)](http://ember-cli-deploy.github.io/ember-cli-deploy-version-badges/)\n\n## Installation\n\nRequires `ember-cli-deploy` addon to be installed first\n\n    ember install ember-cli-deploy-rsync-assets\n\nFor production deployment the `build` plugin is required\n\n    ember install ember-cli-deploy-build\n\n## Deploy config\n\nSetup your configuration in config/deploy.js (generated when installing\nember-cli-deploy)\n\n|option|type|description|\n|:---|:---|:---|\n|destination|String|The destination include, `user@IP` if needed|\n|source|String|The source directory|\n|ssh|Boolean|Use SSH when syncing|\n|privateKeyPath|String|Path to your private key, may need with `ssh` option|\n|excludeIndexHTML|Boolean|Exclude the `index.html` file, default is `true`|\n|flags|Array|List of rsync flags to add, e.g. `['z']` to add compression|\n|dry|Boolean|Option for dry run, does not connect when using ssh|\n\nThe `destination` option can be a local path or a remote one. When using the\n`ssh` option be sure to include the user/domain, e.g.\n`username@remote_host:/path_to_public`. Also, if your config uses `ssh: true`\nyou may need to also set the option for `privateKeyPath` to the path to your\nssh key (`/Users/\u003cusername\u003e/.ssh/id_rsa`).\n\nBelow is an example `config/deploy.js` file setup to sync all the assets; and\nalso includes the the option to sync the `index.html` file.\n\nMost likely the `ember-cli-deploy-rsync-assets` plugin will be used together\nwith other deploy plugins, e.g. self-hosting your assets instead of\nusing an S3 bucket.\n\n*See the options assigned to `ENV['rsync-assets']` in the example config below…*\n\n```js\n/*jshint node:true*/\n/* global module,process */\nvar VALID_DEPLOY_TARGETS = ['development-postbuild', 'production'];\nmodule.exports = function(deployTarget) {\n  if (VALID_DEPLOY_TARGETS.indexOf(deployTarget) === -1) {\n    throw new Error('Invalid deployTarget ' + deployTarget);\n  }\n  var ENV = {};\n  if (deployTarget === 'development-postbuild') {\n    ENV.plugins = ['rsync-assets'];\n    ENV.build = { environment: 'development' };\n    ENV['rsync-assets'] = {\n      destination: process.env['PUBLIC_DIR'],\n      source: 'dist/.',\n      excludeIndexHTML: false, // default is `true` to exclude index.html\n      ssh: false,\n      dry: false\n    }\n  } else if (deployTarget === 'production') {\n    ENV.plugins = 'build rsync-assets'.split(' ');\n    ENV.build = { environment: 'production' };\n    ENV['rsync-assets'] = {\n      destination: process.env['PUBLIC_DIR'],\n      source: 'tmp/deploy-dist/.',\n      excludeIndexHTML: false, // default is `true` to exclude index.html\n      flags: ['z'], // compress, gzip\n      ssh: true,\n      privateKeyPath: process.env['PRIVATE_KEY_PATH']\n    }\n  }\n  return ENV;\n};\n```\n\nThe example above uses a `deployTarget` of `development-postbuild` which runs\nafter the build. To setup the hook in your `ember-cli-build.js` file add the\n`emberCLIDeploy` option, an example is below:\n\n```js\n/*jshint node:true*/\nvar EmberApp = require('ember-cli/lib/broccoli/ember-app');\nmodule.exports = function(defaults) {\n  var app = new EmberApp(defaults, {\n    emberCLIDeploy: {\n      runOnPostBuild: (env === 'development') ? 'development-postbuild' : false,\n      configFile: 'config/deploy.js'\n    }\n  });\n  return app.toTree();\n};\n```\n\nWhen using as a replacement for S3 in the lightning-pack you can add the options\nfor `ENV['rsync-assets']` to your `config/deploy.js` file and also list the `plugins` to\nrun during deployment.\n\n```js\n  if (deployTarget === 'development-postbuild') {\n    ENV.plugins = ['redis', 'rsync-assets'];\n    // ... redis, rsync-assets settings\n  } else if (deployTarget === 'production') {\n    ENV.plugins = 'build display-revisions gzip redis manifest revision-data rsync-assets'.split(' ')\n    //... redis, ssh-tunnel, rsync-assets settings…\n  }\n```\n\n## Links\n\n- [ember-cli-deploy]\n- [writing-a-plugin]\n- [node-rsync]\n- [rsync_options]\n- [sinatra-redis-server]\n\nFor more information on using ember-cli, visit [http://ember-cli.com/](http://ember-cli.com/).\n\n[ember-cli-deploy]: https://github.com/ember-cli-deploy/ember-cli-deploy\n[ember-cli-deploy-lightning-pack]: https://github.com/ember-cli-deploy/ember-cli-deploy-lightning-pack\n[writing-a-plugin]: http://ember-cli-deploy.github.io/ember-cli-deploy/docs/v0.6.x/writing-a-plugin/\n[pipeline-hooks]: http://ember-cli-deploy.github.io/ember-cli-deploy/docs/v0.6.x/pipeline-hooks/\n[node-rsync]: https://github.com/mattijs/node-rsync\n[rsync_options]: http://ss64.com/bash/rsync_options.html\n[sinatra-redis-server]: https://github.com/pixelhandler/sinatra-redis-server\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelhandler%2Fember-cli-deploy-rsync-assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixelhandler%2Fember-cli-deploy-rsync-assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelhandler%2Fember-cli-deploy-rsync-assets/lists"}