simplifie le test de création de l'orga comme équipe MM

This commit is contained in:
fab
2026-08-03 16:29:57 +02:00
parent 2211bb7e05
commit 0bd363d31d
+5 -9
View File
@@ -661,16 +661,12 @@ EOF
if [ "${EQUIPE_AGORA}" != "" -a "${EQUIPE_AGORA}" != "kaz" ]; then if [ "${EQUIPE_AGORA}" != "" -a "${EQUIPE_AGORA}" != "kaz" ]; then
# l'équipe existe t-elle déjà ? # l'équipe existe t-elle déjà ?
#nb=$(docker exec mattermostServ bin/mmctl team list | grep -w "${EQUIPE_AGORA}" | wc -l)
http_code=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer ${mattermost_token}" "https://${URL_AGORA}/api/v4/teams/name/${EQUIPE_AGORA}") http_code=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer ${mattermost_token}" "https://${URL_AGORA}/api/v4/teams/name/${EQUIPE_AGORA}")
[ "$http_code" -eq 200 ] && nb=1 || nb=0
if [ "${nb}" == "0" ];then # non, on la créé en mettant le user en admin de l'équipe if [ "$http_code" -eq 200 ]; then
echo "équipe trouvée"
#echo "docker exec -i mattermostServ bin/mmctl team create --name ${EQUIPE_AGORA} --display-name ${EQUIPE_AGORA} --email ${EMAIL_SOUHAITE}" --private | tee -a "${CMD_INIT}" else
# non, on la créé en mettant le user en admin de l'équipe
#################################
cat >> "${CMD_LOGIN}" <<EOF cat >> "${CMD_LOGIN}" <<EOF
resp=\$(curl -s -X POST "https://${URL_AGORA}/api/v4/teams" \ resp=\$(curl -s -X POST "https://${URL_AGORA}/api/v4/teams" \
-H "Authorization: Bearer ${mattermost_token}" \ -H "Authorization: Bearer ${mattermost_token}" \
@@ -692,8 +688,8 @@ EOF
-H "Authorization: Bearer ${mattermost_token}" \ -H "Authorization: Bearer ${mattermost_token}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{"roles":"team_user team_admin"}' -d '{"roles":"team_user team_admin"}'
EOF
EOF
fi fi