fly: init at 5.3.0

Add `fly` CLI for working with Concourse CI, and include Bash
completions.
This commit is contained in:
ivanbrennan 2019-07-13 18:55:22 -04:00
parent 5851594937
commit 9e465d2f60
No known key found for this signature in database
GPG Key ID: 79C3C47DC652EA54
3 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,37 @@
{ buildGoModule, fetchFromGitHub, lib, writeText }:
buildGoModule rec {
pname = "fly";
version = "5.3.0";
src = fetchFromGitHub {
owner = "concourse";
repo = "concourse";
rev = "v${version}";
sha256 = "06ns98k47nafhkkj7gkmxp7msn4ssypyss6ll0fm6380vq2cavnj";
};
modSha256 = "11rnlmn5hp9nsgkmd716dsjmkr273035j9gzfhjxjsfpiax60i0a";
subPackages = [ "fly" ];
buildFlagsArray = ''
-ldflags=
-X github.com/concourse/concourse.Version=${version}
'';
# The fly.bash file included with this derivation can be replaced by a
# call to `fly completion bash` once the `completion` subcommand has
# made it into a release. Similarly, `fly completion zsh` will provide
# zsh completions. https://github.com/concourse/concourse/pull/4012
postInstall = ''
install -D -m 444 ${./fly.bash} $out/share/bash-completion/completions/fly
'';
meta = with lib; {
description = "A command line interface to Concourse CI";
homepage = https://concourse-ci.org;
license = licenses.asl20;
maintainers = with maintainers; [ ivanbrennan ];
};
}

View File

@ -0,0 +1,10 @@
# credits:
# https://godoc.org/github.com/jessevdk/go-flags#hdr-Completion
# https://github.com/concourse/concourse/issues/1309#issuecomment-452893900
_fly_compl() {
args=("${COMP_WORDS[@]:1:$COMP_CWORD}")
local IFS=$'\n'
COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} "${args[@]}"))
return 0
}
complete -F _fly_compl fly

View File

@ -9244,6 +9244,8 @@ in
inherit (darwin) cf-private;
};
fly = callPackage ../development/tools/continuous-integration/fly { };
foreman = callPackage ../tools/system/foreman { };
goreman = callPackage ../tools/system/goreman { };