{"id":18510104,"url":"https://github.com/gitana/cloudcms-http-deployment-receiver","last_synced_at":"2025-05-14T11:14:04.051Z","repository":{"id":145564828,"uuid":"149495626","full_name":"gitana/cloudcms-http-deployment-receiver","owner":"gitana","description":"A sample Cloud CMS custom HTTP deployment receiver","archived":false,"fork":false,"pushed_at":"2019-03-23T12:04:37.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T02:41:36.413Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gitana.io","language":"JavaScript","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/gitana.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":"2018-09-19T18:34:30.000Z","updated_at":"2025-01-23T02:49:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"a75bc086-61eb-451a-bbb7-7c55a54a299f","html_url":"https://github.com/gitana/cloudcms-http-deployment-receiver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitana%2Fcloudcms-http-deployment-receiver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitana%2Fcloudcms-http-deployment-receiver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitana%2Fcloudcms-http-deployment-receiver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitana%2Fcloudcms-http-deployment-receiver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitana","download_url":"https://codeload.github.com/gitana/cloudcms-http-deployment-receiver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254129537,"owners_count":22019629,"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-11-06T15:20:58.499Z","updated_at":"2025-05-14T11:14:04.007Z","avatar_url":"https://github.com/gitana.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloud CMS Http Deployment Receiver\n\nThis repository provides a framework that you can use to build your own Cloud CMS custom HTTP deployment receivers.  Deployment Receivers are endpoints for the Cloud CMS deployment process.  They receive Deployment Packages which contain content (JSON and binaries) that are to be either deployed or undeployed against the endpoint.\n\n## Getting Started\n\nTo use this in a Node project, you will first need to:\n\n    npm install --save cloudcms-http-deployment-receiver\n    \nAnd then in your code, you'd do:\n\n    var receiver = require(\"cloudcms-http-deployment-receiver\");\n    \n    receiver.start(function() {\n        console.log(\"Deployment Receiver is online\");\n    });\n\nThis will start an HTTP server (using Express).  The HTTP server exposes two controller methods:\n\n    POST /push\n    \n    GET /status/:id \n    \nWhen Cloud CMS deploys its deployment packages, those should be targeted to the `/push` endpoint.  If you want asynchronous deployment, you should configure the Status URL for your deployment target to point to `/status/{{id}}`.  This will allow Cloud CMS to poll this deployment receiver to check when the asset has been successfully deployed.\n\n## Event Handlers\n\nWhen a Deployment Package arrives, a series of event callbacks are triggered which allow you to plug in custom handling code.\nYou insert your custom code by registering functions.  Each function will receive information about the current step and will\nalso receive a `callback` argument.  You must invoke this `callback` when you are all finished.\n\nThe reason for the `callback` is because functions run asynchronous and in parallel for performance.  You may also need to do things\nlike insert content into a database or do other operations which inherently take time.  Fire the `callback` once you're finished.\n\nThe `deploymentPackage` is a JSON object that describes what was deployed.  It has an `operation` property that will either be\n`DEPLOY` or `UNDEPLOY`.  You can use this information, if you choose, to add or remove the content.\n\n### before\n\nThis runs once the deployment package has arrived but before any execution has occurred.\n\n    receiver.before(function(deploymentPackage, callback) {\n        callback();\n    });\n    \n### execute\n\nThis runs when the deployment has been completely unpacked and is ready to deploy.  The `store` variable gives you access to the all the files.  And the `manifest` is a JSON object containing an inventory of everything that is in the package including dependnecy information.\n\n    receiver.before(function(deploymentPackage, manifest, store, callback) {\n        callback();\n    });\n    \n### entry\n\nThis runs per entry in the deployment.  It serves as an alternative (or a companion) to the `execute` method, allowing you to focus on entries one at a time.\n\n    receiver.entry(function(deploymentPackage, manifest, store, entryPath, callback) {    \n        callback();\n    });\n    \n### after\n\nThis runs when the deployment package has completed its deployment.\n\n    receiver.after(function(deploymentPackage, manifest, store, callback) {\n        callback();\n    });\n    \n## Example\n\nTo see a full-fledged example of this in action, check out:\n[https://github.com/gitana/sdk/tree/master/http-deployment-receiver](https://github.com/gitana/sdk/tree/master/http-deployment-receiver)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitana%2Fcloudcms-http-deployment-receiver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitana%2Fcloudcms-http-deployment-receiver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitana%2Fcloudcms-http-deployment-receiver/lists"}