Coder Social home page Coder Social logo

flock's Introduction

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!):

flock's People

Contributors

jakeheis avatar mdab121 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

flock's Issues

Unable to install Flock

Getting following output when trying to install Flock manually. Installing via Homebew also failed.

Fetching https://github.com/jakeheis/SwiftCLI Fetching https://github.com/kylef/PathKit Fetching https://github.com/onevcat/Rainbow Fetching https://github.com/jakeheis/Spawn Fetching https://github.com/kylef/Spectre Cloning https://github.com/kylef/Spectre Resolving https://github.com/kylef/Spectre at 0.7.2 Cloning https://github.com/onevcat/Rainbow Resolving https://github.com/onevcat/Rainbow at 2.0.1 Cloning https://github.com/jakeheis/SwiftCLI Resolving https://github.com/jakeheis/SwiftCLI at 3.1.0 Cloning https://github.com/jakeheis/Spawn Resolving https://github.com/jakeheis/Spawn at 0.0.6 Cloning https://github.com/kylef/PathKit Resolving https://github.com/kylef/PathKit at 0.7.1 Compile Swift Module 'Spawn' (1 sources) Compile Swift Module 'Rainbow' (11 sources) Compile Swift Module 'Spectre' (8 sources) Compile Swift Module 'SwiftCLI' (25 sources) /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:37:69: warning: 'characters' is deprecated: Please use String or Substring directly var index = string.index(string.startIndex, offsetBy: token.characters.count) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:39:22: warning: 'characters' is deprecated: Please use String or Substring directly while string.characters[index] != "m" { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:40:39: warning: 'characters' is deprecated: Please use String or Substring directly codesString.append(string.characters[index]) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:44:33: warning: 'characters' is deprecated: Please use String or Substring directly let codes = codesString.characters.split(separator: ";", maxSplits: Int.max, omittingEmptySubsequences: false).flatMap { UInt8(String($0)) } ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:46:78: warning: 'characters' is deprecated: Please use String or Substring directly let endIndex = string.index(string.endIndex, offsetBy: -"\(token)0m".characters.count) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:47:34: warning: 'characters' is deprecated: Please use String or Substring directly let text = String(string.characters[startIndex ..< endIndex]) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:61:35: warning: 'characters' is deprecated: Please use String or Substring directly var outer = String(string.characters[index]) //Start index should be the ESC control code ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:64:57: warning: 'characters' is deprecated: Please use String or Substring directly index = string.index(index, offsetBy: token.characters.count) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:66:26: warning: 'characters' is deprecated: Please use String or Substring directly while string.characters[index] != ";" { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:67:43: warning: 'characters' is deprecated: Please use String or Substring directly codesString.append(string.characters[index]) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:73:35: warning: 'characters' is deprecated: Please use String or Substring directly outer = String(string.characters[index]) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:77:77: warning: 'characters' is deprecated: Please use String or Substring directly let endIndex = string.index(string.endIndex, offsetBy: -"\(token);".characters.count) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Rainbow-4833422609927903952/Sources/ModesExtractor.swift:78:34: warning: 'characters' is deprecated: Please use String or Substring directly let text = String(string.characters[startIndex ..< endIndex]) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Spectre--9185491864710013835/Sources/Expectation.swift:98:22: warning: redundant conformance constraint 'Key': 'Equatable' public func == <Key: Equatable, Value: Equatable> (lhs: Expectation<[Key: Value]>, rhs: [Key: Value]) throws { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Spectre--9185491864710013835/Sources/Expectation.swift:98:57: note: conformance constraint 'Key': 'Equatable' inferred from type here public func == <Key: Equatable, Value: Equatable> (lhs: Expectation<[Key: Value]>, rhs: [Key: Value]) throws { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Spectre--9185491864710013835/Sources/Expectation.swift:108:22: warning: redundant conformance constraint 'Key': 'Equatable' public func != <Key: Equatable, Value: Equatable> (lhs: Expectation<[Key: Value]>, rhs: [Key: Value]) throws { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/Spectre--9185491864710013835/Sources/Expectation.swift:108:57: note: conformance constraint 'Key': 'Equatable' inferred from type here public func != <Key: Equatable, Value: Equatable> (lhs: Expectation<[Key: Value]>, rhs: [Key: Value]) throws { ^ Compile Swift Module 'PathKit' (1 sources) /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/ArgumentListManipulator.swift:54:28: warning: 'characters' is deprecated: Please use String or Substring directly node.value.characters.dropFirst().forEach { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/CompletionGenerator.swift:105:63: warning: 'characters' is deprecated: Please use String or Substring directly let sortedNames = option.names.sorted(by: {$0.characters.count > $1.characters.count}) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/CompletionGenerator.swift:105:85: warning: 'characters' is deprecated: Please use String or Substring directly let sortedNames = option.names.sorted(by: {$0.characters.count > $1.characters.count}) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/CompletionGenerator.swift:105:63: warning: 'characters' is deprecated: Please use String or Substring directly let sortedNames = option.names.sorted(by: {$0.characters.count > $1.characters.count}) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/CompletionGenerator.swift:105:85: warning: 'characters' is deprecated: Please use String or Substring directly let sortedNames = option.names.sorted(by: {$0.characters.count > $1.characters.count}) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/HelpMessageGenerator.swift:36:30: warning: 'characters' is deprecated: Please use String or Substring directly if routable.name.characters.count > length { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/HelpMessageGenerator.swift:37:37: warning: 'characters' is deprecated: Please use String or Substring directly return routable.name.characters.count ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/HelpMessageGenerator.swift:36:30: warning: 'characters' is deprecated: Please use String or Substring directly if routable.name.characters.count > length { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/HelpMessageGenerator.swift:37:37: warning: 'characters' is deprecated: Please use String or Substring directly return routable.name.characters.count ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/HelpMessageGenerator.swift:78:38: warning: 'characters' is deprecated: Please use String or Substring directly if option.identifier.characters.count > length { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/HelpMessageGenerator.swift:79:46: warning: 'characters' is deprecated: Please use String or Substring directly return option.identifier.characters.count ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/HelpMessageGenerator.swift:78:38: warning: 'characters' is deprecated: Please use String or Substring directly if option.identifier.characters.count > length { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/HelpMessageGenerator.swift:79:46: warning: 'characters' is deprecated: Please use String or Substring directly return option.identifier.characters.count ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/HelpMessageGenerator.swift:43:91: warning: 'characters' is deprecated: Please use String or Substring directly let spacing = String(repeating: " ", count: maxNameLength + 4 - routable.name.characters.count) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/SwiftCLI-8466703425035036135/Sources/SwiftCLI/Option.swift:18:74: warning: 'characters' is deprecated: Please use String or Substring directly let spacing = String(repeating: " ", count: padding - identifier.characters.count) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/checkouts/PathKit--9185519632264250829/Sources/PathKit.swift:43:34: warning: 'characters' is deprecated: Please use String or Substring directly path = p.substring(from: p.characters.index(after: p.startIndex)) ^ Compile Swift Module 'FlockCLI' (12 sources) /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/main.swift:8:5: warning: 'setup(name:version:description:)' is deprecated: Create a new CLI object: let cli = CLI(..) CLI.setup(name: "flock", version: "0.0.1") ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/main.swift:10:5: warning: 'router' is deprecated: Create a new CLI object: let cli = CLI(..) CLI.router = FlockRouter() ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/FlockRouter.swift:11:7: error: type 'FlockRouter' does not conform to protocol 'Router' class FlockRouter: Router { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/FlockRouter.swift:13:10: note: candidate has non-matching type '([Command], ArgumentList) -> Command?' func route(commands: [Command], arguments: ArgumentList) -> Command? { ^ SwiftCLI.Router:2:17: note: protocol requires function 'route(routables:arguments:)' with type '([Routable], ArgumentList) -> RouteResult'; do you want to add a stub? public func route(routables: [Routable], arguments: SwiftCLI.ArgumentList) -> SwiftCLI.RouteResult ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/main.swift:11:5: error: 'versionCommand' is unavailable: Create the CLI object with a nil version and register a custom version command CLI.versionCommand = VersionCommand() ^~~~~~~~~~~~~~ SwiftCLI.CLI:11:23: note: 'versionCommand' has been explicitly marked unavailable here public static var versionCommand: <null> ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/main.swift:12:19: error: 'HelpCommand' cannot be constructed because it has no accessible initializers CLI.helpCommand = HelpCommand() ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/main.swift:14:5: warning: 'register(command:)' is deprecated: Create a new CLI object: let cli = CLI(..) CLI.register(command: InitCommand()) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/main.swift:15:5: warning: 'register(command:)' is deprecated: Create a new CLI object: let cli = CLI(..) CLI.register(command: BuildCommand()) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/main.swift:16:5: warning: 'register(command:)' is deprecated: Create a new CLI object: let cli = CLI(..) CLI.register(command: UpdateCommand()) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/main.swift:17:5: warning: 'register(command:)' is deprecated: Create a new CLI object: let cli = CLI(..) CLI.register(command: CleanCommand()) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/main.swift:18:5: warning: 'register(command:)' is deprecated: Create a new CLI object: let cli = CLI(..) CLI.register(command: ResetCommand()) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/main.swift:19:5: warning: 'register(command:)' is deprecated: Create a new CLI object: let cli = CLI(..) CLI.register(command: CreateTaskCommand()) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/main.swift:20:5: warning: 'register(command:)' is deprecated: Create a new CLI object: let cli = CLI(..) CLI.register(command: NukeCommand()) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/main.swift:26:10: warning: 'go()' is deprecated: Create a new CLI object: let cli = CLI(..) exit(CLI.go()) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/CreateTaskCommand.swift:25:86: warning: 'characters' is deprecated: Please use String or Substring directly name = name.substring(to: name.index(name.endIndex, offsetBy: taskSuffix.characters.count)) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/CreateTaskCommand.swift:29:34: warning: 'characters' is deprecated: Please use String or Substring directly if let colonIndex = name.characters.index(of: ":") { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/CreateTaskCommand.swift:41:19: warning: 'CLIError' is deprecated: use CLI.Error instead throw CLIError.error("\(path) already exists".red) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/FlockCommand.swift:38:19: warning: 'CLIError' is deprecated: use CLI.Error instead throw CLIError.error("Error: ".red + "Flock has not been initialized in this directory yet - run flock --init") ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/ForwardCommand.swift:31:19: warning: 'CLIError' is deprecated: use CLI.Error instead throw CLIError.error("Error: Flock must be successfully built before tasks can be run".red) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/HelpCommand.swift:15:9: error: overriding non-open let outside of its defining module let name = "--help" ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/HelpCommand.swift:15:9: error: cannot override with a stored property 'name' let name = "--help" ^ SwiftCLI.HelpCommand:2:16: note: attempt to override property here public let name: String ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/HelpCommand.swift:16:9: error: overriding non-open let outside of its defining module let shortDescription = "Prints help information" ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/HelpCommand.swift:16:9: error: cannot override with a stored property 'shortDescription' let shortDescription = "Prints help information" ^ SwiftCLI.HelpCommand:3:16: note: attempt to override property here public let shortDescription: String ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/HelpCommand.swift:21:10: error: overriding non-open instance method outside of its defining module func execute() throws { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/HelpCommand.swift:21:10: error: overriding declaration requires an 'override' keyword func execute() throws { ^ override SwiftCLI.HelpCommand:4:17: note: overridden declaration is here public func execute() throws ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/HelpCommand.swift:13:7: error: cannot inherit from non-open class 'HelpCommand' outside of its defining module class HelpCommand: SwiftCLI.HelpCommand, FlockCommand { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/HelpCommand.swift:28:17: error: value of type 'Command' has no member 'signature' if !command.signature.isEmpty { ^~~~~~~ ~~~~~~~~~ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/HelpCommand.swift:29:29: error: value of type 'Command' has no member 'signature' name += " \(command.signature)" ^~~~~~~ ~~~~~~~~~ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/HelpCommand.swift:50:63: warning: 'characters' is deprecated: Please use String or Substring directly let spacing = String(repeating: " ", count: 20 - name.characters.count) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/InitCommand.swift:22:19: warning: 'CLIError' is deprecated: use CLI.Error instead throw CLIError.error("Error: ".red + "Flock has already been initialized") ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/InitCommand.swift:41:23: warning: 'CLIError' is deprecated: use CLI.Error instead throw CLIError.error("\(path) must not already exist".red) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/InitCommand.swift:93:23: warning: 'CLIError' is deprecated: use CLI.Error instead throw CLIError.error("Couldn't open .gitignore stream") ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/InitCommand.swift:96:63: warning: 'characters' is deprecated: Please use String or Substring directly gitIgnore.write(appendText, maxLength: appendText.characters.count) ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/Paths.swift:41:31: warning: 'characters' is deprecated: Please use String or Substring directly for _ in 0..<(12 - action.characters.count) { ^ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/VersionCommand.swift:17:26: warning: string interpolation produces a debug description for an optional value; did you mean to make this explicit? print("Version: \(CLI.version)") ^~~~~~~~~~~~~ /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/VersionCommand.swift:17:31: note: use 'String(describing:)' to silence this warning print("Version: \(CLI.version)") ~~~~~^~~~~~~~ String(describing: ) /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/VersionCommand.swift:17:31: note: provide a default value to avoid this warning print("Version: \(CLI.version)") ~~~~~^~~~~~~~ ?? <#default value#> /Users/pascalfriedrich/FlockCLI/FlockCLI/Sources/VersionCommand.swift:17:31: warning: 'version' is deprecated: Create a new CLI object: let cli = CLI(..) print("Version: \(CLI.version)") ^ error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/pascalfriedrich/FlockCLI/FlockCLI/.build/release.yaml main

