diff --git a/gitea/gitea.yaml b/gitea/gitea.yaml index 9878193..bf8b033 100644 --- a/gitea/gitea.yaml +++ b/gitea/gitea.yaml @@ -132,7 +132,7 @@ data: sleep 30s echo "wget tea..." - wget https://git.undercloud.local:3000/Undercloud/undercloud-infrastructure/raw/branch/main/k8s-binaries/tea + wget http://git.undercloud.local:3000/Undercloud/undercloud-infrastructure/raw/branch/main/k8s-binaries/tea #echo "wget ctea..." #wget https://git.undercloud.local:3000/Undercloud/undercloud-infrastructure/raw/branch/main/k8s-binaries/ctea chmod +x tea @@ -159,36 +159,40 @@ data: #./ctea --username shodan --password $SHODAN_PW --url http://localhost:3000 AddUserToTeam undercloud undercloud argocd sleep 5s - # create team "Undercloud" in org "Undercloud" + # create team "Undercloud" in org "undercloud" curl -s -u "shodan:$SHODAN_PW" -H 'Content-Type: application/json' \ - -X POST http://localhost:3000/api/v1/orgs/Undercloud/teams \ - -d '{"name":"Undercloud","permission":"write","includes_all_repositories":false}' + -X POST http://localhost:3000/api/v1/orgs/undercloud/teams \ + -d '{"name":"Undercloud","permission":"write","includes_all_repositories":false, + "units":["repo.code","repo.issues","repo.pulls","repo.releases","repo.wiki","repo.projects"]}' - # get team id - TEAM_ID=$(curl -s -u "shodan:$SHODAN_PW" \ - http://localhost:3000/api/v1/orgs/Undercloud/teams \ - | jq -r '.[] | select(.name=="Undercloud") | .id') + # get team id without jq + TEAM_ID=$( + curl -s -u "shodan:$SHODAN_PW" \ + "http://localhost:3000/api/v1/orgs/undercloud/teams/search?q=Undercloud&limit=1" | + sed -n 's/.*"id":\([0-9][0-9]*\).*/\1/p' + ) # add user argocd to that team curl -s -u "shodan:$SHODAN_PW" -X PUT \ - http://localhost:3000/api/v1/teams/$TEAM_ID/members/argocd + "http://localhost:3000/api/v1/teams/${TEAM_ID}/members/argocd" - echo "cloning k8aux-apps" - #execline-cd /data git clone http://git.undercloud.local:3000/undercloud/k8aux-apps.git - execline-cd /data git clone "http://shodan:${SHODAN_PW}@git.undercloud.local:3000/Undercloud/k8aux-apps.git" - execline-cd /data/k8aux-apps rm -Rf .git - execline-cd /data/k8aux-apps git init - execline-cd /data/k8aux-apps git config --global user.email "thrawn235@gmail.com" - execline-cd /data/k8aux-apps git config --global user.name "shodan" - execline-cd /data/k8aux-apps git add . - execline-cd /data/k8aux-apps git commit -m "upload" - echo "push k8aux-apps to localhost" - execline-cd /data/k8aux-apps git push http://shodan:$SHODAN_PW@localhost:3000/undercloud/k8aux-apps.git --all + echo "cloning k8s-apps" + #execline-cd /data git clone http://git.undercloud.local:3000/undercloud/k8s-apps.git + execline-cd /data git clone "http://shodan:${SHODAN_PW}@git.undercloud.local:3000/Undercloud/k8s-apps.git" + + execline-cd /data/k8s-apps rm -Rf .git + execline-cd /data/k8s-apps git init + execline-cd /data/k8s-apps git config --global user.email "thrawn235@gmail.com" + execline-cd /data/k8s-apps git config --global user.name "shodan" + execline-cd /data/k8s-apps git add . + execline-cd /data/k8s-apps git commit -m "upload" + echo "push k8s-apps to localhost" + execline-cd /data/k8s-apps git push http://shodan:$SHODAN_PW@localhost:3000/Undercloud/k8s-apps.git --all echo "delete local copy..." - #execline-cd /data rm -Rf k8aux-apps + #execline-cd /data rm -Rf k8s-apps echo "create PushMirror.." ./ctea --username shodan --password $SHODAN_PW --url http://localhost:3000 AddPushMirror undercloud k8aux-apps "http://aux1.undercloud.cf.:3000/undercloud/k8aux-apps.git" shodan $SHODAN_PW 1h0m0s ./ctea --username shodan --password $SHODAN_PW --url http://localhost:3000 AddPushMirror undercloud k8aux-apps "http://aux2.undercloud.cf.:3000/undercloud/k8aux-apps.git" shodan $SHODAN_PW 1h0m0s