Improved repository creation and user interaction

This commit is contained in:
Luca Frosini 2019-07-23 12:30:55 +02:00
parent b9827284fc
commit 501e71f437
1 changed files with 8 additions and 5 deletions

View File

@ -12,8 +12,10 @@ OLD_MAVEN_PARENT_VERSION="1.0.0"
NEW_MAVEN_PARENT_VERSION="1.1.0-SNAPSHOT"
GITEA_TOKEN=""
GIT_OK=false
function git_repository {
local GIT_OK=false
while [ "$GIT_OK" = false ]
do
@ -25,8 +27,8 @@ function git_repository {
GIT_OK=true;
break;;
No )
git_create_repository
GIT_OK=false
git_create_repository
break;;
Abort )
exit;;
@ -52,8 +54,9 @@ function git_create_repository {
case $yna in
Yes )
curl -X POST "https://code-repo.d4science.org/api/v1/org/gCubeSystem/repos?access_token=$GITEA_TOKEN" -H "accept: application/json" -H "content-type: application/json" -d "{\"name\":\"${GIT_REPOSITORY_DIRECTORY_NAME}\"}"
echo ""
GIT_CREATE_OK=true;
echo "\n"
GIT_CREATE_OK=true;
GIT_OK=true;
break;;
No )
echo "Please created it at https://code-repo.d4science.org/repo/create?org=5722 and select yes to continue. See how to do it at https://wiki.gcube-system.org/gcube/Git_Repositories#Create_a_New_Repository"
@ -310,4 +313,4 @@ rm -rf $MIGRATION_DIRECTORY
echo "Well Done"
echo "Please configure the Jenkins Building system for your project at https://jenkins.d4science.org/ See how to do it at https://wiki.gcube-system.org/gcube/Jenkins_Projects_(aka_Jobs)"
echo "Please Add Webhhoks on Gitea at https://code-repo.d4science.org/gCubeSystem/${GIT_REPOSITORY_DIRECTORY_NAME} See hot to do it at https://wiki.gcube-system.org/gcube/Gitea/Jenkins:_Setting_up_Webhooks#Webhook_on_the_Gitea_repository"
echo "Please Add Webhhoks on Gitea at https://code-repo.d4science.org/gCubeSystem/${GIT_REPOSITORY_DIRECTORY_NAME} See hot to do it at https://wiki.gcube-system.org/gcube/Gitea/Jenkins:_Setting_up_Webhooks#Webhook_on_the_Gitea_repository"