{"id":15680240,"url":"https://github.com/sholladay/delivr","last_synced_at":"2025-05-07T11:14:10.129Z","repository":{"id":92548804,"uuid":"67831990","full_name":"sholladay/delivr","owner":"sholladay","description":"Build your code and ship it to S3","archived":false,"fork":false,"pushed_at":"2018-02-20T22:09:12.000Z","size":23,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-27T04:01:53.102Z","etag":null,"topics":["amazon","automation","aws","build","deploy","release","s3","ship"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sholladay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-09-09T20:52:29.000Z","updated_at":"2021-02-01T16:17:47.000Z","dependencies_parsed_at":"2023-03-07T02:15:52.366Z","dependency_job_id":null,"html_url":"https://github.com/sholladay/delivr","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"75dd155b964fdca17768bfad954327126e9b24f7"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sholladay%2Fdelivr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sholladay%2Fdelivr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sholladay%2Fdelivr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sholladay%2Fdelivr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sholladay","download_url":"https://codeload.github.com/sholladay/delivr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252631932,"owners_count":21779534,"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":["amazon","automation","aws","build","deploy","release","s3","ship"],"created_at":"2024-10-03T16:41:06.738Z","updated_at":"2025-05-07T11:14:10.102Z","avatar_url":"https://github.com/sholladay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# delivr [![Build status for delivr](https://img.shields.io/circleci/project/sholladay/delivr/master.svg \"Build Status\")](https://circleci.com/gh/sholladay/delivr \"Builds\")\n\n\u003e Build your code and ship it to S3\n\nThis is a multi-version release and deployment system, optimized for client-side web applications.\n\nYour builds are stored locally during development and automatically uploaded to Amazon S3 in CI. Your git branch is used to namespace each build and versioning is handled gracefully, with immutable, meaningful version numbers derived from package.json and your git repository state.\n\nAll branches are treated equally, all versions are kept around, and symlinks for the `latest` build of a given branch are provided. This makes both development and release extremely simple. Your app server can release a build simply by deciding which branch it wants to point to. And it can either use the `latest` build of that branch or a specific version. Because builds are immutable, they are cached for long periods of time, and rollbacks are easy.\n\n## Why?\n\n - No more complicated, untested, handwritten release scripts!\n - [Smart versioning](https://github.com/sholladay/build-version) that works well across environments.\n - Composable with other build tools.\n - Easy to set up and configure.\n\n## Install\n\n```sh\nnpm install delivr --save\n```\n\n## Usage\n\nFirst, `delivr.prepare()` makes a secure temporary directory for you to put some files in. When you are done, just call `build.finalize()` and the directory will be moved to `build/\u003cbranch\u003e/\u003cversion\u003e` and (if in CI) deployed to S3.\n\n```js\nconst fs = require('fs');\nconst util = require('util');\nconst delivr = require('delivr');\n\nconst writeFile = util.promisify(fs.writeFile);\n\nconst run = async () =\u003e {\n    // Make a temporary directory to put files in!\n    const build = await delivr.prepare();\n\n    // Write some files to disk!\n    await writeFile(path.join(build.path, 'hello.txt'), 'Hello, world!');\n\n    // Deploy the build!\n    await build.finalize();\n};\nrun();\n```\n\n## API\n\nPlease see Amazon's [API documentation](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html) for details on authenticating with AWS.\n\n### build = await delivr.prepare(option)\n\nReturns an object representing a newly created temporary directory.\n\nYou should write files to be included in the build by putting them inside `build.path`. When you are done writing files, you should call `build.finalize()`.\n\n#### option\n\nType: `object`\n\nSettings and known [build data](https://github.com/sholladay/build-data).\n\n##### cwd\n\nType: `string`\u003cbr\u003e\nDefault: `process.cwd()`\n\nParent directory of the build root. Typically, this would be the root directory of your app.\n\n##### branch\n\nType: `string`\u003cbr\u003e\nDefault: [git HEAD or `master`](https://github.com/sholladay/branch-name#assumemasteroption)\n\nA prefix used to group builds together, so that \"release lines\" can more easily be maintained.\n\nThe branch becomes part of the path used to store the build when the build is finalized. For example, if the branch is `my-feature` and the version is `1.0.0`, the build will be stored in `build/my-feature/1.0.0`.\n\nYou probably don't need to set this option yourself! Providing a custom branch name is mostly useful to improve performance, if you happen to know the current branch name ahead of time.\n\n##### version\n\nType: `string`\u003cbr\u003e\nDefault: a new [build version](https://github.com/sholladay/build-version#buildversionoption)\n\nA version identifier used to separate this build from others on the same branch. Ideally, it should be unique, such that only builds with the same content ever have the same version (the default algorithm guarantees this).\n\nThe version becomes part of the path used to store the build when the build is finalized. For example, if the branch is `master` and the version is `1.2.3`, the build will be stored in `build/master/1.2.3`.\n\nYou probably don't need to set this option yourself! Providing a custom version is mostly useful to improve performance, if you happen to have a version number you want to use ahead of time.\n\n##### bucket\n\nType: `string`\u003cbr\u003e\nExample: `my-app`\n\nName of the Amazon S3 bucket where the build files should be deployed to (if `deploy` is enabled).\n\nFor tips on naming your bucket, see Amazon's [Rules for Bucket Naming](https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html#bucketnamingrules).\n\n##### deploy\n\nType: `boolean`\u003cbr\u003e\nDefault: `true` if running in CI\n\nWhether to upload the build files to Amazon S3.\n\nThe path of the build on S3 will be identical to your local build. For example, if the bucket is `my-app` and branch is `master` and the version is `1.0.0`, the build will be available at `https://s3.amazonaws.com/my-app/master/1.0.0`.\n\n### build.path\n\nA newly created and [secure temporary directory](https://security.openstack.org/guidelines/dg_using-temporary-files-securely.html) for you to write files in to be included with the build.\n\nExample on macOS: `/var/folders/gr/qfsxs2gj0fq1ypdsfd8rj8tr0000gn/T/vwjBJb`\n\n### await build.finalize()\n\nMoves the temporary directory from `buiild.path` to `build/\u003cversion\u003e/\u003cbranch\u003e` within the current working directory, where `\u003cversion\u003e` and `\u003cbranch\u003e` are decided by the `version` and `branch` options given to `delivr.prepare(option)`.\n\nThis also sets up symlinks to the build via `latest-build` and `build/\u003cbranch\u003e/latest` (see also [`buildDir.link()`](https://github.com/sholladay/build-dir#builddirlinkoption)).\n\nFinally, the build is uploaded to Amazon S3, based on the `deploy` option given to `delivr.prepare(option)`.\n\n## Related\n\n - [scube](https://github.com/sholladay/scube) - Manage your [S3](https://aws.amazon.com/s3/) buckets\n - [build-files](https://github.com/sholladay/build-files) - Read the files from your build\n - [build-keys](https://github.com/sholladay/build-keys) - Get the paths of files from your build\n - [build-dir](https://github.com/sholladay/build-dir) - Get a place to put your build\n - [build-data](https://github.com/sholladay/build-data) - Get metadata for your build\n - [build-path](https://github.com/sholladay/build-path) - Get a path for the given build\n - [build-version](https://github.com/sholladay/build-version) - Get a version for your build\n - [branch-name](https://github.com/sholladay/branch-name) - Get the current branch name\n\n## Contributing\n\nSee our [contributing guidelines](https://github.com/sholladay/delivr/blob/master/CONTRIBUTING.md \"Guidelines for participating in this project\") for more details.\n\n1. [Fork it](https://github.com/sholladay/delivr/fork).\n2. Make a feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. [Submit a pull request](https://github.com/sholladay/delivr/compare \"Submit code to this project for review\").\n\n## License\n\n[MPL-2.0](https://github.com/sholladay/delivr/blob/master/LICENSE \"License for delivr\") © [Seth Holladay](https://seth-holladay.com \"Author of delivr\")\n\nGo make something, dang it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsholladay%2Fdelivr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsholladay%2Fdelivr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsholladay%2Fdelivr/lists"}