[ Cmii ] [ Octopus ] - fix a lot of bugs

This commit is contained in:
zeaslity
2024-04-08 15:19:15 +08:00
parent fcca3d5275
commit 8e2385e4ac
14 changed files with 270 additions and 75 deletions

View File

@@ -0,0 +1,20 @@
#!/bin/bash
# 设置local和tc-sh的别名
set_minio_endpoint_alias() {
mc alias set local http://localhost:9000 cmii B#923fC7mk
mc alias set tc-sh http://42.192.52.227:9000/ cmii B#923fC7mk
}
create_bucket_in_tc_sh() {
mc mb tc-sh/octopus
mc anonymous set public tc-sh/octopus
}
delete_prune_tc_sh_bucket() {
mc rm --recursive --force tc-sh/octopus/
}
set_minio_endpoint_alias
mc cp -r local/octopus/ tc-sh/octopus/

View File

@@ -1,5 +1,7 @@
#!/bin/bash
# should upload to Octopus OSS
# Check if the correct number of arguments are provided
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <name_space> <deployment_name> <new_tag>"
@@ -23,9 +25,7 @@ old_tag=${old_tag#*:}
# echo "old_tag is ${old_tag}"
# echo "image prefix is => ${image_prefix}"
kubectl -n "${name_space}" patch deployment "${deployment_name}" -p "{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"${deployment_name}\",\"image\": \"${image_prefix}:${new_tag}\"}]}}}}" >> /dev/null
kubectl -n "${name_space}" patch deployment "${deployment_name}" -p "{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"${deployment_name}\",\"image\": \"${image_prefix}:${new_tag}\"}]}}}}" >>/dev/null
real_new_tag=$(kubectl -n "${name_space}" get deployment "${deployment_name}" -o=jsonpath='{.spec.template.spec.containers[*].image}' | grep -oE ':[0-9]+\.[0-9]+\.[0-9]+.*')
real_new_tag=${real_new_tag#*:}