From 27ef2b131819b877b80608ea0a154134beccb86b Mon Sep 17 00:00:00 2001 From: Kevin Minehart Date: Tue, 1 Oct 2024 19:38:32 -0500 Subject: [PATCH] fix npm bug; add support for +security in rpm and in debs --- artifacts/package_deb.go | 2 +- artifacts/package_rpm.go | 2 +- frontend/npm.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/artifacts/package_deb.go b/artifacts/package_deb.go index f88364b..e2e2784 100644 --- a/artifacts/package_deb.go +++ b/artifacts/package_deb.go @@ -69,7 +69,7 @@ func (d *Deb) BuildFile(ctx context.Context, builder *dagger.Container, opts *pi return fpm.Build(builder, fpm.BuildOpts{ Name: d.Name, Enterprise: d.Enterprise, - Version: d.Version, + Version: debVersion(d.Version), BuildID: d.BuildID, Distribution: d.Distribution, PackageType: fpm.PackageTypeDeb, diff --git a/artifacts/package_rpm.go b/artifacts/package_rpm.go index 75b1452..3165526 100644 --- a/artifacts/package_rpm.go +++ b/artifacts/package_rpm.go @@ -85,7 +85,7 @@ func (d *RPM) BuildFile(ctx context.Context, builder *dagger.Container, opts *pi rpm := fpm.Build(builder, fpm.BuildOpts{ Name: d.Name, Enterprise: d.Enterprise, - Version: d.Version, + Version: rpmVersion(d.Version), BuildID: d.BuildID, Distribution: d.Distribution, PackageType: fpm.PackageTypeRPM, diff --git a/frontend/npm.go b/frontend/npm.go index 90404d4..ad94cb1 100644 --- a/frontend/npm.go +++ b/frontend/npm.go @@ -11,10 +11,10 @@ import ( // NPMPackages returns a dagger.Directory which contains the Grafana NPM packages from the grafana source code. func NPMPackages(builder *dagger.Container, src *dagger.Directory, ersion string) *dagger.Directory { return builder.WithExec([]string{"mkdir", "npm-packages"}). + WithEnvVariable("SHELL", "/bin/bash"). WithExec([]string{"yarn", "install", "--immutable"}). WithExec([]string{"yarn", "run", "packages:build"}). - WithExec([]string{"/bin/bash", "-c", fmt.Sprintf("yarn run lerna --loglevel=debug version %s --exact --no-git-tag-version --no-push --force-publish -y", ersion)}). - WithExec([]string{"/bin/bash", "-c", fmt.Sprintf("yarn lerna exec --loglevel=debug --no-private -- yarn pack --out /src/npm-packages/%%s-%v.tgz", "v"+ersion)}). + WithExec([]string{"/bin/bash", "-c", fmt.Sprintf("yarn run lerna version %s --exact --no-git-tag-version --no-push --force-publish -y && yarn lerna exec --no-private -- yarn pack --out /src/npm-packages/%%s-%v.tgz", ersion, "v"+ersion)}). Directory("./npm-packages") }