Possibility to choose git branch

Looking through the source, there doesn't seem to be a way to choose which git branch gets cloned.
Is there anyway to do this?

An error occurred while installing.

Thank you for nice project.

I attempted to install Flock by brew, but I couldn’t.

$ brew install jakeheis/repo/flock
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
No changes to formulae.

==> Installing flock from jakeheis/repo
==> Downloading https://github.com/jakeheis/FlockCLI/archive/0.0.1.tar.gz
Already downloaded: /Users/tajika/Library/Caches/Homebrew/flock-0.0.1.tar.gz
==> swift build -c release
Last 15 lines from /Users/tajika/Library/Logs/Homebrew/flock/01.swift:
2016-11-12 18:35:39 +0900

swift build -c release

swift-build: error: invalid inferred toolchain: could not find `clang` at expected path /private/tmp/flock-20161112-90931-igoj2t/FlockCLI-0.0.1/clang

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/jakeheis/homebrew-repo/issues

Next, I tried to install Flock manually, but an error occurred at swift build -c release.

$ git clone https://github.com/jakeheis/FlockCLI
Cloning into 'FlockCLI'...
remote: Counting objects: 305, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 305 (delta 3), reused 0 (delta 0), pack-reused 297
Receiving objects: 100% (305/305), 45.89 KiB | 0 bytes/s, done.
Resolving deltas: 100% (197/197), done.
Checking connectivity... done.

