Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions build-tools/cncluster
Original file line number Diff line number Diff line change
Expand Up @@ -2122,17 +2122,18 @@ function subcmd_purge_unused_dbs() {
subcommand_whitelist[set_operator_deployment_reference]="Set the git reference for the operator deployment in the cluster config file"
function subcmd_set_operator_deployment_reference() {

if [ "$#" -lt 2 ]; then
echo "Usage: $0 set_operator_deployment_reference <branch> <repo>"
# TODO(#1062): remove the ignored parameter once the base version for migration tests is >= 0.4.2
if [ "$#" -lt 1 ]; then
echo "Usage: $0 set_operator_deployment_reference <branch> [<ignored>]"
exit 1
fi
if [ "$#" -gt 2 ]; then
echo "Usage: $0 set_operator_deployment_reference <branch> <repo>"
echo "Usage: $0 set_operator_deployment_reference <branch> [<ignored>]"
exit 1
fi
deployment_config=$(cat <<EOF
reference:
$(_get_flux_reference_config "$1" "$2" " ")
$(_get_flux_reference_config "$1" " ")
EOF
)
_update_cluster_config "$deployment_config" "operatorDeployment"
Expand Down
11 changes: 6 additions & 5 deletions build-tools/lib/hard-domain-migration-commands
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function subcmd_update_config() {
migration_id="$2"
shift 2
else
_error "Usage: $0 $SCRIPTNAME migration_type migration_id [version] [<git_reference> <git_repo>]"
# TODO(#1062): remove the ignored parameter once the base version for migration tests is >= 0.4.2
_error "Usage: $0 $SCRIPTNAME migration_type migration_id [version] [<git_reference> [<ignored>]]"
fi
local migration_config
migration_config=$(cat <<EOF
Expand All @@ -34,17 +35,17 @@ EOF
)
shift
fi
# TODO(#1062): remove the ignored parameter once the base version for migration tests is >= 0.4.2
if [ "$#" -gt 0 ]; then
if [ "$#" -lt 2 ]; then
_error "Usage: $0 $SCRIPTNAME migration_type migration_id [version] [<git_reference> <git_repo>]"
if [ "$#" -lt 1 ]; then
_error "Usage: $0 $SCRIPTNAME migration_type migration_id [version] [<git_reference> [<ignored>]]"
fi
git_reference="$1"
git_repo="$2"
shift
migration_config+=$(cat <<EOF

releaseReference:
$(_get_flux_reference_config $git_reference $git_repo " ")
$(_get_flux_reference_config $git_reference " ")
EOF
)
fi
Expand Down
33 changes: 5 additions & 28 deletions build-tools/lib/pulumi-helpers
Original file line number Diff line number Diff line change
Expand Up @@ -169,32 +169,12 @@ function _killable_pulumi_automation_run() {

function _get_flux_reference_config() {
gitRef="$1"
repo="$2"
indentation="$3"
if [ "$repo" == "canton-network-node" ]; then

cat <<EOF
${indentation}repoUrl: https://github.com/DACH-NY/canton-network-node
${indentation}gitReference: $gitRef
${indentation}pulumiStacksDir: "cluster/stacks/$(basename $PULUMI_STACKS_DIR)"
${indentation}pulumiBaseDir: "cluster/pulumi"
${indentation}deploymentDir: "cluster/deployment"
${indentation}spliceRoot: "."
${indentation}privateConfigsDir: "cluster/configs-private"
${indentation}publicConfigsDir: "cluster/configs"
EOF

elif [ "$repo" == "canton-network-internal" ]; then

if [ -z "${DA_REPO_ROOT:-}" ]; then
_error "Deploying from canton-network-internal should be configured only from that repo"
fi
# TODO(#17841): once we stop symlinking deployment directories from splice
# to canton-network-internal, assert here that the cluster has been fully
# migrated to the internal repo (i.e. its deployment dir and stack files
# exist there)
indentation="$2"
if [ -z "${DA_REPO_ROOT:-}" ]; then
_error "Deploying from canton-network-internal should be configured only from that repo"
fi

cat <<EOF
cat <<EOF
${indentation}repoUrl: https://github.com/DACH-NY/canton-network-internal
${indentation}gitReference: $gitRef
${indentation}pulumiBaseDir: "splice/cluster/pulumi"
Expand All @@ -204,9 +184,6 @@ ${indentation}spliceRoot: "splice"
${indentation}privateConfigsDir: "cluster/configs/configs-private"
${indentation}publicConfigsDir: "cluster/configs/configs"
EOF
else
_error "Unknown repo $repo"
fi
}

# Update the cluster config file
Expand Down