github.com/freiheit-com/kuberpult@v1.24.2-0.20240328135542-315d5630abe6/infrastructure/scripts/create-testdata/create-env-group-lock.sh (about) 1 #!/bin/bash 2 set -eu 3 set -o pipefail 4 set -x 5 6 envGroup=prod 7 lockId=lockIdTest${RANDOM} 8 lockId=lockIdIntegration0 9 url="http://localhost:8081/environment-groups/${envGroup}/locks/${lockId}" 10 echo $url 11 useSignature=false 12 if ${useSignature} 13 then 14 SIGNATURE=$(echo -n "${envGroup}""${lockId}" | gpg --keyring trustedkeys-kuberpult.gpg --local-user kuberpult-kind@example.com --detach --sign --armor) 15 json=$(jq -n --arg signature "${SIGNATURE}" --arg message "test env group lock" '$ARGS.named') 16 else 17 json=$(jq -n --arg message "test env group lock" '$ARGS.named') 18 fi 19 20 curl -X PUT "$url" -d "${json}" -H 'Content-Type: application/json' 21 echo 22 echo created locks with ID "'""${lockId}""'" 23 24 25