Skip to content
Snippets Groups Projects
Commit 43ab0486 authored by Fraser Waters's avatar Fraser Waters Committed by Leo
Browse files

testing/pulumi: new aport

https://github.com/pulumi/pulumi
Pulumi's Infrastructure as Code SDK
parent 37598019
No related branches found
No related tags found
No related merge requests found
Workaround some issues with the pulumi build pipeline.
Currently the build system assumes your in a git repo to get the version, and
doesn't quite provide a way to build just the native components we need to
apk package.
diff --git a/Makefile b/Makefile
index 0b81a9de2..26a2f8e8a 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,10 @@ include build/common.mk
PROJECT := github.com/pulumi/pulumi/pkg/v2/cmd/pulumi
PROJECT_PKGS := $(shell cd ./pkg && go list ./... | grep -v /vendor/)
TESTS_PKGS := $(shell cd ./tests && go list ./... | grep -v tests/templates | grep -v /vendor/)
-VERSION := $(shell scripts/get-version HEAD)
+# Allow version to be set manually when building outside of git repo
+ifeq ($(VERSION),)
+ VERSION := $(shell scripts/get-version HEAD)
+endif
TESTPARALLELISM := 10
@@ -53,6 +56,8 @@ install:: generate
install_all:: install
+install_plugin_all:: install
+
dist:: build
cd pkg && go install -ldflags "-X github.com/pulumi/pulumi/pkg/v2/version.Version=${VERSION}" ${PROJECT}
diff --git a/build/common.mk b/build/common.mk
index 20690ac23..c49c5fbd3 100644
--- a/build/common.mk
+++ b/build/common.mk
@@ -128,6 +128,7 @@ only_test_fast:: $(SUB_PROJECTS:%=%_only_test_fast)
default:: $(SUB_PROJECTS:%=%_default)
all:: $(SUB_PROJECTS:%=%_all)
install_all:: $(SUB_PROJECTS:%=%_install_all)
+install_plugin_all:: $(SUB_PROJECTS:%=%_install_plugin_all)
test_all:: $(SUB_PROJECTS:%=%_test_all)
ensure:: $(SUB_PROJECTS:%=%_ensure)
dist:: $(SUB_PROJECTS:%=%_dist)
@@ -212,6 +213,8 @@ $(SUB_PROJECTS:%=%_build):
@$(MAKE) -C ./$(@:%_build=%) build
$(SUB_PROJECTS:%=%_install_all):
@$(MAKE) -C ./$(@:%_install_all=%) install
+$(SUB_PROJECTS:%=%_install_plugin_all):
+ @$(MAKE) -C ./$(@:%_install_plugin_all=%) install_plugin
$(SUB_PROJECTS:%=%_lint):
@$(MAKE) -C ./$(@:%_lint=%) lint
$(SUB_PROJECTS:%=%_test_fast):
diff --git a/sdk/nodejs/Makefile b/sdk/nodejs/Makefile
index 3c5769223..04d92bcfb 100644
--- a/sdk/nodejs/Makefile
+++ b/sdk/nodejs/Makefile
@@ -32,11 +32,11 @@ build_plugin::
build:: build_package build_plugin
-install_package:: build
+install_package:: build_package
cp dist/pulumi-resource-pulumi-nodejs "$(PULUMI_BIN)"
cp dist/pulumi-analyzer-policy "$(PULUMI_BIN)"
-install_plugin:: build
+install_plugin:: build_plugin
GOBIN=$(PULUMI_BIN) go install -ldflags "-X github.com/pulumi/pulumi/sdk/v2/go/common/version.Version=${VERSION}" ${LANGUAGE_HOST}
install:: install_package install_plugin
# Contributor: Fraser Waters <frassle@gmail.com>
# Maintainer: Fraser Waters <frassle@gmail.com>
pkgname=pulumi
pkgver=2.15.6
pkgrel=0
pkgdesc="Pulumi's Infrastructure as Code SDK"
url="https://github.com/pulumi/pulumi"
# x86_64 is the only supported architecture by pulumi
arch="x86_64"
license="Apache-2.0"
depends="ca-certificates"
makedepends="go bash"
source="$pkgname-$pkgver.tar.gz::https://github.com/pulumi/pulumi/archive/v$pkgver.tar.gz
10-install1.patch
"
builddir="$srcdir/github.com/pulumi/$pkgname"
prepare() {
mkdir -p ${builddir%/*}
mv $srcdir/$pkgname-$pkgver "$builddir"/
mkdir -p "$srcdir"/opt
default_prepare
}
build() {
export GOFLAGS="$GOFLAGS -modcacherw"
VERSION="v$pkgver" PULUMI_ROOT="$srcdir"/opt GOPATH="$srcdir" make install_plugin_all
}
check() {
# It would be good to at least run the fast tests but this hits OOM on the alpine pipelines
# PULUMI_ROOT="$srcdir"/opt GOPATH="$srcdir" make test_fast
[ "$("$srcdir"/opt/bin/"$pkgname" version)" == "v$pkgver" ]
}
package() {
install -Dm755 -t "$pkgdir"/usr/bin "$srcdir"/opt/bin/*
}
sha512sums="23d574935d6021623d772e6da80a4d14c938aa11ea69f8d706e123eb1075e070c04be3075fecd2ca1804af66600c7fd2cd8b555988dcc90039fbbfd1d22f50b5 pulumi-2.15.6.tar.gz
56bfc1908b8728f241cae804fdb010910db763ddfbb39417e7173654d522d3dadcc063176172e894f23fc6306f31e521c65a83ca567d384f2cdeefffd071db40 10-install1.patch"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment