mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
Build Cloud services with Nix. (#1019)
Changes to the Nix build to support Hasura cloud services. V3_GIT_ORIGIN_REV_ID: 39fc7e0a005c30ed6ecbfed8dbcd0cd3839aafbd
This commit is contained in:
parent
43daeffcca
commit
288c973ac7
@ -45,6 +45,9 @@
|
||||
"dev-auth-webhook"
|
||||
];
|
||||
|
||||
binaryPackages = {
|
||||
};
|
||||
|
||||
defaultBinary = "engine";
|
||||
|
||||
dockerConfig = {
|
||||
@ -107,6 +110,7 @@
|
||||
binary = rust.${targetSystem}.callPackage ./nix/app.nix {
|
||||
inherit version;
|
||||
pname = binaryName;
|
||||
packageName = binaryPackages.${binaryName} or binaryName;
|
||||
};
|
||||
docker =
|
||||
if dockerArchitectures ? ${targetSystem}
|
||||
@ -116,7 +120,7 @@
|
||||
package = self.targets.${localSystem}.${binaryName}.${targetSystem}.binary;
|
||||
architecture = dockerArchitectures.${targetSystem};
|
||||
image-name = "build.internal/${binaryName}-${targetSystem}";
|
||||
extraConfig = dockerConfig.${binaryName};
|
||||
extraConfig = dockerConfig.${binaryName} or { };
|
||||
}
|
||||
else null;
|
||||
})
|
||||
|
@ -9,6 +9,7 @@
|
||||
, protobuf
|
||||
, darwin
|
||||
, pname
|
||||
, packageName ? pname
|
||||
}:
|
||||
let
|
||||
buildArgs = {
|
||||
@ -42,13 +43,13 @@ let
|
||||
};
|
||||
|
||||
# only build the binary we care about
|
||||
cargoExtraArgs = "--package ${buildArgs.pname}";
|
||||
cargoExtraArgs = "--package ${packageName}";
|
||||
|
||||
# Build the dependencies first.
|
||||
cargoArtifacts = craneLib.buildDepsOnly (buildArgs //
|
||||
{
|
||||
# without this we'll build deps for the entire workspace every time
|
||||
buildPhaseCargoCommand = "cargo build --profile $CARGO_PROFILE --package ${buildArgs.pname}";
|
||||
buildPhaseCargoCommand = "cargo build --profile $CARGO_PROFILE --package ${packageName}";
|
||||
doCheck = false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user