$ cd FlockCLI

$ swift build -c release
Cloning https://github.com/jakeheis/SwiftCLI
HEAD is now at f5ffa65 Remove alias function
Resolved version: 2.0.2
Cloning https://github.com/onevcat/Rainbow
HEAD is now at 4feb43c Bump version to 2.0.1
Resolved version: 2.0.1
Cloning https://github.com/nvzqz/FileKit
HEAD is now at 28767c8 Prepare 4.0.0 release
Resolved version: 4.0.0
Cloning https://github.com/jakeheis/Spawn
HEAD is now at d2a245f Wait
Resolved version: 0.0.4
error: the package has an unsupported layout, unexpected source file(s) found: /Users/tajika/FlockCLI/Packages/FileKit-4.0.0/Tests/FileKitTests.swift
fix: move the file(s) inside a module

Finally, I moved Tests/FileKitTests.swift temporally, swift build is success.

$ mv /Users/tajika/FlockCLI/Packages/FileKit-4.0.0/Tests/FileKitTests.swift /tmp/

$ swift build -c release
Compile Swift Module 'Spawn' (1 sources)
Compile Swift Module 'Rainbow' (11 sources)
Compile Swift Module 'FileKit' (33 sources)
Compile Swift Module 'SwiftCLI' (18 sources)
/Users/tajika/FlockCLI/Packages/FileKit-4.0.0/Sources/Path.swift:1074:17: warning: 'ExpressibleByStringInterpolation' is deprecated: it will be replaced or redesigned in Swift 4.0.  Instead of conforming to 'ExpressibleByStringInterpolation', consider adding an 'init(_:String)'
extension Path: ExpressibleByStringInterpolation {
                ^
Compile Swift Module 'FlockCLI' (13 sources)
Linking ./.build/release/FlockCLI

I do not understand this error properly, but what does this mean?


[My Environment]

Apple Swift version 3.0.1 (swiftlang-800.0.58.6 clang-800.0.42.1)
macOS Sierra 10.12.1

Swift 4 support?

Curious to see if this has support for Swift 4? I'm interested in using this with Vapor.

"The dependency graph could not be satisfied"

After setting up Flock and calling flock --build in the directory, I get the following error:

warning: refname '0.0.3' is ambiguous.
warning: refname '0.0.3' is ambiguous.
HEAD is now at 79051a8 Updated to use supervisord
Resolved version: 0.0.3
error: The dependency graph could not be satisfied (https://github.com/jakeheis/Flock)

Thoughts?

SSH Forward Agent is ignored

My private repository is cloned from gitlab via ssh. We don't add server keys to gitlab as deploy keys – we use ssh ForwardAgent (which is configured in ~/.ssh/config). However, Flock ignores this setting.

Is this still being maintained?

Hello! I'm curious if this repo is still being maintained? After Vapor Red shutdown I'm looking for an easy to use tool to manage my microservices. I stumbled across this repo. I see it hasn't had been updated in awhile.

supervisorctl fails to load vapor

When running flock deploy everything appears to be going well up until the point of supervisorctl reloading.

When it comes to loading up vapor, it fails. The vapor.conf is there, but even running it manually through SSH it fails. I've never used supervisor so i'm at a loss here. Any ideas on what could be going wrong?

Task vapor:write-conf begun:
On [email protected]: mkdir -p /home/deploy/logs
On [email protected]: echo "[program:vapor]
command=/home/deploy/www/App/current/.build/release/App
process_name=%(process_num)s
autostart=false
autorestart=unexpected
stdout_logfile=/home/deploy/logs/vapor.log
stderr_logfile=/home/deploy/logs/vapor.err
" > /etc/supervisor/conf.d/vapor.conf
On [email protected]: supervisorctl reread
vapor: available
On [email protected]: supervisorctl update
vapor: added process group
On [email protected]: supervisorctl restart vapor:*
vapor:0: ERROR (no such file)

error: unsatisfiable

When running flock --build i get the following error:

error: unsatisfiable
An error occurred: The operation couldn’t be completed. (FlockCLI.SPM.Error error 0.)

Flockfile:

import Flock

Flock.configure(base: Base(), environments: [Production(), Staging()])

Flock.use(.deploy)
Flock.use(.swiftenv)
Flock.use(.server)

Flock.run()

Config/deploy/Base.swift:

import Flock
import SSH

class Base: Environment {
	func configure() {
		Config.projectName = "Speakerdex"
		Config.executableName = "Run"
		Config.repoURL = "https://github.com/northplay/api.speakerdex.co.git"
		
		Config.serverFramework = VaporFramework()
		Config.processController = Nohup()
		
        Config.deployDirectory = "/var/www/api.speakerdex.co"
	}
}

FlockPackage.swift

let dependencies: [Package.Dependency] = [
    .Package(url: "https://github.com/jakeheis/Flock", majorVersion: 0),
    .Package(url: "https://github.com/jakeheis/VaporFlock", majorVersion: 0)
]

Restart processes upon error

It would be quite useful to automatically reboot processes that exited with a non-zewo exit code in order to achieve better uptime. Naturally it would be opt-in.

Password protected ssh key asks for password on each command

Just like in the title – password prompt shows up before each flock command.
The key is added to the session via ssh-add earlier, but it gets ignored by Flock's shell sessions.

I'm using ZSH by default, but invoking Flock from bash doesn't seem to change anything.

Error: no such module 'SSH'

When running "flock deploy" I'm getting an "error: no such module 'SSH'" while Swift is trying to compile the module "Flock" (see screenshot).
I have the libssh2 installed via 'brew install libssh2'.

svogelsang_mac15-2____development_projects_portfolioscanner_portfolioscanner-server_ -zsh _196x47

`flock --update` fails

When running flock --update I get the following error:

precondition failed: Failure normalizing https://github.com/jakeheis/Flock, absolute paths should start with '/': file /Users/buildnode/jenkins/workspace/oss-swift-3.1-package-osx/swiftpm/Sources/Basic/Path.swift, line 495

Login as non-sudo user

Right now, Flock requires a sudo account on the server to install into the directory. This could be unsafe, since AWS suggests going through the ubuntu account, which does not default to sudo. Are there any ways around this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.