Skip to content

Commit

Permalink
Separate concourse and fly (NixOS#11)
Browse files Browse the repository at this point in the history
* separate concourse and fly

* move preBuild commands out of buildConcourse

* different names for different derivations
  • Loading branch information
dingxiangfei2009 authored and corpix committed Jul 28, 2019
1 parent ca448f9 commit 2dae618
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 28 deletions.
69 changes: 42 additions & 27 deletions pkgs/development/tools/continuous-integration/concourse/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,50 @@ let
mkResourcesDir = callPackage ./assets/resources/make-resource-dir.nix {};

resourceDir = mkResourcesDir resources;

buildConcourse = { name, packages, platforms, passthru ? {}, preBuild ? "" }:
buildGoPackage rec {
inherit name;
goPackagePath = "github.com/concourse/concourse";
subPackages = packages;
goDeps = ./deps.nix;
nativeBuildInputs = [ go-packr ];
inherit src;

inherit passthru;

# TODO: Get Worker version
#-X github.com/concourse/atc/atccmd.WorkerVersion=${worker_version}
#-X main.WorkerVersion=${worker_version}
buildFlagsArray = ''
-ldflags=
-X github.com/concourse/concourse/fly/version.Version=${version}
-X main.Version=${version}
-X github.com/concourse/concourse/atc/atccmd.Version=${version}
'';

meta = {
inherit platforms;
};
};
in
buildGoPackage rec {
passthru = {
inherit resources main-asset mkResourcesDir resourceDir;
{
concourse = buildConcourse {
name = "concourse-unstable";
passthru = {
inherit resources main-asset mkResourcesDir resourceDir;
};
packages = [ "bin/cmd/concourse" ];
platforms = stdenv.lib.platforms.linux;
preBuild =''
cp -R ${main-asset}/. go/src/github.com/concourse/concourse/web/
packr -i go/src/github.com/concourse
'';
};

name = "concourse-unstable";
goPackagePath = "github.com/concourse/concourse";
subPackages = [ "bin/cmd/concourse" "fly"];
goDeps = ./deps.nix;
nativeBuildInputs = [ go-packr ];
inherit src;

preBuild = ''
cp -R ${main-asset}/. go/src/github.com/concourse/concourse/web/
packr -i go/src/github.com/concourse
'';

# TODO: Get Worker version
#-X github.com/concourse/atc/atccmd.WorkerVersion=${worker_version}
#-X main.WorkerVersion=${worker_version}
buildFlagsArray = ''
-ldflags=
-X github.com/concourse/concourse/fly/version.Version=${version}
-X main.Version=${version}
-X github.com/concourse/concourse/atc/atccmd.Version=${version}
'';

meta = {
platforms = stdenv.lib.platforms.linux;
fly = buildConcourse {
name = "fly-unstable";
packages = [ "fly" ];
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
};
}
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ in

corgi = callPackage ../development/tools/corgi { };

concourse = callPackage ../development/tools/continuous-integration/concourse { };
inherit (callPackage ../development/tools/continuous-integration/concourse { }) concourse fly;

garden-runc = callPackage ../development/tools/continuous-integration/concourse/garden-runc { };

Expand Down

0 comments on commit 2dae618

Please sign in to comment.