about summary refs log tree commit diff
path: root/pkgs/development/tools/continuous-integration/woodpecker/frontend.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/continuous-integration/woodpecker/frontend.nix')
-rw-r--r--pkgs/development/tools/continuous-integration/woodpecker/frontend.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/development/tools/continuous-integration/woodpecker/frontend.nix b/pkgs/development/tools/continuous-integration/woodpecker/frontend.nix
new file mode 100644
index 0000000000000..267fdc13985a9
--- /dev/null
+++ b/pkgs/development/tools/continuous-integration/woodpecker/frontend.nix
@@ -0,0 +1,40 @@
+{ lib, callPackage, fetchFromGitHub, fetchYarnDeps, mkYarnPackage }:
+let
+  common = callPackage ./common.nix { };
+in
+mkYarnPackage {
+  pname = "woodpecker-frontend";
+  inherit (common) version;
+
+  src = "${common.src}/web";
+
+  packageJSON = ./woodpecker-package.json;
+  offlineCache = fetchYarnDeps {
+    yarnLock = "${common.src}/web/yarn.lock";
+    sha256 = common.yarnSha256;
+  };
+
+  buildPhase = ''
+    runHook preBuild
+
+    yarn build
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    cp -R deps/woodpecker-ci/dist $out
+    echo "${common.version}" > "$out/version"
+
+    runHook postInstall
+  '';
+
+  # Do not attempt generating a tarball for woodpecker-frontend again.
+  doDist = false;
+
+  meta = common.meta // {
+    description = "Woodpecker Continuous Integration server frontend";
+  };
+}