diff --git a/cicd/get-credentials.sh b/cicd/get-credentials.sh index 9f6de39..120d011 100755 --- a/cicd/get-credentials.sh +++ b/cicd/get-credentials.sh @@ -25,4 +25,18 @@ Gitea Password: ${gitea_password} EOF -echo "credentials.txt file created with ArgoCD details." \ No newline at end of file +echo "credentials.txt file created with ArgoCD details." + +# Setting up gitconfig +git config --global user.name "CNOE" +git config --global user.email "cnoe@io" + +GITEA_PAT=$(kubectl get secret gitea-token -n gitea -o jsonpath='{.data.token}' | base64 -d) +GIT_CREDS="$HOME/.git-credentials" +cat > $GIT_CREDS << EOT +https://giteaAdmin:${GITEA_PAT}@${IDE_DOMAIN}/gitea +EOT + +git config --global credential.helper 'store' + +echo "Git config update completed." \ No newline at end of file