All Projects → jakeheis → Flock

jakeheis / Flock

Licence: mit
Automated deployment of Swift projects to servers

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Flock

Swiftserverside Vapor
🦄 Swift server open source projects based on the Swift 4.1 and Vapor 3 frameworks. (Swift 服务端开源项目)
Stars: ✭ 588 (+362.99%)
Mutual labels:  server-side-swift, vapor, server
Vapor
💧 A server-side Swift HTTP web framework.
Stars: ✭ 21,194 (+16588.19%)
Mutual labels:  server-side-swift, vapor, server
Fluent
Vapor ORM (queries, models, and relations) for NoSQL and SQL databases
Stars: ✭ 1,071 (+743.31%)
Mutual labels:  server-side-swift, vapor
Core
🌎 Utility package containing tools for byte manipulation, Codable, OS APIs, and debugging.
Stars: ✭ 62 (-51.18%)
Mutual labels:  server-side-swift, vapor
Vapor Clean
A Vapor 3 template with no additional cruft.
Stars: ✭ 80 (-37.01%)
Mutual labels:  server-side-swift, vapor
Leaf Error Middleware
Serve up custom 404 and server error pages for your Vapor App
Stars: ✭ 43 (-66.14%)
Mutual labels:  server-side-swift, vapor
Admin Panel Provider
Build easy customizable admin features for your app ✍️
Stars: ✭ 47 (-62.99%)
Mutual labels:  server-side-swift, vapor
Eblovaporserver
Server side of Eblo backed by Vapor
Stars: ✭ 77 (-39.37%)
Mutual labels:  vapor, server
Vaporuploads
Demonstrating uploads in Vapor 4. Particularly large streaming uploads.
Stars: ✭ 19 (-85.04%)
Mutual labels:  server-side-swift, vapor
Awesome Server Side Swift
Swift 服务端开发 Perfect、Vapor资料。
Stars: ✭ 123 (-3.15%)
Mutual labels:  vapor, server
Vaporsecurityheaders
Harden Your Security Headers For Vapor
Stars: ✭ 107 (-15.75%)
Mutual labels:  server-side-swift, vapor
Hummingbird
Lightweight, flexible HTTP server framework written in Swift
Stars: ✭ 114 (-10.24%)
Mutual labels:  server-side-swift, server
Apicore
Core API functionality (users & teams, passwords, emails, etc) for any service built with Vapor 3
Stars: ✭ 43 (-66.14%)
Mutual labels:  server-side-swift, vapor
Kitura
A Swift web framework and HTTP server.
Stars: ✭ 7,533 (+5831.5%)
Mutual labels:  server-side-swift, server
Fluent Sqlite Driver
Fluent driver for SQLite
Stars: ✭ 51 (-59.84%)
Mutual labels:  server-side-swift, vapor
Url Encoded Form
📝 Parse and serialize url-encoded form data with Codable support.
Stars: ✭ 32 (-74.8%)
Mutual labels:  server-side-swift, vapor
Aws
Swift wrapper around AWS API
Stars: ✭ 67 (-47.24%)
Mutual labels:  server-side-swift, vapor
Open Crypto
🔑 Hashing (BCrypt, SHA2, HMAC), encryption (AES), public-key (RSA), and random data generation.
Stars: ✭ 115 (-9.45%)
Mutual labels:  server-side-swift, vapor
Awesome Vapor
A curated list of Vapor-related awesome projects.
Stars: ✭ 783 (+516.54%)
Mutual labels:  server-side-swift, vapor
Stacked
Stack traces for Swift on Mac and Linux 📚
Stars: ✭ 24 (-81.1%)
Mutual labels:  server-side-swift, vapor

Flock

Automated deployment of Swift projects to servers. Once set up, deploying your project is as simple as:

> flock deploy

Flock 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, Zewo, Perfect, and Kitura.

Inspired by Capistrano.

Table of Contents

Installation

Mint (recommended)

mint install jakeheis/Flock

Manual

git clone https://github.com/jakeheis/Flock
cd Flock
swift build -c release
mv .build/release/flock /usr/bin/local/flock

Init

To start using Flock, run:

flock init

This 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.

Tasks

Running tasks

You can see the available tasks by running flock with no arguments. To run a task, just call flock <task>, such as:

flock deploy # Run the deploy task

You can also specify the environment Flock should execute the task in:

flock deploy --env=production # Same as just running flock deploy
flock deploy --env=staging # Run the deploy task in the staging environment

Writing your own tasks

See 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:

try server.execute("mysql -v") // Execute a command remotely

let contents = try server.capture("cat myFile") // Execute a command remotely and capture the output

// Execute all commands in this closure within Path.currentDirectory
try server.within(Path.currentDirectory) {
    try server.execute("ls")
    if server.fileExists("anotherFile.txt") { // Check the existence of a file on the server
        try server.execute("cat anotherFile.txt")
    }
}

Check out Server.swift to see all of Server's available methods. Also take a look at Paths.swift to see the built-in paths for your server.within calls.

Permissions

In general, you should create a dedicated deploy user on your server. Authentication & Authorisation is a great resource for learning how to do this.

To ensure the deploy task succeeds, make sure:

  • The deploy user has access to Config.deployDirectory (default /var/www)
  • The deploy user has access to the swift executable

Some additional considerations if you plan to use supervisord (which you likely should!):

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].