{"id":13905791,"url":"https://github.com/jakeheis/Flock","last_synced_at":"2025-07-18T03:31:31.340Z","repository":{"id":63912413,"uuid":"71685316","full_name":"jakeheis/Flock","owner":"jakeheis","description":"Automated deployment of Swift projects to servers","archived":true,"fork":false,"pushed_at":"2018-06-12T01:18:53.000Z","size":2064,"stargazers_count":126,"open_issues_count":0,"forks_count":11,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-30T17:16:42.958Z","etag":null,"topics":["deploy","kitura","perfect","server","server-side-swift","swift","vapor","zewo"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/jakeheis.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":"2016-10-23T06:11:39.000Z","updated_at":"2024-10-22T12:52:08.000Z","dependencies_parsed_at":"2023-01-14T13:15:27.147Z","dependency_job_id":null,"html_url":"https://github.com/jakeheis/Flock","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakeheis%2FFlock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakeheis%2FFlock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakeheis%2FFlock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakeheis%2FFlock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakeheis","download_url":"https://codeload.github.com/jakeheis/Flock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226336684,"owners_count":17608877,"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":["deploy","kitura","perfect","server","server-side-swift","swift","vapor","zewo"],"created_at":"2024-08-06T23:01:23.781Z","updated_at":"2024-11-25T13:31:52.900Z","avatar_url":"https://github.com/jakeheis.png","language":"Swift","readme":"# Flock\n\nAutomated deployment of Swift projects to servers. Once set up, deploying your project is as simple as:\n\n```shell\n\u003e flock deploy\n```\n\nFlock will clone your project onto your server(s), build it, and start the application (and do anything else you want it to do). Flock already works great with [Vapor](https://github.com/vapor/vapor), [Zewo](https://github.com/Zewo/Zewo), [Perfect](https://github.com/PerfectlySoft/Perfect), and [Kitura](https://github.com/IBM-Swift/Kitura).\n\nInspired by [Capistrano](https://github.com/capistrano/capistrano).\n\nTable of Contents\n=================\n\n   * [Installation](#installation)\n       * [Mint](#mint)\n       * [Manual](#manual)\n   * [Init](#init)\n   * [Tasks](#tasks)\n       * [Running tasks](#running-tasks)\n       * [Writing your own tasks](#writing-your-own-tasks)\n   * [Permissions](#permissions)\n\n## Installation\n### [Mint](https://github.com/yonaskolb/mint) (recommended)\n\n```bash\nmint install jakeheis/Flock\n```\n\n### Manual\n```bash\ngit clone https://github.com/jakeheis/Flock\ncd Flock\nswift build -c release\nmv .build/release/flock /usr/bin/local/flock\n```\n\n## Init\nTo start using Flock, run:\n\n```shell\nflock init\n```\n\nThis command creates a `Flock.swift` file in the current directory. After the command completes, you should read through `Flock.swift` and follow the directions located throughout the file.\n\n## Tasks\n\n### Running tasks\nYou can see the available tasks by running `flock` with no arguments. To run a task, just call `flock \u003ctask\u003e`, such as:\n\n```shell\nflock deploy # Run the deploy task\n```\n\nYou can also specify the environment Flock should execute the task in:\n```bash\nflock deploy --env=production # Same as just running flock deploy\nflock deploy --env=staging # Run the deploy task in the staging environment\n```\n\n### Writing your own tasks\n\nSee the note in `Flock.swift` about how to write your own task. Your task will ultimately run some commands on a `Server` object. Here are some examples of what's possible:\n\n```swift\ntry server.execute(\"mysql -v\") // Execute a command remotely\n\nlet contents = try server.capture(\"cat myFile\") // Execute a command remotely and capture the output\n\n// Execute all commands in this closure within Path.currentDirectory\ntry server.within(Path.currentDirectory) {\n    try server.execute(\"ls\")\n    if server.fileExists(\"anotherFile.txt\") { // Check the existence of a file on the server\n        try server.execute(\"cat anotherFile.txt\")\n    }\n}\n```\n\nCheck out [Server.swift](https://github.com/jakeheis/Flock/blob/master/Sources/Flock/Server.swift) to see all of `Server`'s available methods. Also take a look at [Paths.swift](https://github.com/jakeheis/Flock/blob/master/Sources/Flock/Environment.swift) to see the built-in paths for your `server.within` calls.\n\n## Permissions\nIn general, you should create a dedicated deploy user on your server. [Authentication \u0026 Authorisation](http://capistranorb.com/documentation/getting-started/authentication-and-authorisation/#) is a great resource for learning how to do this.\n\nTo ensure the `deploy` task succeeds, make sure:\n- The deploy user has access to `Config.deployDirectory` (default /var/www)\n- The deploy user has access to the `swift` executable\n\nSome additional considerations if you plan to use `supervisord` (which you likely should!):\n- The deploy user can run `supervisorctl` commands (see [Using supervisorctl with linux permissions but without root or sudo](https://coffeeonthekeyboard.com/using-supervisorctl-with-linux-permissions-but-without-root-or-sudo-977/) for more info)\n- The deploy user has access to the `supervisor` config file (default /etc/supervisor/conf.d/server.conf)\n","funding_links":[],"categories":["HarmonyOS","Swift"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakeheis%2FFlock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakeheis%2FFlock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakeheis%2FFlock/lists"}