woodpecker-*: 0.15.11 -> 1.0.0

This commit is contained in:
Bruno BELANYI 2023-07-30 13:40:17 +01:00 committed by Anderson Torres
parent 1e0ff6105a
commit 57cfb2aca0
8 changed files with 3315 additions and 63 deletions

View file

@ -1,11 +1,10 @@
{ lib, buildGoModule, callPackage, fetchFromGitHub }:
{ buildGoModule, callPackage }:
let
common = callPackage ./common.nix { };
in
buildGoModule {
pname = "woodpecker-agent";
inherit (common) version src ldflags postBuild;
vendorSha256 = null;
inherit (common) version src ldflags postInstall vendorHash;
subPackages = "cmd/agent";

View file

@ -1,11 +1,10 @@
{ lib, buildGoModule, callPackage, fetchFromGitHub }:
{ buildGoModule, callPackage }:
let
common = callPackage ./common.nix { };
in
buildGoModule {
pname = "woodpecker-cli";
inherit (common) version src ldflags postBuild;
vendorSha256 = null;
inherit (common) version src ldflags postInstall vendorHash;
subPackages = "cmd/cli";

View file

@ -1,11 +1,12 @@
{ lib, fetchFromGitHub }:
let
version = "0.15.11";
srcHash = "sha256-iDcEkaR1ZvH7Q68sxbwOiP1WKbkiDhCOtkuipbjXHKM=";
yarnHash = "sha256-PY0BIBbjyi2DG+n5x/IPc0AwrFSwII4huMDU+FeZ/Sc=";
version = "1.0.0";
srcHash = "sha256-1HSSHR3myn1x75kO/70w1p21a7dHwFiC7iAH/KRoYsE=";
vendorHash = "sha256-UFTK3EK8eYB3/iKxycCIkSHdLsKGnDkYCpoFJSajm5M=";
yarnHash = "sha256-QNeQwWU36A05zaARWmqEOhfyZRW68OgF4wTonQLYQfs=";
in
{
inherit version yarnHash;
inherit version yarnHash vendorHash;
src = fetchFromGitHub {
owner = "woodpecker-ci";
@ -14,8 +15,8 @@ in
hash = srcHash;
};
postBuild = ''
cd $GOPATH/bin
postInstall = ''
cd $out/bin
for f in *; do
mv -- "$f" "woodpecker-$f"
done

View file

@ -1,6 +1,19 @@
{ lib, callPackage, fetchFromGitHub, fetchYarnDeps, mkYarnPackage }:
{ lib, buildPackages, callPackage, fetchFromGitHub, fetchYarnDeps, mkYarnPackage }:
let
common = callPackage ./common.nix { };
esbuild_0_17_19 = buildPackages.esbuild.overrideAttrs (_: rec {
version = "0.17.19";
src = fetchFromGitHub {
owner = "evanw";
repo = "esbuild";
rev = "v${version}";
hash = "sha256-PLC7OJLSOiDq4OjvrdfCawZPfbfuZix4Waopzrj8qsU=";
};
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
});
in
mkYarnPackage {
pname = "woodpecker-frontend";
@ -9,15 +22,19 @@ mkYarnPackage {
src = "${common.src}/web";
packageJSON = ./woodpecker-package.json;
yarnLock = ./yarn.lock;
offlineCache = fetchYarnDeps {
yarnLock = "${common.src}/web/yarn.lock";
yarnLock = ./yarn.lock;
hash = common.yarnHash;
};
ESBUILD_BINARY_PATH = lib.getExe esbuild_0_17_19;
buildPhase = ''
runHook preBuild
yarn build
yarn --offline build
runHook postBuild
'';

View file

@ -1,11 +1,10 @@
{ lib, buildGoModule, callPackage, fetchFromGitHub, woodpecker-frontend }:
{ buildGoModule, callPackage, woodpecker-frontend }:
let
common = callPackage ./common.nix { };
in
buildGoModule {
pname = "woodpecker-server";
inherit (common) version src ldflags postBuild;
vendorSha256 = null;
inherit (common) version src ldflags postInstall vendorHash;
postPatch = ''
cp -r ${woodpecker-frontend} web/dist

View file

@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix wget prefetch-yarn-deps nix-prefetch-github jq
#!nix-shell -i bash -p nix wget prefetch-yarn-deps nix-prefetch-github jq nix-prefetch pnpm-lock-export
# shellcheck shell=bash
@ -30,20 +30,24 @@ version="${version#v}"
# Woodpecker repository
src_hash=$(nix-prefetch-github woodpecker-ci woodpecker --rev "v${version}" | jq -r .hash)
# Go modules
vendorHash=$(nix-prefetch '{ sha256 }: (callPackage (import ./cli.nix) { }).goModules.overrideAttrs (_: { modHash = sha256; })')
# Front-end dependencies
woodpecker_src="https://raw.githubusercontent.com/woodpecker-ci/woodpecker/v$version"
wget "${TOKEN_ARGS[@]}" "$woodpecker_src/web/package.json" -O woodpecker-package.json
web_tmpdir=$(mktemp -d)
trap 'rm -rf "$web_tmpdir"' EXIT
pushd "$web_tmpdir"
wget "${TOKEN_ARGS[@]}" "$woodpecker_src/web/yarn.lock"
trap 'rm -rf pnpm-lock.yaml' EXIT
wget "${TOKEN_ARGS[@]}" "$woodpecker_src/web/pnpm-lock.yaml"
pnpm-lock-export --schema yarn.lock@v1
yarn_hash=$(prefetch-yarn-deps yarn.lock)
popd
# Use friendlier hashes
src_hash=$(nix hash to-sri --type sha256 "$src_hash")
vendorHash=$(nix hash to-sri --type sha256 "$vendorHash")
yarn_hash=$(nix hash to-sri --type sha256 "$yarn_hash")
sed -i -E -e "s#version = \".*\"#version = \"$version\"#" common.nix
sed -i -E -e "s#srcHash = \".*\"#srcHash = \"$src_hash\"#" common.nix
sed -i -E -e "s#vendorHash = \".*\"#vendorHash = \"$vendorHash\"#" common.nix
sed -i -E -e "s#yarnHash = \".*\"#yarnHash = \"$yarn_hash\"#" common.nix

View file

@ -17,46 +17,60 @@
"test": "echo 'No tests configured' && exit 0"
},
"dependencies": {
"@kyvg/vue3-notification": "2.3.4",
"ansi-to-html": "0.7.2",
"dayjs": "1.10.7",
"floating-vue": "2.0.0-beta.5",
"fuse.js": "6.4.6",
"humanize-duration": "3.27.0",
"javascript-time-ago": "2.3.10",
"node-emoji": "1.11.0",
"pinia": "2.0.0",
"vue": "v3.2.20",
"vue-router": "4.0.10"
"@intlify/unplugin-vue-i18n": "^0.10.1",
"@kyvg/vue3-notification": "^2.9.1",
"@vueuse/core": "^9.13.0",
"ansi_up": "^5.2.1",
"dayjs": "^1.11.9",
"floating-vue": "^2.0.0-beta.24",
"fuse.js": "^6.6.2",
"humanize-duration": "^3.28.0",
"javascript-time-ago": "^2.5.9",
"lodash": "^4.17.21",
"node-emoji": "^1.11.0",
"pinia": "^2.1.4",
"prismjs": "^1.29.0",
"vue": "^3.3.4",
"vue-i18n": "^9.2.2",
"vue-router": "^4.2.2"
},
"devDependencies": {
"@iconify/json": "1.1.421",
"@types/humanize-duration": "3.27.0",
"@types/javascript-time-ago": "2.0.3",
"@types/node": "16.11.6",
"@types/node-emoji": "1.8.1",
"@typescript-eslint/eslint-plugin": "5.6.0",
"@typescript-eslint/parser": "5.6.0",
"@vitejs/plugin-vue": "1.9.4",
"@vue/compiler-sfc": "3.2.20",
"eslint": "7.32.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "16.1.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-promise": "5.1.1",
"eslint-plugin-simple-import-sort": "7.0.0",
"eslint-plugin-vue": "7.18.0",
"eslint-plugin-vue-scoped-css": "1.3.0",
"prettier": "2.4.1",
"typescript": "4.4.4",
"unplugin-icons": "0.12.17",
"unplugin-vue-components": "0.17.0",
"vite": "2.9.13",
"vite-plugin-windicss": "1.4.12",
"vite-svg-loader": "3.0.0",
"vue-tsc": "0.28.10",
"windicss": "3.2.0"
"@iconify/json": "^2.2.85",
"@types/humanize-duration": "^3.27.1",
"@types/javascript-time-ago": "^2.0.3",
"@types/lodash": "^4.14.195",
"@types/node": "^18.16.19",
"@types/node-emoji": "^1.8.2",
"@types/prismjs": "^1.26.0",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/compiler-sfc": "^3.3.4",
"eslint": "^8.44.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-vue": "^9.15.1",
"eslint-plugin-vue-scoped-css": "^2.5.0",
"prettier": "^2.8.8",
"typescript": "5.0.3",
"unplugin-icons": "^0.16.3",
"unplugin-vue-components": "^0.24.1",
"vite": "^4.3.9",
"vite-plugin-prismjs": "^0.0.8",
"vite-plugin-windicss": "^1.9.0",
"vite-svg-loader": "^4.0.0",
"vue-eslint-parser": "^9.3.1",
"vue-tsc": "^1.8.3",
"windicss": "^3.5.6"
},
"pnpm": {
"overrides": {
"semver@<7.5.2": ">=7.5.2"
}
}
}

File diff suppressed because it is too large Load diff