{"id":19341174,"url":"https://github.com/jsdir/deployer","last_synced_at":"2025-04-23T02:31:40.370Z","repository":{"id":26611397,"uuid":"30066575","full_name":"jsdir/deployer","owner":"jsdir","description":"Initiate and manage deploys from ci","archived":false,"fork":false,"pushed_at":"2015-03-28T12:15:02.000Z","size":356,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T02:33:14.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/jsdir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-30T10:04:53.000Z","updated_at":"2019-08-13T16:01:44.000Z","dependencies_parsed_at":"2022-08-17T17:31:30.050Z","dependency_job_id":null,"html_url":"https://github.com/jsdir/deployer","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/jsdir%2Fdeployer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdir%2Fdeployer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdir%2Fdeployer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdir%2Fdeployer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsdir","download_url":"https://codeload.github.com/jsdir/deployer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250357665,"owners_count":21417325,"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-10T03:29:35.427Z","updated_at":"2025-04-23T02:31:40.122Z","avatar_url":"https://github.com/jsdir.png","language":"Go","readme":"deployer\n========\n\n[![Build Status](https://img.shields.io/circleci/project/jsdir/deployer.svg)](https://circleci.com/gh/jsdir/deployer)\n\n## What is it?\n\nDeployer manages and deploys releases for distributed applications. Although it currently only works with kubernetes, it can be easily extended to work with other cloud orchestration systems. Contributions are more than welcome!\n\nDeployer can:\n\n- Manage releases through a CLI\n- Deploy to multiple environments and individually apply releases to them\n- Use pluggable environment backends\n\n## Quickstart\n\nWe'll use docker for demonstrating how deployer works with a kubernetes cluster. First, pull some images.\n\n```bash\n$ docker pull jsdir/deployer\n$ docker pull llamashoes/dind-kubernetes\n```\n\nStart a local kubernetes cluster.\n\n```bash\n$ docker run -d -p 127.0.0.1:8888:8888 -p 8091:8091 -p 8092:8092 --privileged llamashoes/dind-kubernetes\n```\n\nNext, we'll write some configuration files for deployer.\n\n### Config\n\nThe config decalres the environments that we want to deploy to. Here, we'll set up staging and production environments.\n\n```bash\nmkdir -p /tmp/deployer-demo\ncat \u003c\u003cEOF \u003e /tmp/deployer-demo/config.json\n{\n  \"port\": 7654,\n  \"environments\": {\n    \"production\": {\n      \"type\": \"kubernetes\",\n      \"manifestGlob\": \"/tmp/deployer-demo/manifest.json\",\n      \"cmd\": \"docker kubectl --server=http://localhost:7654\"\n    }\n  }\n}\nEOF\n```\n\n### Kubernetes manifest\n\nThis manifest injects information about the deployment into the container's environment through templates. This is done using [deployer-kubernetes](https://github.com/jsdir/deployer-kubernetes).\n\n```bash\ncat \u003c\u003cEOF \u003e /tmp/deployer-demo/manifest.json\n{\n  \"id\": \"server\",\n  \"kind\": \"Pod\",\n  \"apiVersion\": \"v1beta1\",\n  \"desiredState\": {\n    \"manifest\": {\n      \"version\": \"v1beta1\",\n      \"id\": \"server\",\n      \"containers\": [{\n        \"name\": \"web-demo\",\n        \"image\": \"{{.Services.web-demo}}\",\n        \"cpu\": 100,\n        \"ports\": [{\n          \"name\": \"http\",\n          \"containerPort\": 8091,\n          \"hostPort\": 8091\n        }],\n        \"env\": [{\n          \"name\": \"PORT\",\n          \"value\": \"8091\"\n        }]\n      }]\n    }\n  }\n}\nEOF\n```\n\n### Creating releases\n\nNow that the config is set up, start the daemon.\n\n```shell\n$ docker run -d -p 7654:7654 --net=host -v /tmp/deployer-demo:/data jsdir/deployer deployerd --config /data/config.json\n```\n\nCommands can be sent to `deployerd` through the HTTP API, or through `deployer`, a simple command line interface that's bundled with `jsdir/deployer`.\n\nWe'll use the API to create a build. This step would be run manually or in CI once a docker image is tested, built, and uploaded to the registry. In this case, we'll continue as if you just uploaded `jsdir/deployer-web-demo#version1` to the registry.\n\n```shell\n$ curl --data \"service=web-demo\u0026tag=jsdir/deployer-web-demo#version1\" localhost:7654/builds\n```\n\nNext, we'll create a release with the new build using the CLI.\n\n```shell\n$ alias deployer='docker run --net=host jsdir/deployer deployer --addr=\"http://localhost:7654\"'\n$ deployer release web-demo jsdir/deployer-web-demo#version1\n{\"id\": 0, \"name\": \"super-panda\", \"services\": {\"web-demo\": \"jsdir/deployer-web-demo#version1\"}}\n0\n```\n\nThis creates a release. The release is a named, atomic mapping of services and their builds. Creating a release will always block until the required service builds exist. Since the\n`web-demo` build `jsdir/deployer-web-demo#version1` already exists, the client responds immediately.\n\n### Deploying releases\n\nTo deploy this release, we'll use the CLI.\n\n```shell\n$ deployer deploy 0 staging\n```\n\nThis deploys release `0` to the `staging` environment. To verify that it works:\n\n```shell\n$ curl http://localhost:8091\nHello from `jsdir/deployer-web-demo#1`! (super-panda)\nI'm running in the `staging` environment.\n```\n\nSince it works, let's deploy the release to production.\n\n```shell\n$ deployer deploy staging production\n```\n\nThis syntax deploys the current release at the `staging` environment to the `production` environment.\n\n```shell\n$ curl http://localhost:8092\nHello from `jsdir/deployer-web-demo#1`! (super-panda)\nI'm running in the `production` environment.\n```\n\nReplacing existing deployments with new releases is simple:\n\n```shell\n$ curl http://localhost:7654/builds service=web-demo\u0026tag=jsdir/deployer-web-demo#2\n\n# Creating a new release extends the existing services.\n$ deployer release web-demo jsdir/deployer-web-demo#2\n{\"id\": 2, \"name\": \"bubbly-whale\", \"services\": {\"web-demo\": \"jsdir/deployer-web-demo#2\"}}\n2\n\n$ deployer deploy 2 staging\n$ curl http://localhost:8091\nHello from `jsdir/deployer-web-demo#2`! (bubbly-whale)\nI'm running in the `staging` environment.\n\n$ deployer deploy staging production\n$ curl http://localhost:8092\nHello from `jsdir/deployer-web-demo#1`! (super-panda)\nI'm running in the `production` environment.\n```\n\n## Examples and tutorials\n\nNew examples are coming soon:\n\n- assets: Service builds are not limited to docker images. This example will show how to use deployer to organized builds for both a web server, and client javascript assets that are on a CDN\n- ci: This example will show how to use deployer to set up a continuous deployment workflow with CI servers like [Drone](https://github.com/drone/drone) and [CircleCI](https://circleci.com).\n\n## Documentation\n\n- Concepts and design\n- Usage\n- API\n\n## Roadmap\n\n- Web frontend\n- More pluggable backends\n- Rollbacks\n- Availability zones\n- Integration with Hubot, Slack, and Flowdock\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdir%2Fdeployer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsdir%2Fdeployer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdir%2Fdeployer/lists"}