- fix git init
This commit is contained in:
parent
a5e7b0b5b3
commit
87c38d365a
15
func/git.sh
15
func/git.sh
|
|
@ -36,18 +36,19 @@ gitinit(){
|
|||
msg_info "Adding origin : ${3:-$CONFIG_GIT_SERVER}$(basename "$(pwd)")"
|
||||
git remote add origin "${3:-$CONFIG_GIT_SERVER}$(basename "$(pwd)")}"
|
||||
|
||||
msg_info "Try to create reposiroty on git server : curl -X POST ${CONFIG_GIT_SERVER}/api/v1/user/repos
|
||||
-H accept: application/json
|
||||
-H Authorization: token ${CONFIG_GIT_TOKEN_INIT}
|
||||
-H Content-Type: application/json
|
||||
-d {\"name\":\"frogg_ssl_check\", \"private\":true}"
|
||||
msg_info "Try to create repository on git server...
|
||||
curl -X POST \"${CONFIG_GIT_SERVER}/api/v1/user/repos\" \\
|
||||
-H \"accept: application/json\" \\
|
||||
-H \"Authorization: token ${CONFIG_GIT_TOKEN_INIT}\" \\
|
||||
-H \"Content-Type: application/json\" \\
|
||||
-d \"{\\\"name\\\":\\\"frogg_ssl_check\\\", \\\"private\\\":true}\""
|
||||
|
||||
# Create repo on git server
|
||||
if ! curl -X POST "${CONFIG_GIT_SERVER}/api/v1/user/repos" \
|
||||
if ! curl -f -s -X POST "${CONFIG_GIT_SERVER}/api/v1/user/repos" \
|
||||
-H "accept: application/json" \
|
||||
-H "Authorization: token ${CONFIG_GIT_TOKEN_INIT}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"name":"frogg_ssl_check", "private":true}';then
|
||||
-d "{\"name\":\"frogg_ssl_check\", \"private\":true}"; then
|
||||
|
||||
msg_error "Error while creating new repository on ${CONFIG_GIT_SERVER}"
|
||||
return 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue