mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-02-08 19:08:40 -05:00
bazel: used sed from nixpkgs (#2706)
This is required since sed on macos has different flags and may behave differently. Co-authored-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
6db0318b2f
commit
4c8041d2cf
@ -91,6 +91,11 @@ nixpkgs_package(
|
|||||||
repository = "@nixpkgs",
|
repository = "@nixpkgs",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
nixpkgs_package(
|
||||||
|
name = "gnused",
|
||||||
|
repository = "@nixpkgs",
|
||||||
|
)
|
||||||
|
|
||||||
load("//nix/cc:nixpkgs_cc_libraries.bzl", "nixpkgs_cc_library_deps")
|
load("//nix/cc:nixpkgs_cc_libraries.bzl", "nixpkgs_cc_library_deps")
|
||||||
|
|
||||||
nixpkgs_cc_library_deps()
|
nixpkgs_cc_library_deps()
|
||||||
|
@ -12,6 +12,7 @@ sh_template(
|
|||||||
"//terraform-provider-constellation:terraform_rc",
|
"//terraform-provider-constellation:terraform_rc",
|
||||||
"//terraform-provider-constellation:tf_provider",
|
"//terraform-provider-constellation:tf_provider",
|
||||||
"//upgrade-agent/cmd:upgrade_agent_linux_amd64",
|
"//upgrade-agent/cmd:upgrade_agent_linux_amd64",
|
||||||
|
"@gnused//:bin/sed",
|
||||||
"@yq_toolchains//:resolved_toolchain",
|
"@yq_toolchains//:resolved_toolchain",
|
||||||
],
|
],
|
||||||
substitutions = {
|
substitutions = {
|
||||||
@ -20,6 +21,7 @@ sh_template(
|
|||||||
"@@CLI@@": "$(rootpath //cli:cli_edition_host)",
|
"@@CLI@@": "$(rootpath //cli:cli_edition_host)",
|
||||||
"@@CONTAINER_SUMS@@": "$(rootpath //bazel/release:container_sums)",
|
"@@CONTAINER_SUMS@@": "$(rootpath //bazel/release:container_sums)",
|
||||||
"@@EDITION@@": "$(rootpath :devbuild_cli_edition)",
|
"@@EDITION@@": "$(rootpath :devbuild_cli_edition)",
|
||||||
|
"@@SED@@": "$(rootpath @gnused//:bin/sed)",
|
||||||
"@@TERRAFORM_PROVIDER@@": "$(rootpath //terraform-provider-constellation:tf_provider)",
|
"@@TERRAFORM_PROVIDER@@": "$(rootpath //terraform-provider-constellation:tf_provider)",
|
||||||
"@@TERRAFORM_RC@@": "$(rootpath //terraform-provider-constellation:terraform_rc)",
|
"@@TERRAFORM_RC@@": "$(rootpath //terraform-provider-constellation:terraform_rc)",
|
||||||
"@@UPGRADE_AGENT@@": "$(rootpath //upgrade-agent/cmd:upgrade_agent_linux_amd64)",
|
"@@UPGRADE_AGENT@@": "$(rootpath //upgrade-agent/cmd:upgrade_agent_linux_amd64)",
|
||||||
|
@ -16,6 +16,8 @@ fi
|
|||||||
|
|
||||||
yq=$(realpath @@YQ@@)
|
yq=$(realpath @@YQ@@)
|
||||||
stat "${yq}" >> /dev/null
|
stat "${yq}" >> /dev/null
|
||||||
|
sed=$(realpath @@SED@@)
|
||||||
|
stat "${sed}" >> /dev/null
|
||||||
bootstrapper=$(realpath @@BOOTSTRAPPER@@)
|
bootstrapper=$(realpath @@BOOTSTRAPPER@@)
|
||||||
stat "${bootstrapper}" >> /dev/null
|
stat "${bootstrapper}" >> /dev/null
|
||||||
upgrade_agent=$(realpath @@UPGRADE_AGENT@@)
|
upgrade_agent=$(realpath @@UPGRADE_AGENT@@)
|
||||||
@ -70,7 +72,7 @@ TF_PROVIDER_DIR="${workdir}/terraform"
|
|||||||
mkdir -p "${TF_PROVIDER_DIR}"
|
mkdir -p "${TF_PROVIDER_DIR}"
|
||||||
ln -sf "$(replace_prefix "${host_cache}" "${builder_cache}" "${terraform_provider}")" "${TF_PROVIDER_DIR}/terraform-provider-constellation"
|
ln -sf "$(replace_prefix "${host_cache}" "${builder_cache}" "${terraform_provider}")" "${TF_PROVIDER_DIR}/terraform-provider-constellation"
|
||||||
cp "$(replace_prefix "${host_cache}" "${builder_cache}" "${terraform_rc}")" "${TF_PROVIDER_DIR}/config.tfrc"
|
cp "$(replace_prefix "${host_cache}" "${builder_cache}" "${terraform_rc}")" "${TF_PROVIDER_DIR}/config.tfrc"
|
||||||
sed -i "s|@@TERRAFORM_PROVIDER_PATH@@|$(dirname "${terraform_provider}")|g" "${TF_PROVIDER_DIR}/config.tfrc"
|
${sed} -i "s|@@TERRAFORM_PROVIDER_PATH@@|$(dirname "${terraform_provider}")|g" "${TF_PROVIDER_DIR}/config.tfrc"
|
||||||
|
|
||||||
build_version=$("${cli}" version | grep ^Version: | awk '{print $2}')
|
build_version=$("${cli}" version | grep ^Version: | awk '{print $2}')
|
||||||
if [[ ! -f "${workdir}/constellation-conf.yaml" ]]; then
|
if [[ ! -f "${workdir}/constellation-conf.yaml" ]]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user