Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
rzetelskik committed Jan 8, 2025
1 parent 8210781 commit 4570486
Showing 1 changed file with 34 additions and 30 deletions.
64 changes: 34 additions & 30 deletions hack/ci-deploy-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,42 +97,46 @@ else
echo "Skipping CSI driver creation"
fi

# TODO: modify log level
if [[ -z "${SO_SCYLLACLUSTER_STORAGECLASS_NAME+x}" ]]; then
kubectl_create -n=scylla-manager -f="${source_url}/${revision}/deploy/manager-prod.yaml"
elif [[ -n "${SO_SCYLLACLUSTER_STORAGECLASS_NAME}" ]]; then
cat > "${ARTIFACTS_DEPLOY_DIR}/manager/kustomization.yaml" << EOF
cat > "${ARTIFACTS_DEPLOY_DIR}/manager/kustomization.yaml" << EOF
resources:
- ${source_url}/${revision}/deploy/manager-prod.yaml
patches:
- target:
group: scylla.scylladb.com
version: v1
kind: ScyllaCluster
name: scylla-manager-cluster
patch: |
- op: replace
path: /spec/datacenter/racks/0/storage/storageClassName
value: "${SO_SCYLLACLUSTER_STORAGECLASS_NAME}"
patches: []
EOF
kubectl kustomize "${ARTIFACTS_DEPLOY_DIR}/manager" | kubectl_create -n=scylla-manager -f=-
else
cat > "${ARTIFACTS_DEPLOY_DIR}/manager/kustomization.yaml" << EOF
resources:
- ${source_url}/${revision}/deploy/manager-prod.yaml
patches:
- target:
group: scylla.scylladb.com
version: v1
kind: ScyllaCluster
name: scylla-manager-cluster
patch: |
- op: remove
path: /spec/datacenter/racks/0/storage/storageClassName

if [[ -n "${SO_SCYLLACLUSTER_STORAGECLASS_NAME:-}" ]]; then
# SO_SCYLLACLUSTER_STORAGECLASS_NAME is set and nonempty.
cat > "${ARTIFACTS_DEPLOY_DIR}/manager/storageclass-name.patch.json" << EOF
[{"op": "replace", "path": "/spec/datacenter/racks/0/storage/storageClassName", "value": "${SO_SCYLLACLUSTER_STORAGECLASS_NAME}"}]
EOF

cat << EOF | yq eval-all 'select(fileIndex == 0) as $f | select(fileIndex == 1) as $p | with( $f.patches; . += $p | ... style="") | $f' "${ARTIFACTS_DEPLOY_DIR}/manager/kustomization.yaml" -
path: "${ARTIFACTS_DEPLOY_DIR}/manager/storageclass-name.patch.json"
target:
group: scylla.scylladb.com
version: v1
kind: ScyllaCluster
name: scylla-manager-cluster
EOF

elif [[ -n "${SO_SCYLLACLUSTER_STORAGECLASS_NAME+x}" ]]; then
# SO_SCYLLACLUSTER_STORAGECLASS_NAME is set and empty.
cat > "${ARTIFACTS_DEPLOY_DIR}/manager/storageclass-name.patch.json" << EOF
[{"op": "remove", "path": "/spec/datacenter/racks/0/storage/storageClassName"}]
EOF

cat << EOF | yq eval-all 'select(fileIndex == 0) as $f | select(fileIndex == 1) as $p | with( $f.patches; . += $p | ... style="") | $f' "${ARTIFACTS_DEPLOY_DIR}/manager/kustomization.yaml" -
path: "${ARTIFACTS_DEPLOY_DIR}/manager/storageclass-name.patch.json"
target:
group: scylla.scylladb.com
version: v1
kind: ScyllaCluster
name: scylla-manager-cluster
EOF
kubectl kustomize "${ARTIFACTS_DEPLOY_DIR}/manager" | kubectl_create -n=scylla-manager -f=-
fi

# TODO: modify log level
kubectl kustomize "${ARTIFACTS_DEPLOY_DIR}/manager" | kubectl_create -n=scylla-manager -f=-

kubectl -n=scylla-manager wait --timeout=5m --for='condition=Progressing=False' scyllaclusters.scylla.scylladb.com/scylla-manager-cluster
kubectl -n=scylla-manager wait --timeout=5m --for='condition=Degraded=False' scyllaclusters.scylla.scylladb.com/scylla-manager-cluster
kubectl -n=scylla-manager wait --timeout=5m --for='condition=Available=True' scyllaclusters.scylla.scylladb.com/scylla-manager-cluster
Expand Down

0 comments on commit 4570486

Please sign in to comment.